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

Compare commits

..

865 Commits

Author SHA1 Message Date
nossr50
b41637fbf8 2.1.47 2019-04-21 17:08:58 -07:00
nossr50
7506646862 Party NPE fix 2019-04-21 16:56:26 -07:00
nossr50
227fb49dec 2.1.46 2019-04-19 17:59:00 -07:00
nossr50
78fdfc1c35 Made improvements to the Party member list from /party 2019-04-19 17:56:59 -07:00
nossr50
0b26d6c72c Fixed error related to Bleed, fixed missing default XP values for Herbalism and Woodcutting 2019-04-19 14:55:07 -07:00
nossr50
cae722e8c7 Changelog upd 2019-04-19 14:34:21 -07:00
Robert A. C
0eed1a6c5a Merge pull request #3892 from Zed-I/patch-3
Fixed bug where you couldn't shake zombie/creeper heads
2019-04-19 13:06:00 -07:00
Zed-I
bbf7ce9c57 Fixed bug where skeleton heads would drop in instead of zombie/creeper heads on successful shake
Creeper/zombie heads are now their own items and data is no longer used
2019-04-19 20:35:06 +02:00
Robert A. C
1fa21823a4 Merge pull request #3891 from Zed-I/patch-2
Fixed axe salvage bug
2019-04-19 10:12:37 -07:00
Zed-I
4b34299648 Fixed axe salvage bug
Changes max quantity to 3 from 2 on all axes since they are crafted with 3 resources not 2
2019-04-19 14:36:29 +02:00
nossr50
45841218e6 dev mode 2019-04-18 16:34:19 -07:00
Robert A. C
c509daff9f Merge pull request #3890 from OverCrave/master
Fix adminchat returning too early if send by the console
2019-04-18 15:13:21 -07:00
OverCrave
ce92329705 fix it for real now 2019-04-18 22:59:52 +02:00
OverCrave
817b5364cf fix adminchat returning too early if send by console 2019-04-18 22:58:50 +02:00
nossr50
820c3260c8 2.1.45 - mcMMO will check for outdated software and provide tips 2019-04-17 11:51:13 -07:00
Robert A. C
54a1475fef Merge pull request #3878 from andris155/patch-2
Update locale_hu_HU.properties
2019-04-15 10:43:12 -07:00
András Marczinkó
bd0204a09e Update locale_hu_HU.properties 2019-04-15 10:10:33 +02:00
nossr50
31c1bd52bc 2.1.44 2019-04-14 05:39:23 -07:00
nossr50
0f8c0f97d9 Fixing another NPE for brewing 2019-04-14 05:27:31 -07:00
nossr50
5a56b27ea8 Fix AlchemyBrew NPE 2019-04-14 04:55:37 -07:00
nossr50
273dfbbdce 2.1.43 2019-04-14 04:23:28 -07:00
nossr50
138b109ff5 Correct display error when successfully salvaging enchantments 2019-04-13 22:04:35 -07:00
Robert A. C
908ac7c541 Update README.md 2019-04-13 15:56:00 -07:00
Robert A. C
e7e13d990a Update README.md 2019-04-13 15:55:38 -07:00
Robert A. C
ea9f79291e Update readme.md
Adjusting the team information to represent the current state of the project
2019-04-13 15:51:03 -07:00
nossr50
4b13cbeb43 2.1.42 2019-04-13 13:20:49 -07:00
nossr50
d542098f8a New salvage enchant bypass permission node 2019-04-13 13:17:28 -07:00
nossr50
f6e01ea910 UserManager::getPlayer returns null again (oopsie) 2019-04-13 12:58:32 -07:00
nossr50
2a053a0be2 Fixing logic error in mcrank CD msg 2019-04-12 15:34:33 -07:00
nossr50
b5cbfc7f66 Commands.Database.CooldownMS - new locale string 2019-04-12 15:29:37 -07:00
nossr50
8c0076ff80 2.1.41 2019-04-12 15:24:57 -07:00
nossr50
6e3c2fcb76 Fix mcrank cd display 2019-04-12 15:24:01 -07:00
nossr50
33a68daa9c mcMMO now checks in all places for a loaded profile before executing processing on said profile 2019-04-12 15:17:05 -07:00
nossr50
00cc5f0845 Move Fall data to AcrobaticsManager 2019-04-11 04:09:00 -07:00
nossr50
8b0a580505 Fixing Party Chat Bug 2019-04-11 03:49:13 -07:00
nossr50
87bf3a5b40 fixing an oopsie 2019-04-11 00:00:22 -07:00
nossr50
426b1304e2 Numerous tweaks + failsafes added to Loading/Saving of players 2019-04-10 01:52:34 -07:00
nossr50
f1204f8a2a 2.1.39 - Added Seagrass/Tall_Seagrass to experience tables
Salvage should sound a bit different to Repair now
Fixes #3863 #3862
2019-04-09 16:34:38 -07:00
nossr50
f7b07899c1 2.1.38 2019-04-08 17:58:44 -07:00
nossr50
e5de240eb4 Reduced Roll XP CD from 60s - > 10s 2019-04-08 17:58:06 -07:00
Robert A. C
0ba3d7bd68 Update README.md 2019-04-08 03:17:36 -07:00
Robert A. C
79d5c6192f Update README.md 2019-04-08 03:17:16 -07:00
Robert A. C
b8ae8438de Merge pull request #3861 from FabioZumbi12/patch-4
Update locale_pt_BR.properties
2019-04-07 00:26:53 -07:00
FabioZumbi12
974106f983 Update locale_pt_BR.properties 2019-04-07 04:03:08 -03:00
nossr50
d599db2897 2.1.37 - Fixes #3859 2019-04-06 05:14:52 -07:00
Robert A. C
3f89f91f42 Merge pull request #3857 from andris155/patch-1
Update locale_hu_HU.properties
2019-04-05 01:45:12 -07:00
András Marczinkó
2fca0963d7 Update locale_hu_HU.properties
Improve AbilityGateRequirementFail translation.
Translated new translation lines.
Update and fix Guides.Mining.Section.4
2019-04-05 10:44:01 +02:00
nossr50
b63db1981c 2.1.36 2019-04-04 19:08:20 -07:00
nossr50
af744fa088 Villagers give XP now 2019-04-04 18:55:25 -07:00
nossr50
8538ac4e50 mcnotify will now squelch notifications from mcMMO & players who are squelched will be reminded of their squelch status at least once an hour (you can disable this in advanced.yml) 2019-04-04 17:27:17 -07:00
Robert A. C
cabc5977d9 Merge pull request #3856 from OverCrave/master
German Locale Update
2019-04-04 04:30:44 -07:00
OverCrave
43dd382541 fix concoction name inconsistency 2019-04-04 13:12:55 +02:00
OverCrave
cdb81e961e fix herbalism name inconsistency 2019-04-04 13:11:24 +02:00
OverCrave
51ced83301 mining guide update 2019-04-04 13:09:57 +02:00
OverCrave
09bca96af3 Merge remote-tracking branch 'upstream/master' 2019-04-04 13:05:37 +02:00
nossr50
f1d9f787f4 2.1.35 2019-04-04 00:39:00 -07:00
nossr50
b8b0be71b1 2.1.34 2019-04-03 22:01:45 -07:00
nossr50
ac10261803 Blast Mining uses Pickaxe + Missing Taming XP entries 2019-04-03 21:54:49 -07:00
OverCrave
dc018be6bb overhaul part 2
- fixed/changed punctuation and grammar in some of the skills
- fixed some skills commands not having the same name as their shown name
2019-04-03 22:20:59 +02:00
OverCrave
832b653a88 change usage of word 'wahrscheinlichkeit/chance' for consistency 2019-04-03 21:50:38 +02:00
OverCrave
1fddaf15cc add last missing new translations 2019-04-03 21:49:16 +02:00
nossr50
b68feb6992 rogue import spotted 2019-04-02 23:07:52 -07:00
nossr50
f3837265db 2.1.33 2019-04-02 23:03:48 -07:00
nossr50
ae551e17cd 2.1.32 2019-04-01 10:16:43 -07:00
nossr50
c6d055cb48 Completely remove Fireworks from mcMMO 2019-04-01 10:04:45 -07:00
nossr50
68e34d682c 2.1.31 2019-03-30 17:45:03 -07:00
nossr50
b125600dac Fixing an issue with mmoedit triggering notifications for skills already unlocked 2019-03-30 17:44:06 -07:00
Robert A. C
57b31b60b3 Merge pull request #3843 from Ineusia/master
Minor API fix
2019-03-30 17:09:27 -07:00
nossr50
7757e187be Fixed a bug involving SubSkill notifications
Fixes #3808, also fixed the notification timer
2019-03-30 16:56:00 -07:00
Robert A. C
5ce360d443 Merge pull request #3844 from OverCrave/master
German Locale Overhaul
2019-03-30 10:21:44 -07:00
OverCrave
d44b6e0afb readd other locales 2019-03-30 17:59:25 +01:00
OverCrave
629d882831 Merge remote-tracking branch 'upstream/master' 2019-03-30 17:57:14 +01:00
OverCrave
947018c0f1 remove other languages temporarily 2019-03-30 17:56:40 +01:00
BuildTools
ca2e1c11e6 Don't load the players profile just to get their name 2019-03-29 23:56:40 -05:00
nossr50
69e5d3e1b5 2.1.30 2019-03-29 18:21:07 -07:00
nossr50
b7d33f0227 Adding missing Double Drop entries for Woodcutting 2019-03-29 18:11:32 -07:00
nossr50
28c7fdd4e2 Add missing Herbalism entries to config 2019-03-29 17:57:48 -07:00
nossr50
53534e0f1d Fixing Mining Double Drops (update configs) 2019-03-29 17:44:54 -07:00
nossr50
8d477a5cf5 unused imports 2019-03-29 11:33:40 -07:00
nossr50
74908cdcf5 2.1.29 - Double Drop Fix 2019-03-29 11:27:49 -07:00
Robert A. C
39b22d0ee8 Merge pull request #3841 from Fabrimat/patch-3
Update locale_it.properties
2019-03-28 08:05:57 -07:00
Fabrizio La Rosa
74e62ab08c Update locale_it.properties 2019-03-28 16:01:21 +01:00
OverCrave
f1cc745de8 fully translate party stuff 2019-03-28 13:41:39 +01:00
OverCrave
7654e78fbe Update locale_de.properties 2019-03-28 12:44:00 +01:00
OverCrave
558c727136 change color code usage style 2019-03-28 12:35:08 +01:00
OverCrave
18097fa1a5 Update locale_de.properties 2019-03-28 12:26:15 +01:00
nossr50
e2b8d940d3 2.1.28 2019-03-28 04:22:26 -07:00
OverCrave
5093c37efb Update locale_de.properties
so much done so much still missing .-.
2019-03-28 12:10:11 +01:00
OverCrave
610e1a6bf4 Merge remote-tracking branch 'upstream/master' 2019-03-28 11:25:56 +01:00
OverCrave
99843f2735 update en_US to upstream version 2019-03-28 11:25:41 +01:00
nossr50
732726bbd3 2.1.27 - Fixed an exploit that allowed players to dupe torches, rails, etc 2019-03-27 21:05:57 -07:00
nossr50
65687ca603 2.1.26 - Combat Skills are MUCH more deadly 2019-03-27 16:40:08 -07:00
nossr50
658382dba2 Added Limit Break to Archery, Axes, Swords, Unarmed 2019-03-27 16:30:29 -07:00
nossr50
404a876d6b Compiler made an oopsie 2019-03-27 12:36:46 -07:00
nossr50
c4a383c4fb Removed PVP requirement on Stab, added info about Stab to /swords 2019-03-27 12:33:04 -07:00
nossr50
e0341f7ae7 Added new subskill to Swords, Stab 2019-03-27 12:11:11 -07:00
nossr50
018c6fc96b 2.1.26 Dev Version 2019-03-27 11:27:27 -07:00
nossr50
d324aa9589 Rescale Iron Arm Damage 2019-03-27 11:27:05 -07:00
OverCrave
cc1c73cb17 Update locale_de.properties
stopped at Fishing.Exhausting
2019-03-26 22:33:44 +01:00
OverCrave
d6dc8bb04c Update locale_da.properties
generated by the eclipse property tool
2019-03-26 21:35:01 +01:00
OverCrave
88ef6b0984 Update locale_de.properties 2019-03-26 21:34:31 +01:00
OverCrave
624299602d Update locale_de.properties 2019-03-26 21:14:30 +01:00
OverCrave
8fe8db2353 Update locale_de.properties 2019-03-26 20:21:11 +01:00
OverCrave
159cf7c0d4 remove unused translations
this change removes every translation in every locale that does not exist in locale_en_US anymore, to keep everything up to date
2019-03-26 20:05:46 +01:00
OverCrave
947cdc91a4 Update locale_de.properties 2019-03-26 19:52:36 +01:00
OverCrave
ff55cbb946 Update locale_de.properties 2019-03-26 19:40:47 +01:00
OverCrave
fdb151083d Update locale_de.properties 2019-03-26 19:33:18 +01:00
nossr50
7a3d608f36 2.1.25 2019-03-26 08:36:13 -07:00
nossr50
719283177e Shake has an upper limit of 10 damage (will be configurable in the near future), alchemy ranks adjusted 2019-03-26 08:22:39 -07:00
nossr50
55fb3ed74f 2.1.24 - Critical Exploit Fix 2019-03-25 15:12:17 -07:00
nossr50
363ea66335 2.1.23 - Read the changelog, configs need to be updated. 2019-03-24 19:02:08 -07:00
nossr50
7ee65a7e65 Fixing a 7 year old damage bug. 2019-03-24 14:20:20 -07:00
nossr50
aa25ba6338 Fixed DoubleDrops for Mining, MANY nerfs to Rupture (PVP balance tweaks coming soon) 2019-03-23 22:57:44 -07:00
nossr50
b68bbad766 Eject players from Minecarts if they cast a fishing rod (Anti-AFK) 2019-03-23 21:01:40 -07:00
nossr50
6d19239db7 Don't add drops for items with a quantity of zero 2019-03-23 18:09:29 -07:00
nossr50
faab64864a Fixing Double Drops for Mining -- READ THE FULL COMMIT MSG
This fix is very similar to what was deployed for Herbalism in 2.1.22

NOTE: Here's what your Double_Drop entries in Config.yml for Mining should look like

https://paste.gg/p/anonymous/dcd06f1215844311b4f2225f200090d1

IMPORTANT: Version 2.1.22 which came before this had a similar fix for Herbalism, instructions on how to fix your Herbalism Double Drops can be found here
        https://www.spigotmc.org/resources/official-mcmmo.64348/update?update=269868
2019-03-23 18:07:23 -07:00
nossr50
b1f4ea8cba 2.1.22 release 2019-03-23 16:35:05 -07:00
nossr50
df6315dd62 Fixed Repair Mastery using incorrect numbers during calculations 2019-03-23 16:23:38 -07:00
nossr50
255f7bf335 Fixes #3832 - Resolved issue with double drops & herbalism, similar fixes coming to woodcutting/mining soon. Reminder to update config.yml, read changelog for instructions.
If you harvest crops with a Hoe it does not require seeds to replant on successful Green Thumb
2019-03-23 16:21:25 -07:00
nossr50
ce6553d857 Fixing Double Drops for Herbalism (Update your configs) see changelog for instructions 2019-03-23 13:34:14 -07:00
Robert A. C
df1497924c Merge pull request #3830 from andris155/patch-1
Added Fishing.LowResources translation to Hungarian locale file
2019-03-22 08:56:52 -07:00
András Marczinkó
aeed0cf6ad Added Fishing.LowResources translation to Hungarian locale file 2019-03-22 16:38:04 +01:00
nossr50
e40a7bb4e1 XP Gain from Roll has a CD now (60 seconds) 2019-03-21 14:32:01 -07:00
nossr50
d59dbe7630 update log 2019-03-20 07:08:39 -07:00
nossr50
dece43429d Added an option to turn off fishing exploit detection as a band-aid fix until the config update is done 2019-03-20 07:04:05 -07:00
Robert A. C
14f900aa83 Merge pull request #3828 from andris155/patch-1
Update Hungarian locale file
2019-03-19 01:36:02 -07:00
András Marczinkó
53848d3fd3 Update Hungarian locale file 2019-03-19 09:33:55 +01:00
nossr50
c8d95dc711 2.1.19 2019-03-18 03:12:00 -07:00
nossr50
bb118607ce Less aggressive detection 2019-03-18 02:40:19 -07:00
nossr50
2d849f55e5 Smaller bounds on fishing scarcity 2019-03-18 00:43:14 -07:00
nossr50
fef9058e16 Fishing is now more aggressive about over casting, added messages about fishing, removed vanilla rewards for exploiters 2019-03-18 00:26:49 -07:00
nossr50
e3d2526939 Improve Fishing AFK detection 2019-03-18 00:11:27 -07:00
nossr50
2f0a58b968 2.1.18 - It turns out Kelp is actually made up of 2 blocks mixed together 2019-03-16 20:26:26 -07:00
nossr50
8994594ed4 2.1.17 - Fix drowned mob spawner logic 2019-03-14 16:52:15 -07:00
nossr50
bb46b2a6ac Drowned Transformation will no longer enabled XP on mob spawners, Kelp will now count the whole block for XP 2019-03-13 13:27:16 -07:00
nossr50
7296deb149 2.1.15 Release - Fixing Fuel Efficiency Max Rank Benefits 2019-03-09 18:10:01 -08:00
nossr50
ef5cd3ec60 2.1.14 release 2019-03-09 17:36:20 -08:00
nossr50
f9f6d1550e Silk Touch toggle in advanced.yml for double drops 2019-03-09 17:31:45 -08:00
nossr50
68e43e3641 Mycellium removed from XP tables for woodcutting 2019-03-09 17:23:17 -08:00
nossr50
93458aa355 Kelp added to Herbalism XP tables 2019-03-09 17:18:04 -08:00
nossr50
e80e771e9d mcMMO now tracks blocks moved by pistons and flags them as unnatural, even if they were natural to combat automated xp farming 2019-03-09 17:12:34 -08:00
nossr50
af9b631ee2 kill flux mining 2019-03-09 16:44:55 -08:00
nossr50
ca5a46508d fixing a bug with setting ranks for fuel efficiency 2019-03-09 16:35:23 -08:00
nossr50
7703cafa34 fixing compile error 2019-03-09 16:25:51 -08:00
nossr50
437fe29112 Fuel Efficiency now uses a rank system, also fixed some bugs with it 2019-03-09 16:22:20 -08:00
nossr50
28b71804a2 Fixed display bug w/ Fish Diet, added Tropical, Raw Cod/Salmon to eligible foods 2019-03-09 15:48:29 -08:00
nossr50
6f15cd4005 2.1.13 Release 2019-03-08 15:34:35 -08:00
nossr50
ba88831c88 2.1.12 2019-02-15 10:21:39 -08:00
nossr50
c0a3d63213 Salvage entries are no longer case sensitive 2019-02-06 18:00:21 -08:00
nossr50
5e8a840418 Ignore Gradle Files 2019-02-06 17:47:06 -08:00
nossr50
dbf32b4715 Back to work 2019-02-06 17:07:08 -08:00
nossr50
017e32c30a Fishing will no longer cancel the exp dropped for ice fishing and will no longer bring xp values below zero with the xp multiplier
Not sure if this fixes the XP bug though!
2019-02-06 12:46:12 -08:00
nossr50
8e048300e8 2.1.11 2019-02-06 11:01:57 -08:00
nossr50
2569ed0565 2.1.10 2019-02-06 03:21:02 -08:00
nossr50
45b4f4a314 Fishing Locale did an oopsie 2019-02-06 03:09:12 -08:00
nossr50
98e6400dd8 Fishing command did an oopsie 2019-02-06 03:01:43 -08:00
nossr50
63d3a328c4 EndStone now gives the same XP as stone
Update your experience.yml
2019-02-05 20:43:56 -08:00
nossr50
06a4f964e8 Updating the mcMMO website link 2019-02-05 20:42:02 -08:00
nossr50
9aef304fd4 Fixing 2.1.9 pom version number 2019-02-05 20:38:33 -08:00
nossr50
f32834411d 2.1.9 Release 2019-02-05 20:35:05 -08:00
nossr50
577e3339f1 Grab the version of WG in a better way 2019-02-05 20:23:20 -08:00
nossr50
36f75457e3 2.2.0 Dev Starts now 2019-02-05 17:24:53 -08:00
nossr50
b67b0a5b94 2.1.8 2019-02-05 16:18:15 -08:00
nossr50
e389c4b8f1 WG API shouldn't be used unless WG is on version 7 2019-02-05 10:49:40 -08:00
nossr50
303a922165 Bite for Master Angler will no longer display so many decimal places
Fixes #3772
2019-02-04 23:29:24 -08:00
nossr50
4ea5432561 Abilities no longer activate if you don't have permission 2019-02-04 22:04:50 -08:00
nossr50
9a428332a9 RetroMode and Standard scaling now have specific keys in advanced.yml to reduce confusion 2019-02-04 21:56:57 -08:00
nossr50
c43fd9bc69 Back to dev 2019-02-03 21:30:12 -08:00
nossr50
77e6e79eb6 Prep for 2.1.7 Release 2019-02-03 18:20:56 -08:00
nossr50
1568f71d83 Fixing a styling bug for party member names 2019-02-03 17:59:29 -08:00
nossr50
f274450376 The bug where hidden players could be seen in the party list should be fixed 2019-02-03 17:56:13 -08:00
nossr50
0b3a642c95 Oopsie 2019-02-03 17:46:03 -08:00
nossr50
025183d434 Tweaks to the party info commands 2019-02-03 17:44:10 -08:00
nossr50
371a3ceec7 Unarmed now has some spam detection
Fixed an error in the skillranks.yml file as well
2019-02-03 13:17:42 -08:00
nossr50
84b3cfc309 Fixed an almost 6 year old bug involving salvage materials smh
Updated the new ExperienceAPI methods to check for level ups
2019-02-02 07:15:12 -08:00
nossr50
14e5998aa0 Added 4 new API methods for adding XP to a player based on blocks 2019-02-01 15:23:45 -08:00
nossr50
c839837d7a Fixing some coloring issues 2019-02-01 11:00:02 -08:00
nossr50
e65e6ad14e Prep for 2.1.6 release 2019-02-01 10:40:39 -08:00
nossr50
fc6c804caf Recolored some lines in the locale related to failure from white to red 2019-02-01 10:36:28 -08:00
nossr50
8228ae248f Fixed a bug where Arcane Salvage could never fail
SubSkillFailure renamed to SubSkillFailed in config.yml
SubSkillFailed now sends to chat by default and no longer sends to the action bar
2019-02-01 10:34:13 -08:00
nossr50
c6a4cbd715 Fixed a bug where Salvage was giving back too many materials 2019-02-01 10:22:55 -08:00
nossr50
90520cd50b 2.1.5 release
mcMMO no longer ignores cancelled PlayerInteractEvents due to conflicts with super ability activations
2019-01-31 20:53:36 -08:00
nossr50
8262711e7e Prep for release of 2.1.4
Fixed many display bugs
Added ranks to Super Repair, and Repair Mastery
Fixes #3754, #3746, #3745, #3756
2019-01-31 20:02:39 -08:00
nossr50
8aa92322d1 Fixed Styling for /salvage 2019-01-31 19:27:23 -08:00
nossr50
bdfac28b44 Fixed Alchemy XP Gain 2019-01-31 18:44:51 -08:00
t00thpick1
cb89a80fd8 Only have 1 xp gain instance for archery. 2019-01-31 19:55:09 -05:00
nossr50
a2f9ab70aa mcMMO no longer ignores cancelled block place events 2019-01-31 15:33:06 -08:00
nossr50
5d010594dd Temporarily disabled Flux Mining
I'll rework this skill in the future
2019-01-31 15:30:39 -08:00
nossr50
d609b45e68 Correcting a bug with the new Enderman Endermite farm exploit fix and making it toggleable for servers that wish to allow it! 2019-01-31 14:40:37 -08:00
nossr50
4c63eee6d5 Entities that target endermite no longer give XP (credits to TheBentoBox for the tip) 2019-01-31 14:30:35 -08:00
nossr50
f3aff37b46 Removing more debug code SORRY!
nossr50 did a double oopsie
2019-01-31 14:18:17 -08:00
nossr50
f2c32f07da Removing leftover debug code
nossr50 did an oopsie
2019-01-31 14:14:15 -08:00
nossr50
bff72486d0 Fixed a bug where static chance skills uses incorrect calculations for success
Cleaned up some leftover code from the old skill unlock system
2019-01-31 14:07:03 -08:00
nossr50
0193b53988 mcMMO now ignores cancelled events for PlayerInteractEvent 2019-01-31 12:56:15 -08:00
nossr50
039542f125 Iron Arm Style no longer checks for Iron Grip levels for its own unlock checks 2019-01-31 11:27:14 -08:00
nossr50
99b50319a3 Prep for 2.1.3 hotfix release 2019-01-30 14:56:31 -08:00
nossr50
7e5a8bc659 Temporarily removed unarmed item pickup until it gets fixed 2019-01-30 08:45:38 -08:00
nossr50
e66ed3f3f1 Prep for release 2019-01-29 17:14:52 -08:00
nossr50
cef9fad49f Fixing unarmed not picking up items properly 2019-01-29 16:13:04 -08:00
nossr50
8ad9419240 Endermen back to 1.0 2019-01-29 08:13:41 -08:00
nossr50
1871c1ec63 endermen and witches give 0.1x modifiers 2019-01-29 07:47:48 -08:00
nossr50
7a721c3229 Tweaking mob XP Values
Phantom added and set to 4.0
Witch is now set to 1.0 instead of 0.0
Ender Dragon is now set to 1.0 instead of 0.0
2019-01-29 07:13:06 -08:00
nossr50
370af987d6 Fixes #3737 2019-01-28 19:35:54 -08:00
nossr50
a22636b2d9 Flux Mining will now be a passive and not an item 2019-01-28 17:48:26 -08:00
nossr50
399a1529f4 Pummel now calculates correctly 2019-01-28 13:14:15 -08:00
nossr50
3734300e59 Fixing an error with shake and RNG calculations 2019-01-28 04:15:34 -08:00
nossr50
fc7b4a6790 Buffed Iron Arm, adding ranks to Iron Arm, Iron Grip, Arrow Deflect, and Disarm 2019-01-28 03:55:30 -08:00
nossr50
00f5491718 Added many styling options
Improved Smelting Style
You can now add the level required to a skills name in the locale (instructions can be found next to the locale string)
2019-01-28 03:40:32 -08:00
nossr50
67ed9d324e Fixing the styling on /smelting 2019-01-28 00:56:15 -08:00
nossr50
ddf953b3b7 Grass block did an oopsie
Fixed Grass not giving treasures
2019-01-27 23:15:53 -08:00
nossr50
f89b7ccc9f better debug stick 2019-01-27 23:12:04 -08:00
nossr50
154b10209d mcMMO will no longer put items into your hands 2019-01-27 22:46:45 -08:00
nossr50
fbc7cbf389 Anti-Cheat compatibility 2019-01-27 22:26:45 -08:00
nossr50
6f81cf7384 Static things shouldn't use a maxbonuslevel from config 2019-01-27 22:01:55 -08:00
nossr50
4f832edada Fixing the fishing AFK detection 2019-01-27 21:55:00 -08:00
nossr50
85a04c71f4 tweaking anti-afk 2019-01-27 21:13:42 -08:00
nossr50
c7ed3ee2a0 Magic Hunter requires treasure hunter and has ranks now 2019-01-27 20:56:16 -08:00
nossr50
7e34e87bc0 Magic Hunter stats now check for treasure hunter 2019-01-27 20:36:55 -08:00
nossr50
b2b623505d Removing traps from fishing command 2019-01-27 20:27:48 -08:00
nossr50
67a57f7472 This might be better 2019-01-27 20:09:32 -08:00
nossr50
d7fe01579b Make sure we clean up buffs from tools 2019-01-27 20:00:58 -08:00
nossr50
e969598f58 Fixing a lot of bugs involving calculating the success of skills 2019-01-27 19:36:16 -08:00
nossr50
be9aeacd70 Fixing lucky displays 2019-01-27 19:00:48 -08:00
nossr50
5f39a7cb80 Fixing a bug where Lucky perk wasn't adding to success 2019-01-27 18:53:10 -08:00
nossr50
7b38658310 Adding mushroom stems to Tree Feller 2019-01-27 18:28:14 -08:00
nossr50
d81c3d06c5 XP Gains now report sources, added some config options regarding XP bars
Fixed some issues with Roll
Fixes https://github.com/mcMMO-Dev/mcMMO/issues/3732
2019-01-27 18:11:51 -08:00
nossr50
a504bc407a Keep track of more fall locations 2019-01-27 00:20:18 -08:00
nossr50
67bcb8da11 Updating the fancy changelog 2019-01-26 23:14:12 -08:00
nossr50
55821f7703 Acrobatics now uses much better anti-exploit prevention 2019-01-26 23:08:05 -08:00
Robert A. C
a601360cbb Merge pull request #3730 from SXRWahrheit/patch-2
Update Changelog_2.1.0.md
2019-01-26 15:30:08 -08:00
SXRWahrheit
444feb1c2c Update Changelog_2.1.0.md 2019-01-26 17:26:37 -06:00
nossr50
6592562c56 Check the target fishing location 2019-01-26 14:41:17 -08:00
nossr50
9aae4825cc Fixing XP gain in fishing 2019-01-26 14:34:28 -08:00
nossr50
22c5280d4e AFK Fishing protection 2019-01-26 14:25:01 -08:00
nossr50
49a91617f0 Back to dev 2019-01-26 14:05:05 -08:00
nossr50
b5bc324f97 Excavation now uses archaeology instead of treasurehunter for its perm node address 2019-01-26 14:01:35 -08:00
Robert A. C
a120981e52 This is now a changelog specific to 2.1.0
Makes it easier to read
2019-01-26 13:35:13 -08:00
nossr50
1df4f74f8c Counter Attack now makes use of a rank system 2019-01-26 12:54:38 -08:00
nossr50
d4d5d9bac1 Gore, Pummel, and Call of The Wild now use the rank system 2019-01-26 12:50:35 -08:00
nossr50
28e963f1eb Disabling unfinished skills until they are finished 2019-01-26 12:45:45 -08:00
nossr50
9626c06b58 Added a nicer changelog 2019-01-26 12:23:30 -08:00
nossr50
baf1796b08 Taming's Beast Lore now uses a rank system 2019-01-26 11:21:42 -08:00
nossr50
b39340227f Greater Impact now uses the rank system 2019-01-26 10:57:04 -08:00
nossr50
105a81aede Axes' Critical Strikes now uses the rank system 2019-01-26 10:55:16 -08:00
nossr50
9ff8692625 Added Dodge, Arrow Retrieval to rank system 2019-01-26 10:52:22 -08:00
nossr50
280971042a Furnaces give XP to the last person to modify their contents 2019-01-26 09:32:28 -08:00
nossr50
6ac1c4fa2c JSON Styling will be handled in the Locale instead of the config 2019-01-26 08:27:58 -08:00
nossr50
d84d487435 Debug stick tells you about placestore & treasure data when hitting blocks 2019-01-26 08:14:06 -08:00
t00thpick1
43d8e08e83 Fix offline inspecting a player hitting an error if the casing didn't match up perfectly. Fixes #3727 2019-01-26 10:51:30 -05:00
nossr50
859063e406 You can now toggle off the skill commands sending blank lines 2019-01-26 07:33:23 -08:00
nossr50
ad990dbb28 Less blank lines on skill commands 2019-01-26 07:27:15 -08:00
nossr50
1c58bd392d Hover tips now show level requirements for upgrading skills 2019-01-25 18:51:04 -08:00
nossr50
cf9117097d MMOInfo command makes better wiki links 2019-01-25 17:54:02 -08:00
nossr50
71d1574a7d Fixing Daze, Counter-Attack, and Serrated Strikes hover tip messages containing {0} 2019-01-25 17:14:10 -08:00
nossr50
f1fc095876 Removed the Kraken 2019-01-25 14:00:18 -08:00
nossr50
3a367d71fa Fishing traps are stupid. 2019-01-25 13:46:26 -08:00
nossr50
f4cab35a46 Fix SkillShot display 2019-01-25 12:49:16 -08:00
nossr50
c22a1a0dd2 Fixing Rupture (Bleed) ConcurrentModificationException
Removed the internal limit on ticks for Rupture
Rupture no longer adds new ticks when applying bleed to an existing target, it instead refreshes the duration
2019-01-25 11:12:31 -08:00
nossr50
a421bd7e4c Fixing the RNG display calculations for RetroMode
I temporarily disabled the output for graceful roll in the stats, will be turning that on again in the morning.
2019-01-25 01:36:14 -08:00
nossr50
ef9b3d40e9 Actually fixing #3709 2019-01-24 21:19:04 -08:00
nossr50
24458879a4 Fixing a bug where an ability length cap of 0 did not properly update skill commands
Fixes #3709
2019-01-24 20:55:46 -08:00
nossr50
1d6a142b12 Rewrote the RNG system to be more unified 2019-01-24 20:45:26 -08:00
nossr50
b7fc3f05e9 Iron Arm & Impact scale with Retro properly now
Fixes #3723
2019-01-24 15:23:39 -08:00
nossr50
3cfd3b0109 Don't modify the list we are iterating over 2019-01-24 13:20:45 -08:00
nossr50
bb64221c6b Fixing some issues with the new skill system and retro mode 2019-01-23 16:44:51 -08:00
nossr50
96b46d31cf Only activate bleed if the target survives the initial strike 2019-01-23 16:21:34 -08:00
nossr50
4031674626 Send bleed messages to the correct player 2019-01-23 16:18:21 -08:00
nossr50
f028d91eb0 account for null entries in bleedtimer 2019-01-23 16:12:52 -08:00
nossr50
c46b7ed3bc dealNoInvulnerabilityTickDamage actually hurts things now 2019-01-23 16:08:41 -08:00
nossr50
71a3eb6a93 Fixed a lot of problems with the bleed task code... 2019-01-23 16:01:30 -08:00
nossr50
6ff13077be Mobhealth bars are no longer a per-player setting.
Removed the mobhealthbar command.
Removed the mobhealthbar permissions.
2019-01-23 15:39:04 -08:00
nossr50
c51be84b50 Serrated now uses Rupture rank to calculate its bleed effect's properties
Gore now actually uses Rupture rank 1 in its calculations
2019-01-23 15:29:31 -08:00
nossr50
3e5c4bc617 Fixing several issues related to Bleed/Rupture
Rupture now keeps track of who applied the damage and attributes it correctly in events
Rupture's bleed timer task no longer caps at the low value of 10 ticks internally
Ruptures bleed check code has had some minor refactoring
2019-01-23 15:22:16 -08:00
nossr50
e5e86246f3 Bleed no longer tells you when a target has stopped bleeding, because its obvious! 2019-01-23 15:08:04 -08:00
nossr50
8f906af99c Refactoring code related to pulling standard/retro mode variables.
Fixing the display and calculation of Super Ability lengths.
Removing the cap on super ability lengths for values less than 1.
Fixing some display errors regarding retro mode and standard.
2019-01-23 15:06:00 -08:00
nossr50
6c0da22d5e Put empty lines above a skill command to make it easier to distinguish from chat 2019-01-23 14:17:14 -08:00
nossr50
6e5feced2f fixing the compiling errors frok Oaks PR 2019-01-23 13:57:19 -08:00
nossr50
6be1319927 WG refactor 2019-01-23 13:55:43 -08:00
Robert A. C
cfeadb54be Merge pull request #3722 from Oaksworth/master
Update effects and stats to alphabetical order
2019-01-23 13:54:24 -08:00
Oaksworth
fd1a0db696 Merge branch 'master' of https://github.com/Oaksworth/mcMMO 2019-01-23 19:41:01 -02:00
Oaksworth
bf38f55f23 Update Woodcutting to alphabetical order 2019-01-23 19:40:44 -02:00
Oaksworth
c467f79d32 Update Unarmed 2019-01-23 19:39:32 -02:00
Oaksworth
9b0023d2d7 Update Taming to alphabetical order 2019-01-23 19:37:51 -02:00
Oaksworth
9be7c2af3c Update SwordsCommand.java 2019-01-23 19:35:15 -02:00
Oaksworth
c146384227 Update Smelting to alphabetical order 2019-01-23 19:32:36 -02:00
Oaksworth
f68ecd3214 Update Repair to alphabetical order 2019-01-23 19:20:25 -02:00
Oaksworth
58e506b041 Update Mining to alphabetical order 2019-01-23 19:16:23 -02:00
Oaksworth
40a13c4c81 Update Herbalism to alphabetical order 2019-01-23 19:14:14 -02:00
nossr50
02781f7458 refactoring WG 2019-01-23 13:13:53 -08:00
Oaksworth
0cd23c1b65 Update Fishing to alphabetical order 2019-01-23 19:11:15 -02:00
Oaksworth
c758346c3f Update Axes to alphabetical order 2019-01-23 19:04:13 -02:00
Oaksworth
a381b6379a Update Archery to alphabetical order 2019-01-23 19:02:09 -02:00
Oaksworth
6241b6dfe9 Update Archery to alphabetical order 2019-01-23 18:58:53 -02:00
Oaksworth
061a6c2a3a Update Acrobatics to alphabetical order 2019-01-23 18:53:38 -02:00
Oaksworth
ebf48e1870 Update SubSkillType.java to alphabetical order 2019-01-23 18:45:43 -02:00
nossr50
92de75e002 Bleed only tells you that you've started bleeding if you aren't already bleeding. 2019-01-23 12:39:51 -08:00
nossr50
c6e1edee91 Rupture will now check your rank before activating 2019-01-23 12:34:21 -08:00
nossr50
6428c65720 Bleed actually doesn't trigger iframes now 2019-01-23 12:28:30 -08:00
nossr50
3edc0bf63f Changing the COTW permission node 2019-01-23 12:19:16 -08:00
nossr50
fb5fd6cc39 Fixing Call of the Wild being missing from /taming 2019-01-23 12:12:17 -08:00
nossr50
f9b2776cb9 Getting rid of unused methods 2019-01-23 11:47:33 -08:00
nossr50
25c8dad1ea fixing XP gains LOL 2019-01-22 20:25:55 -08:00
t00thpick1
ad86db241c Hard fix maven on our end. 2019-01-22 22:12:58 -05:00
nossr50
3d0ba7ce52 work jenkins! 2019-01-22 18:39:13 -08:00
nossr50
9a8ced7aa7 adding SCM to maven pom.xml 2019-01-22 18:09:52 -08:00
nossr50
cf0b60d165 Fixing some errors related to WG 2019-01-22 17:59:45 -08:00
nossr50
cbb726e020 attempt to register flags if they are still not registered 2019-01-22 16:54:43 -08:00
nossr50
0ad1530505 mcMMO now supports WorldGuard, added "mcmmo" and "mcmmo-xp" flags! 2019-01-22 16:40:54 -08:00
nossr50
c0dde01f3e Fixing a display error for retromode and the acrobatics command 2019-01-22 14:21:48 -08:00
nossr50
db3d14fa9f Don't send the URL header if url links are disabled 2019-01-22 14:11:59 -08:00
nossr50
726b04f586 mcMMO now supports world blacklisting 2019-01-22 09:16:02 -08:00
nossr50
76ddcc4cf0 You can now enable Party Friendly Fire 2019-01-21 15:43:54 -08:00
nossr50
11c8374f6c Bleed doesn't suck anymore. 2019-01-21 15:15:10 -08:00
nossr50
848cee18a9 Adding back the mmoinfo string for roll stats 2019-01-21 13:53:45 -08:00
nossr50
42d286e265 Temporary fix to make Roll gain XP again 2019-01-21 13:49:06 -08:00
nossr50
ebbfe72259 Adding roll stats to Acrobatic's stat display 2019-01-21 13:41:56 -08:00
nossr50
6d720e6ab1 Fixing styling on Woodcutting 2019-01-21 13:11:42 -08:00
nossr50
661cf15be1 Fixing styling on Unarmed 2019-01-21 12:54:37 -08:00
nossr50
f30875ac4c Fixing styling on Swords 2019-01-21 12:41:31 -08:00
nossr50
ea0ad38fec Fixing styling on Repair 2019-01-21 11:31:02 -08:00
nossr50
e1f11b4059 Fixing styling on Mining 2019-01-21 11:14:50 -08:00
nossr50
42312349e1 Fixing styling on Herbalism 2019-01-21 10:56:28 -08:00
nossr50
c86012027e Fixing styling on Fishing 2019-01-21 10:43:47 -08:00
nossr50
0a900d9c65 Fixing styling on Excavation 2019-01-21 10:15:17 -08:00
nossr50
038265b033 Fixing styling on Alchemy 2019-01-21 10:09:18 -08:00
nossr50
ba34442ebb Fixing styling on Axes 2019-01-21 08:52:44 -08:00
nossr50
f9ce70e310 Fixing styling on Acrobatics, Archery 2019-01-21 08:46:08 -08:00
nossr50
c728b233e6 Locale files now support &-code formatting used by many plugins 2019-01-21 07:40:04 -08:00
nossr50
e8c8f8b6a1 Level up messages are now easier to modify in the Locale 2019-01-21 07:27:09 -08:00
nossr50
d3765effe0 Adding some missing color to party commands 2019-01-21 06:09:28 -08:00
nossr50
6c77017658 Ability lengths now have a default skill cap at which they stop increasing in length, you can change this in advanced.yml 2019-01-21 05:57:06 -08:00
nossr50
f8b7d5e10d mmoinfo command now links to the official wiki 2019-01-21 05:41:58 -08:00
nossr50
b42b4cadbe You can now turn off sound effects used by mcMMO 2019-01-21 05:23:48 -08:00
nossr50
11461cc220 "mcmmo help" command no longer shows players the category for admin type commands if they lack permissions for said commands 2019-01-21 05:17:59 -08:00
nossr50
4f3174c68b mcrank now works again with scoreboards disabled 2019-01-21 05:06:42 -08:00
nossr50
657e66f3c5 Updating strings related to Archaeology 2019-01-21 04:56:41 -08:00
nossr50
97670f14d1 Treasure Hunter (Exc.) is now Archaelogy, retro mode now scales up treasure drop level requirements by 10, the default file has been edited to reflect this change, I recommend regenerating your treasures.yml by deleting it for now 2019-01-21 04:54:48 -08:00
nossr50
fb8213d87c Swords Counter-Attacks no longer require blocking 2019-01-21 04:39:22 -08:00
nossr50
7c5ebb9902 Adding back some missing colors 2019-01-21 04:28:41 -08:00
nossr50
4e9f5b99b8 Fixing skill messages sent to other players 2019-01-21 03:48:11 -08:00
nossr50
b48fa2d8e5 On second thought I don't like this sound 2019-01-20 04:00:09 -08:00
nossr50
71fc9930ef Stripping Wood is no longer annoying. 2019-01-20 03:17:01 -08:00
nossr50
ec1e7b044c Accidentally made extra details on by default 2019-01-20 02:49:00 -08:00
nossr50
ba4e9e73c3 Forgot to update the changelog 2019-01-20 02:46:09 -08:00
nossr50
ac4b8068b0 Activating a super ability has a sound, and trying to cut down trees or activate skull splitter when on cooldown also has a sound. 2019-01-20 02:44:18 -08:00
nossr50
b1be43154a Roll & Gracefull Roll have sounds now 2019-01-20 02:23:18 -08:00
nossr50
87f84a5f66 Fixed a bug where Retro mode made you 10x luckier 2019-01-20 02:08:26 -08:00
nossr50
e962f645b6 Skill Unlock notifications now have sounds 2019-01-20 01:21:33 -08:00
nossr50
6ad9c8e664 Readying a Tool now has a sound 2019-01-20 00:46:33 -08:00
nossr50
b8a146f8bd Fixed a sync problem where XP bars were 1-step behind 2019-01-19 20:30:19 -08:00
nossr50
b7b0ff13e7 Fixing some redundancy 2019-01-19 19:18:29 -08:00
nossr50
96742e6c42 mcMMO now alerts you when you progress in a skill 2019-01-19 18:51:18 -08:00
nossr50
255ae6c426 Most Super Abilities require level 5 instead of 10 now 2019-01-19 15:14:24 -08:00
nossr50
8c5ea484eb XP Bars will no longer update for party xp or vampirism xp 2019-01-19 15:10:42 -08:00
t00thpick1
eb1f097d18 Fix chorus blocks ignoring blockstore. 2019-01-19 17:02:24 -05:00
t00thpick1
a073984621 This should not be here. 2019-01-19 15:52:53 -05:00
t00thpick1
34fc9725b9 Listen for block multiplace 2019-01-19 15:41:33 -05:00
nossr50
1e1212cd7c Tweaking the extra stats template for xp bars 2019-01-18 17:49:48 -08:00
nossr50
df8f050cf1 Child Skills will not trigger XP bars (for now) 2019-01-18 17:21:05 -08:00
nossr50
e74bc9fd95 XP bars can now be toggled off 2019-01-18 16:18:29 -08:00
nossr50
66878d72bf mcMMO will now start properly with scoreboards off 2019-01-18 14:24:37 -08:00
nossr50
29befac27e Scoreboards are now OFF by default
I don't like them.
2019-01-18 14:20:31 -08:00
nossr50
f5590ce334 XP Bars now can have custom titles (edit the locale) 2019-01-18 13:46:03 -08:00
nossr50
43da10a855 Levels now start at 1 (configurable advanced.yml) 2019-01-18 13:10:45 -08:00
nossr50
9ae58fd2f7 Whoops I forgot to push these 2019-01-18 12:42:05 -08:00
nossr50
cf6d95b575 More config options for XP bars 2019-01-18 12:41:38 -08:00
nossr50
92b8d13c71 Added XP Bars 2019-01-18 11:21:25 -08:00
nossr50
a9ed63d3d0 Adding color to the perk motd 2019-01-17 12:04:09 -08:00
nossr50
7889fe5249 More color tweaks 2019-01-17 12:03:07 -08:00
nossr50
6888a082fc Child Skill commands don't look so bad now 2019-01-17 11:44:01 -08:00
nossr50
1585d8157e Some color tweaks 2019-01-17 10:45:16 -08:00
nossr50
292fc8eff2 Correcting Shake rank requirements 2019-01-17 08:50:44 -08:00
nossr50
126e1c5942 All skills should be on the new rank system now 2019-01-17 08:46:10 -08:00
nossr50
a59907fcec Shake sends custom damagecause 2019-01-16 11:07:11 -08:00
nossr50
f1feeed670 bstats 2019-01-16 11:05:43 -08:00
nossr50
12af9af902 Fixes #3672, Fixes #3316, Fixes #3288, Fixes #2434, Fixes #1732, Fixes #1726, Fixes #1597, Fixes #941 2019-01-15 07:19:00 -08:00
nossr50
6ce44b7ce8 Cleaning up Herbalism & Mining Skill Command 2019-01-15 05:56:49 -08:00
nossr50
52355b2757 Fixing error in Farmer's Diet 2019-01-15 05:39:25 -08:00
nossr50
13a3e9a790 Adding ranks to Fisherman/Farmer's Diet and Green Thumb 2019-01-15 05:35:41 -08:00
nossr50
4137cc0d3d Fish now give XP based on their rarity 2019-01-15 04:55:44 -08:00
nossr50
8a57bbb5d9 Coral Blocks now give Mining XP 2019-01-15 04:44:55 -08:00
nossr50
f09fed465a Dolphins now give combat XP 2019-01-15 04:39:11 -08:00
nossr50
4e1f535fe2 Coral Plants & Blue Ice now give XP 2019-01-15 04:36:35 -08:00
nossr50
f15f25a3df Drowned now count for combat XP 2019-01-15 04:13:55 -08:00
nossr50
384804fefa Fixing a type in the key address 2019-01-15 03:57:00 -08:00
nossr50
5e3a72b30d XP event now uses titles for ending and fixed negative number bug 2019-01-15 03:50:12 -08:00
nossr50
f5b3cf4350 The remaining skills now hide stats until unlocked 2019-01-15 03:39:06 -08:00
nossr50
008e29117f RetroMode will default to false on new installs of mcMMO 2019-01-15 03:33:42 -08:00
nossr50
d48295bd72 Mining & Herbalism stats are hidden until unlock 2019-01-15 03:31:34 -08:00
nossr50
e9987a19ed Grammar + Spelling mistakes in skills.yml 2019-01-15 03:21:41 -08:00
nossr50
1aa4df01f9 Fishing stats are now hidden until skill is unlocked 2019-01-15 03:16:21 -08:00
nossr50
427d8c3b21 Excavation hides stats until skills are unlocked 2019-01-15 03:05:42 -08:00
nossr50
61d87eff10 Axe skill stats are hidden unless unlocked 2019-01-15 02:59:00 -08:00
nossr50
086e29c4ac Archery skills do not show stats until unlocked 2019-01-15 02:54:51 -08:00
nossr50
6cc6de6e82 Alchemy stats are now hidden until the appropriate skills are unlocked 2019-01-15 02:53:33 -08:00
nossr50
4a30fcc2de 2.1.0 is probably playable now, but not unfinished 2019-01-15 02:43:44 -08:00
nossr50
0acde4a8af Why are these empty part 2 2019-01-15 01:11:33 -08:00
nossr50
d6fea9a2df Why was this catch empty? 2019-01-15 01:08:11 -08:00
nossr50
5114bbc40d Fixing the YAML indentation 2019-01-14 22:52:15 -08:00
nossr50
4fcf0b0519 Reducing the amount of config confusion for retro mode
This is to avoid confusion, if you want this kind of customization I'll add it in but disassociate it with retro mode.
2019-01-14 22:48:37 -08:00
nossr50
da6b6841b7 Prevent commands from setting players to negative levels 2019-01-14 22:21:33 -08:00
nossr50
95d60e646d Diminishing returns now has an optional minimum gains setting 2019-01-14 22:11:58 -08:00
nossr50
9f8c9db4bc Setting SSL to false will now squelch MySQL warnings 2019-01-14 20:37:30 -08:00
nossr50
918b94b1ff Fixing Graceful Roll in the new system. 2019-01-14 18:35:37 -08:00
nossr50
d9dd4ea016 XP events now use the Title API
Configurable in advanced.yml
2019-01-14 02:32:02 -08:00
nossr50
43aad43bf3 Vampirism/Hardcore mode now use the ActionBar 2019-01-14 01:25:06 -08:00
nossr50
ed2c3975d8 ActionBar messages can now have copies sent to chat 2019-01-14 01:22:14 -08:00
nossr50
ee04bebcd9 All skills now use the ActionBar 2019-01-14 00:56:07 -08:00
nossr50
1769df98dc Archery now uses the ActionBar 2019-01-14 00:54:42 -08:00
nossr50
ca2eebf022 Axes now use the ActionBar 2019-01-14 00:52:25 -08:00
nossr50
4101f16580 Fishing now uses the ActionBar 2019-01-14 00:50:13 -08:00
nossr50
655a31d556 Herbalism now uses the ActionBar 2019-01-13 23:23:48 -08:00
nossr50
e1576e8d1c Repair now used the ActionBar 2019-01-13 23:16:24 -08:00
nossr50
2605235f2a Salvage now uses the ActionBar 2019-01-13 22:56:48 -08:00
nossr50
6bba647250 Woodcutting now uses the ActionBar 2019-01-13 22:47:27 -08:00
nossr50
79ae49a6d1 Unarmed now uses the ActionBar 2019-01-13 22:45:16 -08:00
nossr50
f007114753 Swords now use the ActionBar 2019-01-13 22:42:55 -08:00
nossr50
dad3e76c7c Taming now uses Action Bar 2019-01-13 22:32:35 -08:00
nossr50
ba5428ff12 Adding more combat messages to Action Bar 2019-01-13 22:21:16 -08:00
nossr50
1cf1c6fab8 ChimaeraWing now uses the action bar 2019-01-13 22:09:54 -08:00
nossr50
14ca84fa97 Holiday strings added to locale + some JSON integration for April Fools Day 2019-01-13 21:48:38 -08:00
nossr50
4a00758b6b Added locale strings for chatspy and moved some more party messages to action bar 2019-01-13 21:27:56 -08:00
nossr50
e817dbe081 Don't allow players to accept party invites if the party is full 2019-01-13 00:45:17 -08:00
nossr50
c3bacd8de6 Minor config change 2019-01-13 00:31:58 -08:00
nossr50
351abae475 Fixing Missing Locale Strings 2019-01-13 00:21:21 -08:00
nossr50
c1c249372a snake yaml demands 4 spaces 2019-01-13 00:10:13 -08:00
nossr50
6f77bb206d Refactoring + adding a new skillranks config (not functional yet) 2019-01-12 23:54:53 -08:00
nossr50
0beabbf1ec Added more missing strings 2019-01-12 22:45:54 -08:00
nossr50
51ab8d4b25 Child Skill commands work again (UGLY tho) 2019-01-12 22:41:06 -08:00
nossr50
a21b4585c5 Classic Scaling is now Retro Mode to avoid confusion 2019-01-12 22:14:23 -08:00
nossr50
cde11b64ed You will only gain shared party XP if you are visible to the player gaining XP 2019-01-12 21:51:31 -08:00
nossr50
d3c47935d4 Some refactoring 2019-01-12 19:56:54 -08:00
nossr50
c8ee5099e0 TextComponents will no longer use a cache
This will increase the cost of TextComponents by a negligible amount but in exchange I will be able to put player-specific data into them.
2019-01-12 19:29:06 -08:00
nossr50
85fd0a79bc Sounds volume and pitch are now configurable in the new sounds.yml file 2019-01-12 19:08:54 -08:00
nossr50
6927712a9d I'm dyslexic 2019-01-12 17:28:35 -08:00
nossr50
4cfb7a5f4b mcMMO now supports SSL and tries to use it by default for MySQL (turn this off in config.yml MySQL.Server.SSL)
this fixes a lot of console spam from default mysql installs
2019-01-12 17:26:17 -08:00
nossr50
1f2e6cd5f5 Fixed grabbing colors from the wrong file 2019-01-12 15:58:35 -08:00
nossr50
b38c589125 I guess I'm bad at git 2019-01-12 14:44:16 -08:00
nossr50
7f40b4294f mcMMO now fires many new custom events relating to scoreboards 2019-01-12 14:42:30 -08:00
nossr50
bfc26dc892 Reverting the scoreboard changes
Due to a naive understand of how scoreboards worked I made some incorrect assumptions and will be reverting this change
2019-01-12 13:26:54 -08:00
nossr50
b572c0aea9 Fixing some issues with scoreboards, it's getting late so I'll take a better look at them in the morning. 2019-01-11 10:27:11 -08:00
nossr50
1d62f8b177 Added some missing config items 2019-01-11 07:31:17 -08:00
nossr50
d141a28747 Most things that print to your chat will now print to action bar 2019-01-11 07:11:17 -08:00
nossr50
19c38f0cb1 Parties can now have max size limits (configurable), by default party sizes are unlimited. 2019-01-11 06:17:07 -08:00
nossr50
c7a49dd283 tool fix 2019-01-11 05:42:58 -08:00
nossr50
f11b98c29d Players need to have unique objectives 2019-01-11 05:26:05 -08:00
nossr50
adc83d29a7 The new URL links can now be disabled in config.yml 2019-01-11 02:24:11 -08:00
nossr50
1e8d950767 Converting from MySQL -> FlatFile now accounts for users that don't exist yet in mcmmo.users
Fixes #3130
2019-01-11 02:17:03 -08:00
nossr50
3dca32a226 mcMMO is now a lot more compatible with plugins that use scoreboards
Citizens 2 for example
2019-01-11 02:05:54 -08:00
nossr50
7c024314b7 Classic mode setting is now UseOldLevelScaling to lessen confusion 2019-01-11 01:52:16 -08:00
nossr50
f828084246 Added config option to easily disable all scoreboards 2019-01-11 01:47:36 -08:00
nossr50
626890ed95 Chimaera Wing exploit fix 2019-01-10 23:52:11 -08:00
nossr50
00a14ccb17 no more abusing the ice kids 2019-01-10 21:27:50 -08:00
nossr50
400e15b559 Party member list will only contain players visible to the player 2019-01-10 21:06:51 -08:00
nossr50
d5a4103858 new mmoinfo command and JSON click events 2019-01-10 01:17:47 -08:00
nossr50
0cb9bbb530 Overhaul Era MOTD 2019-01-09 18:25:37 -08:00
nossr50
fc2a8eec7b Updating the changelog 2019-01-08 20:37:57 -08:00
nossr50
362d036b16 4 days of work and I'm still not done ;_; 2019-01-08 19:52:52 -08:00
nossr50
ee765a0d30 Fix for mushrooms not counting as Logs for Tree Feller
Server admins will need to update their experience.yml manually (or delete it to make a new one)
2019-01-07 12:37:16 -08:00
t00thpick1
8aa919f834 should fix inspecting offline players
(cherry picked from commit ad715f51c6b8b87e3a78c18c7daaf4cdf7c10a8e)
2019-01-05 19:21:45 -05:00
t00thpick1
77c12dcc20 Tridents are tools too
(cherry picked from commit 1b74c0bd920cf32499ecdb2c285917f2e41cef44)
2019-01-05 12:13:46 -05:00
nossr50
7581425f87 reducing linecount since crowdin charges by linecount 2019-01-04 09:53:44 -08:00
Robert A. C
fce77b427f Update Crowdin configuration file 2019-01-04 09:42:12 -08:00
nossr50
01a7aa4d12 Reworked the relationship between SubSkill and Locale keys 2019-01-04 07:58:39 -08:00
nossr50
6dc75760d0 JSON hover objects now follow different templates based on the subskill's properties 2019-01-03 07:16:05 -08:00
nossr50
fe90f1e7eb Fixing a bug with Axe Mastery rank requirements 2019-01-03 04:59:56 -08:00
nossr50
54cf356b71 converting more SubSkills to be JSON friendly
AxeMaster & SkillShot
2019-01-03 04:32:46 -08:00
nossr50
4669e3e54d Starting to convert existing subskills to be JSON friendly
So far only a few have been converted
2019-01-03 03:42:11 -08:00
nossr50
f4ead570d4 Fixed some logic errors with the new mcchatspy command 2019-01-03 02:14:31 -08:00
nossr50
b34f3a1779 Fixing the message for when you toggle mcchatspy 2019-01-03 01:44:29 -08:00
nossr50
85e1f2eb7e mcchatspy is now a command based instead of permission node based 2019-01-03 01:26:08 -08:00
nossr50
6136e82ec6 mcmmo.admin.chatspy to spy on party chat 2019-01-03 00:52:24 -08:00
nossr50
ebec5d6f70 Added some JSON, much more to come. 2019-01-02 08:06:18 -08:00
nossr50
336e41b40c Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2018-12-31 10:10:31 -08:00
nossr50
bec088c969 Some work on milestones is done 2018-12-31 10:10:00 -08:00
Robert A. C
17f1062e96 Fixing formatting for website info 2018-12-30 01:12:45 -08:00
Robert A. C
92495ae9df Added website info 2018-12-30 01:12:21 -08:00
nossr50
b9c8743ee3 The next public release will be 2.1.0 not 2.0.1 2018-12-29 06:19:24 -08:00
nossr50
0d260a74c9 Refactoring to make my life easier 2018-12-29 05:24:55 -08:00
nossr50
35368db05d I forgot the imports like a dumbo 2018-12-28 11:28:26 -08:00
nossr50
5e6e8d7248 I don't think Jenkins likes @Nullable atm 2018-12-28 10:56:41 -08:00
nossr50
d50238caf1 Dunno if this is excessive, but adding some API notes to the changelog 2018-12-28 10:49:11 -08:00
nossr50
164d429acc Reverting a change regarding level caps 2018-12-28 10:12:21 -08:00
nossr50
a316bb7bd2 Not much work was done today because of testing & research
The real work begins soon
2018-12-28 06:29:08 -08:00
nossr50
55a4238030 Updating changelog.txt 2018-12-27 03:18:34 -08:00
nossr50
f9f2a0d691 Scaling skills from 0-1000 to 1-100 pt. II 2018-12-27 03:12:38 -08:00
nossr50
3831ca6b0f Burn it with fire 2018-12-27 03:04:55 -08:00
nossr50
7a6b8e3156 This was going to bug my OCD 2018-12-27 00:21:13 -08:00
nossr50
93d10c0739 Starting work on converting skills to use the new 100-scale system 2018-12-26 23:59:43 -08:00
Robert A. C
24e4c28355 Updating the readme to reflect current times. 2018-12-24 20:05:18 -08:00
nossr50
6ec61ecb76 Fireworks from ability activation will be Opt-In, updates to strings 2018-12-24 19:05:46 -08:00
nossr50
55a69006bf Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2018-12-24 17:53:03 -08:00
nossr50
8a02230fd2 Updating strings relating to the project. 2018-12-24 17:52:39 -08:00
t00thpick1
2a26b016d9 Only stop monitoring LOG To LOG transitions, there are a ton of non-air block placements we want to monitor 2018-12-24 19:33:26 -05:00
nossr50
7be5b4ecbd Monitor only blocks that replace air. This fixes the TreeFeller interaction with stripped wood. 2018-12-24 00:21:13 -08:00
t00thpick1
565fb35217 Update McmmoCommand.java 2018-12-23 16:40:57 -05:00
LogGits
d2b8c527ad Use dropItem instead of dropItemNaturally (#3644)
This could possibly eliminate a few issues.
2018-12-14 19:51:44 -05:00
LogGits
2cdb17d64f Use dropItem instead of dropItemNaturally (#3645)
Should fix #3641 and #3638
2018-12-14 19:51:38 -05:00
LogGits
96f06ca812 Fixed plugin.yml mistake (#3639)
Accidentally forgot to add the ":" to some of the permissions.
2018-12-09 22:59:16 -05:00
Fabrizio La Rosa
685f6d76a8 Corrected a word (#3629) 2018-12-09 18:29:40 -05:00
LogGits
840cfbe94d Updated plugin.yml to include command permissions (#3637)
This will stop people from seeing the commands in tabcomplete for 1.13.2 if they dont have the permission for it. Should fix #3625.
2018-12-09 18:26:09 -05:00
Josh
605535ed60 fix memory leak (#3631)
on servers with lots of spawner farms this metadata won't get GC'd unless removed, line 436 its added but never removed as far as I can tell
2018-12-06 22:05:55 -05:00
t00thpick1
71c72045b9 Revert "Update locale_zh_CN.properties (#3541)"
This reverts commit eb930883fa.
2018-12-02 23:28:36 -05:00
Ghost_chu
eb930883fa Update locale_zh_CN.properties (#3541) 2018-12-02 23:27:39 -05:00
CNAmira
30ed18eb95 Update Simplified Chinese localization (#3617) 2018-12-02 23:27:19 -05:00
Fabrizio La Rosa
8508f5b8b8 Bug fix for italian locale (#3616)
Fixed the command "/mctop Tiro con l'Arco" that with spaces was not recognized (/mctop archery is not usable if the English locale is not selected).
Now is "/mctop Arco".

That should fix also "/Tiro con l'Arco".
2018-12-02 23:26:58 -05:00
ゆき
dfab223eb2 Fix locale_ja_JP.properties colors (#3628) 2018-12-02 23:26:38 -05:00
Andrewkm
dd82fa0791 Duplicate shulker entry (#3623) 2018-11-26 23:30:08 -05:00
t00thpick1
af8d2dc2c7 Tridents are enchantable 2018-11-26 23:28:15 -05:00
t00thpick1
9f9529debf Has this ever not happened??? I don't understand why it only showed up in 1.13..... Fixes #3564 2018-11-26 23:10:51 -05:00
t00thpick1
495c4a33e5 Store skill totals rather than calculating them on the fly for faster leaderboard queries. 2018-11-14 20:31:57 -05:00
t00thpick1
203d3749ee Fix herbalism XP again 2018-10-14 21:27:55 -04:00
t00thpick1
1fcecbd3e7 Replant only the fully grown plants. 2018-10-13 17:09:08 -04:00
t00thpick1
d778616b2c Herbalism was the one that actually needed to remain blockdata. 2018-10-13 17:06:54 -04:00
t00thpick1
4bdd97a302 Not sure why this is even still here. 2018-10-09 21:57:01 -04:00
t00thpick1
ab2a031ee0 Missed file in commit 2018-10-09 21:56:47 -04:00
t00thpick1
5663b71387 Some of these should not have been blockdata, also this should check age of crops. 2018-10-09 21:52:23 -04:00
ProfLuz
2a43bce849 Fix spectators being affected by a combat ability (#3591)
* Fix spectators being affected by a combat ability
2018-10-01 22:21:22 -04:00
András Marczinkó
592c3a2142 Fix woodcutting double drop item names (#3585) 2018-09-23 14:43:38 -04:00
András Marczinkó
e9ca341476 End_Bricks renamed to End_Stone (#3584) 2018-09-23 11:52:48 -04:00
Captain Justin
76617c8a61 German spelling fix (#3576) 2018-09-23 11:52:35 -04:00
András Marczinkó
10ff097232 Fix config item names (#3583) 2018-09-22 13:45:25 -04:00
Sean Porter
1e043d481a Merge pull request #3582 from andris155/patch-7
Wood renamed to Wooden
2018-09-22 09:54:39 -07:00
Sean Porter
7f8c670dc1 Merge pull request #3581 from andris155/patch-6
QUARTZ_ORE was renamed to NETHER_QUARTZ_ORE
2018-09-22 09:54:24 -07:00
András Marczinkó
0e536a2cb3 Wood renamed to Wooden 2018-09-22 18:53:08 +02:00
András Marczinkó
090cf82a39 Fix Terracotta and stained Terracotta names (#3580) 2018-09-22 12:50:25 -04:00
András Marczinkó
6e60f39f82 QUARTZ_ORE was renamed to NETHER_QUARTZ_ORE 2018-09-22 18:49:02 +02:00
András Marczinkó
b8078e4730 Fix Mycelium name (#3579) 2018-09-22 12:21:23 -04:00
András Marczinkó
e08fe64db2 Fix End Stone name (#3578) 2018-09-22 12:21:13 -04:00
Sean Porter
2b576568a7 QUARTZ_ORE was renamed to NETHER_QUARTZ_ORE. 2018-09-16 18:47:15 -07:00
t00thpick1
e2edbaad34 Update herbalism permissions for new block names. Should fix replanting crops. 2018-09-14 22:44:21 -04:00
t00thpick1
184b98bbdc BREAKING CHANGE - Fix typo in secondary skill enum...... Fixes #2891 2018-09-14 22:36:47 -04:00
t00thpick1
7cc604dbdb Update potions.yml to reflect 1.13 potions and material names. 2018-09-14 20:50:28 -04:00
t00thpick1
44ed35825f more cleanup in the TreasureConfig. 2018-08-30 23:59:55 -04:00
t00thpick1
22833eea6c Slightly delay recipe loading because apparently spigot broke doing that on enable....... 2018-08-30 23:57:29 -04:00
t00thpick1
64dfc1e3d3 Fix hylian drops 2018-08-30 23:28:48 -04:00
nemba246
6619ca1d22 update excavation on experience.yml (#3551)
In 1.13, the name of the grass block changed from "grass" to "grass_block". This caused no experience to be given while using a shovel on grass. This change was part of something mojang called the flattening and could possibly be the cause of some other experience related issues. 
https://minecraft.gamepedia.com/1.13/Flattening
2018-08-30 22:37:01 -04:00
Devon Palma
2f2a80e1ce Various Fixes (#3537)
* Updated ItemUtils, added isBlock check to smelt functions

+ added a check in ItemUtils.isSmeltable() and ItemUtils.isSmelted() to make sure the Item type was a block to prevent an error occuring mentioned in https://github.com/mcMMO-Dev/mcMMO/issues/3536

* Fixed Green Thumb replant issue

see https://github.com/mcMMO-Dev/mcMMO/issues/3535

HerbalismManager
= fixed names of netherwart
= fixed handleBlockState, and slightly altered it
StringUtils
= fixed name of netherwart

* Fixes to herbalism skill

Herbalism
= fixed material name for grass in green terra block conversion
= fixed material name for grass in shroom thumb block conversion
EntityListener
= fixed material name for melon in food level change
experience config
= updated name for melon and sugar cane

* Minor Name Updates

experience config
= removed Stone|*
= added Stone, Granite, Adesite, Diorite
MaterialTypes
= updated material reference for wood

* Small fishing change

PlayerListener
= made it so COD, TROPICAL_FISH, and PUFFERFISH are no longer overwritten, so players can now catch these
2018-08-05 10:15:12 -04:00
Aaron Karras
fa1bbd2031 Updated SkillUtils to no longer use BlockData (#3533) 2018-08-03 18:21:13 -04:00
R4zorax
a39a77f89e Fix fishing in 1.13 (#3528)
* Fix fishing to use Material instead of BlockData (that was AIR)
2018-08-02 20:27:15 -04:00
R4zorax
7800e48f61 Make BiomeAdaptor support Bukkit 1.13 and bump java-version to 1.8 (#3526) 2018-08-01 21:23:29 -04:00
Shane Robertson
63378ae4c1 Updated herbalism (crop replaced by ageable) (#3523)
* [WIP] Replacing MaterialData with Blockdata

* Fixed most block based experience gain

* Removed debug prints

* Updated configs

* [WIP] Replacing MaterialData with Blockdata

* Fixed most block based experience gain & updated wooden_tools

* ACTAULLY removed debug prints

* [WIP] Replacing bukkit treespecies 

This feature has been unofficially deprecated, (not yet fixed/marked in bukkit)
Also updated config.yml to match changes

* Updated configs

* [WIP] Replacing MaterialData with Blockdata

* [WIP] Replacing MaterialData with Blockdata

* Fixed most block based experience gain

* Fixed most block based experience gain & updated wooden_tools

* Removed debug prints

* ACTAULLY removed debug prints

* [WIP] Replacing bukkit treespecies 

This feature has been unofficially deprecated, (not yet fixed/marked in bukkit)
Also updated config.yml to match changes

* Fixed greenterra

Replaced deprecated features
2018-07-31 21:35:45 -04:00
t00thpick1
fecf83c79c Don't break on double drops for woodcutting. 2018-07-30 20:44:10 -04:00
t00thpick1
f287b6d8a7 Update fishing experience config 2018-07-27 22:30:57 -04:00
Leomixer17
9082658357 Update locale_it.properties (#3509) 2018-07-27 18:28:44 -04:00
Shane Robertson
4bda175328 Removed misc, print statements (#3508)
* ACTAULLY removed debug prints
2018-07-26 20:47:45 -04:00
Shane Robertson
ee324c77a9 Fixed errors with block-based skill experience (#3506)
* Updated configs

* [WIP] Replacing MaterialData with Blockdata

* Fixed most block based experience gain

* Fixed most block based experience gain & updated wooden_tools

* Removed debug prints
2018-07-26 19:53:29 -04:00
Jamie Sinn
210b418e44 Get string before format. (#3507) 2018-07-26 19:52:15 -04:00
t00thpick1
b73eced36f Remove sound adapter 2018-07-25 20:29:40 -04:00
shanedrgn
6296a6adde Updated configs
Signed-off-by: t00thpick1 <t00thpick1dirko@gmail.com>
2018-07-25 20:20:31 -04:00
Leomixer17
99f6192965 Update locale_it.properties (#3502) 2018-07-25 19:53:23 -04:00
t00thpick1
bff454f397 Wood is not planks. 2018-07-24 20:50:17 -04:00
t00thpick1
8216dbe355 This is kinda important 2018-07-23 22:38:05 -04:00
t00thpick1
fbe26af2d7 Merge remote-tracking branch 'origin/master' 2018-07-23 22:14:44 -04:00
t00thpick1
0a1559511a Quick and dirty 1.13 update. I.e. it now compiles for 1.13. 2018-07-23 22:13:57 -04:00
Jamie Sinn
aee60f2c09 Mctop Cooldown message correction. Closes https://github.com/mcMMO-Dev/mcMMO/issues/3470 (#3481) 2018-07-15 10:08:52 -04:00
FabioZumbi12
9ce850f84f Re-added handlersList to event. (#3234) 2018-06-13 20:50:46 -04:00
t00thpick1
cbff8482ce Merge pull request #3427 from joblo2213/master
Add McMMOPlayerSalvageCheckEvent
2018-06-09 11:50:32 -04:00
joblo.2213
0035762a71 Add McMMOPlayerSalvageCheckEvent 2018-06-09 09:46:06 +02:00
t00thpick1
3d515aab23 Bump version 2018-05-25 22:52:10 -04:00
Glitchfinder
e77801f3c1 Ensure all entity types function in experience.yml
Fixes #3443
2018-05-16 08:07:07 -07:00
Glitchfinder
c83d011faa Don't convert raw salmon to raw fish when summoning ocelots.
Fixes #3366
2018-05-15 19:40:48 -07:00
Glitchfinder
5aa4949baa Allow experience on crops grown with bonemeal. 2018-05-15 11:31:52 -07:00
Glitchfinder
906ead53dd Merge branch 'patch-1' of github.com:ChrisLane/mcMMO 2018-05-11 10:09:37 -07:00
Glitchfinder
cbcdedc67a Merge branch 'patch-1' of github.com:MiniDigger/mcMMO 2018-05-11 10:08:26 -07:00
Glitchfinder
c87b410823 Merge branch 'anvil_unbreakables' of github.com:GiovanH/mcMMO 2018-05-11 10:07:53 -07:00
Glitchfinder
0a447f68c6 Merge branch 'patch-2' of github.com:GiovanH/mcMMO 2018-05-11 10:06:58 -07:00
Glitchfinder
e98d241452 Merge branch 'master' of github.com:ProgrammingAtDawn/mcMMO 2018-05-11 10:04:14 -07:00
GiovanH
421455224f Codebase! 2018-05-10 04:54:35 +01:00
t00thpick1
29c55312a5 Don't allow these commands on child skills. 2018-05-01 23:12:06 -04:00
Gio
6c474c8838 Added nether bricks to mining
As per https://github.com/mcMMO-Dev/mcMMO/issues/3426
2018-04-30 20:38:01 -05:00
t00thpick1
03182ea24c Merge pull request #3440 from GiovanH/patch-1
Handle playerdata without bukkit.lastKnownName info
2018-04-30 18:38:08 -04:00
Gio
2c6543da9e More descriptive text. 2018-04-30 13:30:41 -05:00
Gio
20bbdfc4ab Check playerdata for corruption
Fixed a null pointer exception that would occur if the offlinePlayer object did not have a defined string for .getName();
2018-04-30 12:54:35 -05:00
Glitchfinder
5b2ebf4aa8 Prevent shulker boxes from activating abilities.
Fixes #3438.
2018-04-29 23:09:52 -07:00
t00thpick1
2b159adefd Merge pull request #3330 from hoorigan/ench-book-fixes
Enchanted book fixes
2018-04-28 20:04:06 -04:00
Glitchfinder
be2de1d487 Fix a duping bug that uses a coordinate error. Fixes #2979 and fixes #3429. 2018-04-15 10:19:31 -07:00
t00thpick1
6876f192de Deflag blocks when they grow, Fixes #3311, #3207 2018-04-07 13:41:20 -04:00
t00thpick1
875db44afd Don't active skills on shulker blocks Fixes #3423 2018-04-07 13:33:28 -04:00
t00thpick1
2e120abe3a Merge pull request #3395 from ezeiger92/master
Fix a couple tickets
2018-02-15 23:00:30 -05:00
ezeiger92
feeb17d6f0 Scale fishing drop chance by lure rather than subtracting 1
Fixes mcMMO-Dev/mcMMO#3383
Added config option for lure enchantment modifier
Fixes lure enchantment having no effect on drops from offhand
2018-02-15 15:48:21 -08:00
ezeiger92
6d2003d577 Remove offhand fishing rod if not in main hand
Fixes mcMMO-Dev/mcMMO#3342
Fixed style error in last commit
2018-02-15 13:59:10 -08:00
ezeiger92
40b609ccd8 Respect unbreakable tag on items when attempting durability changes
Fixes mcMMO-Dev/mcMMO#3327
Fixes mcMMO-Dev/mcMMO#3391
2018-02-15 13:38:10 -08:00
ProgrammingAtDawn
d64399df49 Calculate experience gain before processing green thumb. 2018-01-24 20:53:59 +01:00
t00thpick1
d4f2f0e11b Use new recipe constructor to avoid deprecation errors. 2017-12-17 13:31:30 -05:00
hoorigan
916d9a7c8a ItemUtils: add ENCHANTED_BOOK to isEnchantable()
This will (hopefully) make mcMMO aware that ENCHATED_BOOK can have an enchantment.
2017-10-31 16:47:46 -04:00
hoorigan
6d5ab0edda FishingManager: force enchant on enchanted book
Added a small conditional to ensure that enchanted books get an enchantment.
2017-10-31 16:45:08 -04:00
t00thpick1
307d483323 Dont do diminishing returns on command caused xp gains Fixes #3312 2017-10-27 20:30:56 -04:00
t00thpick1
eb4960f307 Merge pull request #3300 from EasyMFnE/master
Add automatic Alchemy potion colorization and custom color config
2017-10-05 19:44:47 -04:00
t00thpick1
9df72e61a2 Mob Health bars global toggle 2017-10-03 23:32:54 -04:00
EasyMFnE
fcb6391ba3 Remove leftover debug code. 2017-09-28 11:44:15 -04:00
EasyMFnE
16a77f281e Add automatic Alchemy potion colorization and custom color configuration. 2017-09-23 15:35:38 -04:00
t00thpick1
87ebf7023f Additional changes that are less important but related to the dupe fix. 2017-09-12 20:01:09 -04:00
t00thpick1
028f87653a Check length of the Y dimension of the array, not the x dimension, which will only be 16 2017-09-08 23:16:41 -04:00
t00thpick1
0e51983819 Y, not Z, very very important. 2017-09-06 00:23:35 -04:00
t00thpick1
c174f2b829 Back to development 2017-09-05 20:57:25 -04:00
t00thpick1
8e9d393eb2 Bump version 2017-09-05 20:51:24 -04:00
t00thpick1
f1f02fd005 Don't fail out of saves just because a single player fails. 2017-09-01 00:45:22 -04:00
t00thpick1
f279a979e3 Also handle bottom of world 2017-09-01 00:44:37 -04:00
t00thpick1
e0bbe9cea4 Fix error with pistons retracting near top of world. Fixes #3172 2017-09-01 00:43:11 -04:00
t00thpick1
d3cc23f6a0 Fix smelting vanilla xp boost. Fixes #3270 2017-09-01 00:32:11 -04:00
t00thpick1
4c3f3ee4e2 Dont use named seeds in replanting. Fixes #3273 2017-08-31 23:47:28 -04:00
t00thpick1
2d7c5d7fd6 Merge pull request #3279 from ezeiger92/master
Pull downstream changes
2017-08-31 00:08:32 -04:00
t00thpick1
8be68aa6df Merge pull request #3252 from ezeiger92/fix-3250
Fix 3250
2017-08-31 00:02:37 -04:00
Erik
a731ad14ec Merge pull request #1 from ezeiger92/many-fixes
Pull in fixes
2017-08-15 21:44:49 -07:00
Erik
05ca96aa7f Build against 1.12.1 to NOT break getTargetBlock 2017-08-15 16:45:32 -07:00
Erik
60aa32d003 Patches!
* Update bukkit version
* Default vanilla  exp modifier for fishing is now 1
* Fixed beetroot permission for herbalism
2017-08-15 12:20:09 -07:00
Erik
0e7ee41444 Follow spacing convention 2017-08-05 11:53:38 -07:00
Erik
b5f6b1d97f Fix for 3250 - HashSet<Byte> to HashSet<Material> for getTargetBlock 2017-08-05 11:50:24 -07:00
t00thpick1
f1ac5739e4 [bugfix] Resolve issues with Herbalism exp.
Due to flaws the previous changes to the configuration system combined with some bad lines in the experience.config that I mistakenly recommended, herbalism was not granting experience in most cases, as it was marking newly planted crops and such as player placed no exp granting blocks, rather than ignoring them as it should.
block types now are evaluated in 3 steps:
1: Explicit Name  i.e. ("Crops|4", "Crops|0"), Which is the material name then data value
2: "friendly name"  i.e. ("Crops_Ripe", "Crops_Ungrown"), Which is a typically data valueless name,  some of which I make up in mcMMO, but most of which are just the Material name
3: Wildcard name  i.e. ("Crops|*") Which is any block with that block value, regardless of data value

In order to be sure herbalism grants exp for you once again, make sure your configuration for herbalism looks similar to this:
https://github.com/mcMMO-Dev/mcMMO/blob/master/src/main/resources/experience.yml#L151

In terms of which blocks are listed there.  Specifically, there should be no blocks marked "ungrown"
2017-08-01 01:33:02 -04:00
t00thpick1
8cbb57df97 Fix herbalism I think 2017-07-23 18:06:45 -04:00
t00thpick1
2c8d2998bb Merge pull request #3201 from wysohn/master
HandlerList should be present in every Events. (It's static you know)
2017-06-28 08:59:52 -04:00
t00thpick1
44684fcfd0 Fix green thumbing plants to grow. They need to be in the config to be used, but at 0 exp so we don't gain exp off them 2017-06-27 20:26:55 -04:00
t00thpick1
7081e03c23 Back to dev 2017-06-27 20:26:30 -04:00
t00thpick1
246db98519 bump version 2017-06-26 20:56:34 -04:00
Chris Lane
ee245d348f Remove duplicate "Beetroot_block" option 2017-06-23 14:34:24 +01:00
wysohn
f718741044 HandlerList should be present in every Events. (It's static you know) 2017-06-17 20:16:09 -07:00
t00thpick1
c054ff851a Fix excavation treasures 2017-06-14 21:14:09 -04:00
t00thpick1
755787f9ee Add sapling types 2017-06-10 14:30:06 -04:00
t00thpick1
24f8b2fbd5 More configuration for hylian luck 2017-06-10 14:16:31 -04:00
t00thpick1
ee02a19e9a Add more configuration to shake treasures 2017-06-10 13:59:49 -04:00
t00thpick1
cb5d38c11f Leftover debug 2017-06-10 13:49:19 -04:00
t00thpick1
15436b44da Update configurations and skill block checks to be more configurable. 2017-06-10 13:47:20 -04:00
t00thpick1
5c267663a2 Merge pull request #3160 from filoghost/patch-1
Fix permission error
2017-06-07 21:24:00 -04:00
t00thpick1
fda625b235 Merge pull request #3185 from nathanprocks/master
Add shaking from shulkers
2017-06-07 21:22:30 -04:00
t00thpick1
2cbd8789d8 Merge pull request #3175 from lucko/master
Fix for removed methods in Bukkit 1.12
2017-06-07 21:22:00 -04:00
Nathan Piercy
95167f44f1 Add shaking from shulkers 2017-06-04 16:34:48 +10:00
Luck
789b51fd05 Fix for removed methods in Bukkit 1.12 2017-05-14 16:36:31 +01:00
filoghost
0911c86422 Prevent players from resetting each other's skills
The child permission has the value set to false. From http://bukkit.gamepedia.com/Plugin_YAML: "a child node of false inherits the inverse parent permission". Having the value set to false grants the permission to reset other players' skills to everyone that doesn't have the mcmmo.skillreset permission, which by default nobody has.
2017-04-24 20:17:43 +02:00
t00thpick1
7d05c9d8e6 Add some more defaults into the config. Remove the parts that delete keys, I don't maintain config files well enough to have them remove unknown keys. 2017-04-15 00:24:39 -04:00
t00thpick1
a43ae4178a Some cleanups to mob related XP code 2017-04-15 00:04:07 -04:00
t00thpick1
c9c2c483fa Remove unneccessary code. 2017-04-14 23:34:54 -04:00
t00thpick1
133281faaa Merge pull request #3131 from TheComputerGeek2/master
Prevent disarming, bleed, and axe passives when dealing thorns damage
2017-04-14 23:26:49 -04:00
MiniDigger
ef8987917d Fix avatars in readme, link can't be in new line 2017-04-07 08:25:23 +02:00
TheComputerGeek2
d6a00eaf00 Prevent disarming, bleed, and axe passives when dealing thorns damage 2017-03-06 18:03:15 -08:00
t00thpick1
69151f0855 Forgot to actually add the funfetti 2017-02-22 00:01:39 -05:00
t00thpick1
bb27d753b1 I think this should stop my fireworks from damaging people 2017-02-22 00:00:47 -05:00
t00thpick1
37ce29a5e8 Merge pull request #3094 from SupaHam/fix-chimaera-tp-cancel
Set TeleportCommenceLocation to null after Chimaera cancellation.
2017-01-15 22:19:51 -05:00
t00thpick1
6297e1c79b Merge pull request #3104 from kanesada2/skeleton
Fix shake from WITHER-SKELETON. avoid to use depredated method: getSkeltonType().
2017-01-15 22:18:26 -05:00
kanesada2
4e2903e65c I used wrong treasure.yml... 2017-01-13 14:28:54 +09:00
kanesada2
2e7f56eeb5 fix shake for WITHER-SKELETON. avoid to use getSkeltonType() 2017-01-13 14:10:55 +09:00
Ali Moghnieh
7e46d5ca08 Set TeleportCommenceLocation to null after Chimaera cancellation.
This makes the item usable once again, as the prechecks check to make sure the location is null.
2016-12-26 21:26:38 +00:00
t00thpick1
a2bcce9ab1 I believe this resolves berserk allowing you to take drops into your equipment slots. 2016-12-17 17:32:16 -05:00
t00thpick1
2f7b1c38e1 Snapshot again 2016-12-04 21:54:11 -05:00
t00thpick1
789aaec186 I should probably compile before committing in the future. 2016-12-04 21:42:26 -05:00
t00thpick1
f3d6c1727b 1.5.07 - The "Thanks @TheBentoBox for the brewing fix" update 2016-12-04 21:40:30 -05:00
t00thpick1
c029b51c97 Doesn't look like CI handles this anymore :( 2016-12-04 21:39:15 -05:00
t00thpick1
6c5fb5f398 Fix entity kill xp 2016-12-04 20:53:51 -05:00
t00thpick1
4b20db47b2 Update spigot version 2016-12-02 00:12:16 -05:00
t00thpick1
e238ec8fc6 Merge pull request #3067 from TheBentoBox/master
Fix 1.11 brewing, remove health bar from armor stands
2016-12-01 00:54:39 -05:00
t00thpick1
9689f55e5c Merge pull request #3055 from jjm223/bugfix/fuel
Rapid fuel consumption fix
2016-12-01 00:54:32 -05:00
t00thpick1
ec0c7da494 Merge pull request #3050 from MLG-Fortress/master
Don't handle item pickups when Items_As_Unarmed is set to true
2016-12-01 00:54:23 -05:00
Jake Ben-Tovim
5f9f3e8167 Fix 1.11 brewing, remove health bar from armor stands
This fixes brewing on the newest Spigot API builds. The Alchemy skill was completely broken due to a change in the Spigot BrewEvent constructor, which this fixes via the changes to FakeBrewEvent.java and AlchemyPotionBrewer.java. This also adds a check in EntityListener.java for armor stands, so that health bars aren't displayed for them. The health bars never really displayed properly (armor stand health acts differently from most entities), and it allowed players to punch invisible armor stands server admins may have been intentionally hiding to temporarily reveal them via a health bar, which is an issue.
2016-11-28 21:28:05 -05:00
Jacob Martin
6388246418 Fix an issue where brewing stands will consume two fuel units for vanilla ingredients. 2016-11-13 10:26:29 -06:00
RoboMWM
86432eb426 Don't handle item pickups when Items_As_Unarmed is set to true
If `unarmed.Items_As_Unarmed` is set to true in config, then there's no
need to be manually handling item pickups.
2016-10-23 22:38:31 -07:00
t00thpick1
a51585f5d0 Merge pull request #3007 from FabioZumbi12/master
Fix pt-br strings
2016-08-20 22:00:05 -04:00
t00thpick1
9ec75fb470 Back to dev 2016-08-20 21:54:09 -04:00
t00thpick1
c8a7f6d76f Version Bump 2016-08-20 21:50:43 -04:00
t00thpick1
01a8a199d2 Fix a dupe bug that resulted from yet another change to piston code a couple mc patches ago. Oh well. 2016-08-20 21:47:29 -04:00
t00thpick1
f85c54596a Merge pull request #3011 from SidShakal/patch-chunkRefreshRadiusFix
Correcting loop conditions related to "ghost block" mitigation.
2016-08-07 20:55:09 -04:00
Sid Shakal
b3e1acc563 Correcting conditions related to "ghost block" mitigation.
If radius is 1 (as it is when called elsewhere in the class), the loop
conditions fail to refresh some of the neighboring chunks, allowing for
ghost blocks to continue to occur on eastern and southern edges of the
chunk the player is in.

This commit fixes the loop conditions.

= Chunk diagram of old behavior =
-----
-RR--
-RP--
-----
-----

= Chunk diagram of new behavior =
-----
-RRR-
-RPR-
-RRR-
-----

= Legend =
P: the chunk the player is in
R and P: chunks that are refreshed
-: chunks that do not get refreshed
2016-08-07 17:32:34 -05:00
FabioZumbi12
745ff21551 Merge pull request #2 from FabioZumbi12/FabioZumbi12-patch-1
Fix translated strings
2016-08-05 09:59:52 -03:00
FabioZumbi12
31c8cf9766 Fix translated strings
Fix translated strings
2016-08-05 09:59:39 -03:00
t00thpick1
8901db4e18 Add Beetroot to herbalism skill
Merge pull request #2918 from isokissa3/master

His was better.

(cherry picked from commit 3ed0fdf330)
2016-06-26 17:14:19 -04:00
t00thpick1
b1b8c4d713 Back to dev 2016-06-25 13:05:47 -04:00
t00thpick1
b14b37c22d Version bump 2016-06-25 13:00:47 -04:00
t00thpick1
e73e628051 Merge pull request #2951 from minoneer/brewing-fuel
Fix brewing stands consuming all remaining fuel items
2016-06-25 12:53:20 -04:00
t00thpick1
3bb920f22c This is completely untested but it probably works. Maybe Fixes #2966 2016-06-23 21:22:40 -04:00
t00thpick1
2bed26f18a Fix scoreboard numbering being off 2016-06-19 17:47:38 -04:00
t00thpick1
fb3363661b Remove invalid enchantment from default config 2016-06-19 17:42:40 -04:00
t00thpick1
315b713005 These should definently not be hard coded in the future... but allow rabbits and guardians to be shaken down 2016-06-19 17:41:18 -04:00
t00thpick1
70de0ba00b Enable Beetroot I think 2016-06-19 17:33:43 -04:00
minoneer
25cad3afc6 Fix brewing stands consuming all remaining fuel items when the fuel bar is refilled 2016-06-09 02:10:27 +02:00
t00thpick1
11aa126b80 Merge pull request #2918 from isokissa3/master
Exploit fix, turning spawned pigs into zombie pigmans using lightning stike allows you gain XP
2016-04-28 10:31:24 -04:00
isokissa3
d0e8bb3174 Fixed spacing 2016-04-27 13:45:26 +03:00
isokissa3
6b03108052 Fixed formatting 2016-04-26 15:26:50 +03:00
isokissa3
34447ef874 Exploit fix, turning spawned pigs into zombie pigmans using lightning stike allows you gain XP 2016-04-25 18:47:15 +03:00
t00thpick1
dcd79e87e1 This command probably works 2016-04-23 00:32:04 -04:00
t00thpick1
8822b4edae Fix typo 2016-04-03 00:25:50 -04:00
t00thpick1
a24d6ff018 Missed removals 2016-03-27 11:46:00 -05:00
t00thpick1
707195f237 I honestly forgot this was in here. Fixes #2863 2016-03-27 11:12:16 -05:00
t00thpick1
321fcd7b84 Merge pull request #2850 from DylanCare/master
Fixes Alchemy for Stage 1 Potions and Lingering
2016-03-23 21:21:51 -05:00
Dylan
c5970e9246 Ensure NETHER_WARTS are renamed to NETHER_STALK 2016-03-21 14:42:57 -04:00
Dylan
538a0c5d6c Fixes Stage 1 Potions
The 'NETHER_WARTS' material enum should be 'NETHER_STALK' to represent the actual item.
Adds Dragon's Breath as Tier 1 Ingredient so lingering potions are actually validated as an mcMMO brew.
Adds second type of Potion of Water to support water potions that are spawned in via commands or other plugins.
2016-03-21 14:38:58 -04:00
t00thpick1
4c4df60b81 Was in a second location as well. 2016-03-20 17:52:21 -05:00
t00thpick1
d1cf08c6ba Null check. Fixes #2840 #2842 2016-03-20 12:47:27 -05:00
t00thpick1
e091a8eb55 Fix material validation errors. 2016-03-20 12:42:16 -05:00
t00thpick1
d579c9a2af Merge pull request #2829 from DorCoMaNdO/master
Stop duplicate messages from abilities.
2016-03-17 19:38:55 -05:00
Dor
a711d3a3e3 Stop duplicate messages from abilities. 2016-03-18 02:18:40 +02:00
Dor
2c197af9fd Merge remote-tracking branch 'refs/remotes/mcMMO-Dev/master' 2016-03-18 02:17:03 +02:00
t00thpick1
d58d621f96 Bump java compat version (reverted from commit 0203252b63) 2016-03-17 16:57:27 -05:00
t00thpick1
0203252b63 Bump java compat version 2016-03-17 16:52:41 -05:00
t00thpick1
22edd121d3 Back to dev 2016-03-17 12:36:32 -05:00
t00thpick1
31b83becad Version bump 1.5.04 2016-03-17 12:36:08 -05:00
t00thpick1
6cce3098db Update PotionConfigGenerator and default potions.yml for missing potions 2016-03-17 12:31:20 -05:00
t00thpick1
fd3d60d112 Merge pull request #2828 from SidShakal/master
Moved center of block drops to block center. Fixes #2544.
2016-03-17 11:16:24 -05:00
t00thpick1
9094e5feb8 French Translation update provided by @HollishKid Resolves #2819 2016-03-17 12:12:22 -05:00
Sid Shakal
60bfabb097 Moved salvaged material spawn center to center of top face of anvil.
My fix for the central spawn points of various block-based item drops
moved them from the low corner of the block to the center of the block.
In the case of the salvaged materials, this moved the central spawn
point from the low corner of the top face of the anvil block to the
center of the block above the anvil block. This felt unnatural, so the
point has been moved to the center of the top face of the anvil block.
2016-03-17 02:06:19 -05:00
Sid Shakal
2d4cf76825 ... (completing the previous style fix)
Not sure how I missed this one. (Well, sure I do. I used the GitHub
editor for the re-casing of the variable name. Noob mistake.)
2016-03-16 20:38:24 -05:00
t00thpick1
6a7279ea05 Merge pull request #2824 from DorCoMaNdO/master
Custom potion brewing now consume fuel from the brewing stand.
2016-03-16 18:07:45 -05:00
Sid
4cb4a6224b Added javadoc for Misc.getBlockCenter(BlockState)
And camel-cased the parameter name to conform to style.
2016-03-16 15:47:24 -05:00
Sid Shakal
a6e445b7ef Minor formatting adjustments to keep my commit to code style.
Whoops. Eclipse removed a line in imports, and I placed a brace on the
wrong line. Fixed.
2016-03-16 12:01:52 -05:00
Sid Shakal
123a139e43 Moving the center of block drops to block center. Fixes #2544. 2016-03-16 11:47:40 -05:00
Dor
4054315c19 Custom potion brewing now consume fuel from the brewing stand.
Fixed a glitch that let players remove the ingredient of a custom potion
from the brewing stand without cancelling the brewing task (this doesn't
seem to have caused any duplicates, once the task finished nothing
happened).
2016-03-16 15:16:48 +02:00
Dor
d942cedb8e Merge remote-tracking branch 'refs/remotes/mcMMO-Dev/master' 2016-03-16 15:11:51 +02:00
t00thpick1
ec774b590b Fix potions. Fixes #2813, #2814 2016-03-16 00:39:36 -05:00
Dor
988a11a5da Merge remote-tracking branch 'refs/remotes/mcMMO-Dev/master' 2016-03-13 01:11:51 +02:00
t00thpick1
1488946fc5 Merge pull request #2694 from Maximvdw/patch-1
Fixed NPE when skill is not in config
2016-03-12 17:56:40 -05:00
t00thpick1
1f05967b0b Merge pull request #2725 from EvilOlaf/patch-3
Fix space and color code
2016-03-12 17:56:11 -05:00
t00thpick1
4924391ae8 Merge pull request #2726 from JamieSinn/master
If sender is console, strip colours for mctop
2016-03-12 17:55:59 -05:00
t00thpick1
f2668d7dbb Merge pull request #2735 from EvilOlaf/patch-2
fixed typo
2016-03-12 17:55:46 -05:00
t00thpick1
d26779bee9 Merge pull request #2810 from DorCoMaNdO/master
Fix Shroom Thumb not removing the item held.
2016-03-12 17:55:35 -05:00
t00thpick1
c75715b186 We need to name the custom potions. 2016-03-12 17:52:19 -05:00
t00thpick1
a238b7029d Update default potions.yml and add tool to do so in the future. 2016-03-12 17:45:14 -05:00
Dor
98511136ee Fix Shroom Thumb not removing the item held. 2016-03-12 20:35:19 +02:00
t00thpick1
6723b3a4c6 Merge pull request #2803 from DorCoMaNdO/master
Treat grass path as grass...
2016-03-12 12:17:04 -05:00
Dor
40c61149cf Treat grass paths as grass. 2016-03-12 08:12:27 +02:00
Dor
4f9a463b9d Merge remote-tracking branch 'refs/remotes/mcMMO-Dev/master' 2016-03-12 08:03:30 +02:00
t00thpick1
f3a8208425 Add new enchants and fallback to bukkit enchant name map 2016-03-11 22:55:01 -05:00
t00thpick1
cbf2f34f93 Update Treasures for potions 2016-03-11 22:42:55 -05:00
t00thpick1
898fad6be4 Merge pull request #2801 from DorCoMaNdO/master
Chorus plant experience reward is now 1 instead of 2.
2016-03-11 22:38:46 -05:00
Dor
eaa1a8edca Chorus plant experience reward is now 1 instead of 2.
Sneaking is required if the player has an item in the off hand and
they're not in a vehicle.
2016-03-12 05:31:11 +02:00
Dor
08db154791 Merge pull request #3 from mcMMO-Dev/master
Merge master
2016-03-12 05:29:35 +02:00
t00thpick1
e1cf4c0c67 Merge pull request #2800 from DorCoMaNdO/master
Fix config auto update.
2016-03-11 22:21:59 -05:00
Dor
529c43b0e6 Fix config auto update. 2016-03-12 05:10:41 +02:00
t00thpick1
376abdf49e Merge pull request #2799 from DorCoMaNdO/patch-3
Use getItemInMainHand()
2016-03-11 22:09:08 -05:00
t00thpick1
11a744a772 Properly calculate potionstage 2016-03-11 22:07:27 -05:00
Dor
47f73ba455 Merge pull request #2 from mcMMO-Dev/master
Merge master
2016-03-12 05:05:37 +02:00
t00thpick1
001b11efc6 Better Auto-Update config loader, still cannot handle multiple options with the exact same name and spacing, but will not break configs anymore in those situations, just mis-comment. 2016-03-11 21:54:57 -05:00
t00thpick1
089f3a0e71 Does this fix the CI? (reverted from commit af9a3c85c6) 2016-03-11 21:30:11 -05:00
t00thpick1
af9a3c85c6 Does this fix the CI? 2016-03-11 21:28:46 -05:00
t00thpick1
a534f9aac1 Update default Potions.yml to have some of the new format, someone should PR a full update. 2016-03-11 21:15:22 -05:00
t00thpick1
a08016647a Update to new Potions API, still supports old config options 2016-03-11 21:08:10 -05:00
Dor
a557fc7d3c Use getItemInMainHand()
Add 1.9 blocks to be detected for experience rewards.
Add experience rewards for the Chorus plant.
Add experience rewards for the Shulker mob.
2016-03-11 16:20:23 +02:00
Dor
2d3d11ec2d Merge pull request #1 from mcMMO-Dev/master
Merge master
2016-03-11 06:01:08 +02:00
t00thpick1
9bc97c6dd3 I think this fixes the auto update config function when a config file has two similar keys. (reverted from commit 52f1e33052) 2016-03-08 08:09:48 -05:00
t00thpick1
52f1e33052 I think this fixes the auto update config function when a config file has two similar keys. 2016-03-07 18:41:49 -05:00
t00thpick1
272e99d41f Master volume config option 2016-03-06 16:48:56 -05:00
t00thpick1
77b67d5a79 Merge pull request #2781 from Tslat/patch-1
Fix infinite GreenThumb & ShroomThumb usage bug

-Not sure if this is the correct way to fix this, but it is A way, and that will due in the meantime.
2016-03-05 23:57:25 -05:00
t00thpick1
8e1f464209 Merge pull request #2783 from Tslat/patch-2
Update ability blacklist to include 1.8 fence[gate] types
2016-03-05 23:56:08 -05:00
Tslat
5f960fd80a Update ability blacklist to include 1.8 fence[gate] types 2016-03-06 14:36:21 +10:00
Tslat
bddca30668 Fix infinite GreenThumb & ShroomThumb usage bug 2016-03-05 20:39:16 +10:00
t00thpick1
28a2b9668d I think preserve potions backwards compatability and also update documentation. 2016-03-01 17:16:59 -05:00
t00thpick1
f52d9feef8 Update Alchemy for 1.9 Configuration style has changed, but theoretically old version should still work I think. 2016-03-01 17:05:58 -05:00
t00thpick1
f77ae6ee15 Biome needs to be in the enum compatability as well. 2016-03-01 13:25:51 -05:00
t00thpick1
88b99a3835 I *think* this should be backwards compatible, I may be wrong and it could break both. 2016-03-01 13:08:11 -05:00
t00thpick1
8d16af8770 Why is my local compiler missing thigns the CI hits? 2016-03-01 12:42:26 -05:00
t00thpick1
fde9ba86a2 Actually update all sounds 2016-03-01 12:39:05 -05:00
t00thpick1
c9356f9ef5 Update for 1.9 Sound enum changes. Now only compatible with 1.9+ 2016-03-01 12:21:00 -05:00
t00thpick1
6a0529f02d Fully remove metrics. 2016-01-28 15:20:36 -05:00
t00thpick1
760178c061 Give custom perk boost the highest priority. 2016-01-28 13:37:21 -05:00
t00thpick1
0bb2642d24 Remove metrics 2016-01-11 14:12:54 -05:00
Very Evil Olaf
635a4f7265 fixed typo
smelt = Schmelzung, not Schmelung
2015-12-28 20:18:55 +01:00
Jamie Sinn
0e34202d4d Curly braces as toothpick requested
@andrewkm
2015-12-20 23:05:48 -05:00
JamieSinn
3a9c55a9ea Remove ternary operators and use if/else 2015-12-12 00:04:23 -05:00
JamieSinn
2dd1775d9a Remove regex replace, does nothing 2015-12-11 23:52:14 -05:00
JamieSinn
a0635eeb08 Remove escape character at EOL 2015-12-11 23:45:17 -05:00
JamieSinn
9677653c54 If sender is console, strip colours for mctop
Ugly ugly colours.
2015-12-11 23:30:21 -05:00
Very Evil Olaf
6cf7167c09 Fix space and color code 2015-12-10 21:37:42 +01:00
t00thpick1
9718123292 Catchup the changelog 2015-11-12 19:19:57 -05:00
t00thpick1
420559efec Append to existing lore when crafting Flux Pickaxes. Fixes #2557 2015-11-12 19:13:27 -05:00
t00thpick1
f4b6d7845e Add config option to auto-truncate player skill levels that exceed the configured max level. Adds #2512
Also removes a good bit of magic numbering from FlatFileDatabaseManager
2015-11-12 19:10:30 -05:00
t00thpick1
b966529487 Merge pull request #2709 from JamieSinn/master
Strip colours from party chat when logging to console.
2015-11-12 17:43:34 -05:00
JamieSinn
9c7b83a52e Strip colours from party chat when logging to console. 2015-11-12 16:06:43 -05:00
t00thpick1
ac9447d439 This is actually not correct. 2015-11-04 16:31:30 -05:00
t00thpick1
a5bcc3ce58 Correctly identify tree species. Fixes #2667 2015-11-04 16:06:28 -05:00
t00thpick1
a020890244 Remove hardcoded nerf to treefeller. Fixes #2666 2015-11-04 15:53:38 -05:00
t00thpick1
616200f20f Fix compile 2015-11-04 15:48:42 -05:00
t00thpick1
1f9c3759e7 Merge pull request #2441 from wolfdate25/patch-2
Update locale_ko.properties.  Hope this is right, I cannot read it personally.
2015-11-04 15:46:55 -05:00
t00thpick1
9fb72cfea8 Merge pull request #2648 from EvilOlaf/patch-2
Update locale_de.properties
2015-11-04 15:46:13 -05:00
t00thpick1
dd84abe927 Merge pull request #2647 from EvilOlaf/patch-1
Missing bracket
2015-11-04 15:45:11 -05:00
t00thpick1
aaa69adb0c Merge pull request #2663 from MinelinkNetwork/fix-child-skill-level
Remove hardcoded limit for parent skill levels when calculating child…
2015-11-04 15:45:00 -05:00
t00thpick1
982ee13631 Merge pull request #2697 from SilverCory/master
Monitor falling blocks.
2015-11-04 15:44:45 -05:00
t00thpick1
8927e16b1f Fix skillreset argument validation. Fixes #2651 2015-11-04 15:43:07 -05:00
t00thpick1
dd01504111 Treat nether portal spawned mobs as spawner mobs. Fixes #2662 2015-11-04 15:37:17 -05:00
t00thpick1
50e727d591 Fix salvaging to return more than 1 item. Fixes #2627 2015-11-04 15:35:22 -05:00
t00thpick1
f84e98d836 Simulate block break for flux mining. Fixes #2668 2015-11-04 15:27:03 -05:00
t00thpick1
7e92905618 Comments so I don't forget why I did it like this again 2015-11-04 13:48:29 -05:00
t00thpick1
9b24dd306c Actually use Hylian Treasure config values. Fixes #2688 2015-11-04 13:35:25 -05:00
t00thpick1
aa796266a7 Don't remember what this is for, but it was in my repo so its probably important 2015-11-04 13:26:47 -05:00
Cory Redmond
a783d0dfc8 Monitor falling blocks. 2015-10-04 21:39:22 +01:00
Maxim Van de Wynckel
f9879be439 Fixed NPE when skill is not in config
When a skill is not configured this would throw an NPE as the section is not found.

Found while trying to get information from an McMMOLevelUp event
2015-09-27 00:50:26 +02:00
Byteflux
5f21efb1cd Remove hardcoded limit for parent skill levels when calculating child skill level 2015-08-16 00:35:22 -07:00
Very Evil Olaf
8e2b8f111f Update locale_de.properties
Add missing space
`Fixen` can not be used in this context. `Reparatur` is slightly better.
2015-08-03 16:53:48 +02:00
Very Evil Olaf
08766a0ff7 Missing bracket 2015-08-03 15:17:52 +02:00
t00thpick1
5b19e2e9d2 Snapshot again for realz 2015-07-28 17:49:36 -04:00
t00thpick1
bef28583f3 Fix missed compile error. Re-release 1.5.03 2015-07-28 17:48:24 -04:00
t00thpick1
eff53d90ab We need to preserve block data with our double drops for silk touch. Fixes #2625 2015-07-25 22:30:22 -04:00
t00thpick1
2aade8b7ff Remove no longer needed DualSupport classes, we crossed that road long ago. 2015-07-25 22:29:19 -04:00
t00thpick1
de0ac51b3d This should ignore absorption damage for allied players. Fixes #2618 2015-07-25 21:59:10 -04:00
t00thpick1
b161a907a7 back to development 2015-07-25 16:53:38 -04:00
t00thpick1
397ec929aa Bump version for release 2015-07-25 16:52:26 -04:00
t00thpick1
f108de9ba2 Incorrect config key. 2015-07-25 16:32:44 -04:00
t00thpick1
e3a139f7bd Update website link 2015-07-18 11:51:53 -04:00
t00thpick1
90f8132030 Merge pull request #2540 from xion87/patch-2
Update locale_it.properties
2015-07-18 11:25:45 -04:00
t00thpick1
60d89c15e6 Merge pull request #2551 from lol768/patch-1
Escape apostrophes in localised strings
2015-07-18 11:24:59 -04:00
t00thpick1
58a0287be7 Merge pull request #2583 from lumis31/patch-1
Update locale_de.properties
2015-07-18 11:24:19 -04:00
t00thpick1
ac3b28da8b Merge pull request #2614 from ThundrRok/master
Fix for custom potions being missed in potion stage calculation. #2386
2015-07-18 11:22:48 -04:00
t00thpick1
12cb1e4161 Offload slightly more calculations to the async loading thread. kinda Fixes #2591 2015-07-18 11:18:42 -04:00
t00thpick1
4e013b44d8 Support offline player experience editing 2015-07-18 10:50:38 -04:00
t00thpick1
9934ab972e Clean up SQLDatabaseManager 2015-07-18 10:48:40 -04:00
t00thpick1
30adac5e63 Properly restore state when errors occur during uuid update 2015-07-18 10:41:55 -04:00
Stephen Jenkins
d3d7c254f4 Fix for custom potions being missed in potion stage calculation. #2386 2015-07-10 18:04:53 -04:00
t00thpick1
93ad040936 Syntax is important 2015-06-20 15:11:18 -04:00
t00thpick1
bfeac43f12 NULL uuids in flatfile should not be wiped as duplicates. Fixes #2594 2015-06-20 13:04:03 -04:00
t00thpick1
4388430491 When an older user no longer has a username that a new user now has, we will update the old entry to be _INVALID_OLD_USERNAME_, however we no longer strictly enforce name uniqueness, so people altering their DB's need to tweek with caution. Invalid old users will not display in the leaderboards. Fixes #2503 2015-06-20 12:57:01 -04:00
t00thpick1
b4e21a7817 Due to the unstable and volatile nature of pistons in the current versions of mc, we cannot reliably guarentee that we can track the position of blocks being moved by pistons, and therefore will no longer track piston moved blocks in the blockstore with 100% accuracy, and will instead just not refresh the potentially empty new blocks. This will not have any effect on regular usage of the plugin aside from 100% preventing any mcMMO related piston dupe bugs. Fixes #2565, #2582 2015-06-11 21:31:20 -04:00
t00thpick1
4fe41fe416 Check Item Type, not Material Type a second time. Fixes #2584 2015-06-11 21:15:40 -04:00
t00thpick1
d8184fb298 Properly calculate diff times for old user purge. Fixes #2541 2015-06-11 18:12:22 -04:00
lumis31
78dec51ad4 Update locale_de.properties
Major updates to the locale_de including:

Most important: added translations to ALL ABILITIES DESCRIPTIONS in german

Additionally:
-Adding a translation for the Alchemy skill
-Addition of translations for fishing
-removed salvage form repair
-added horses and holy hound to taming
->full translation to german except parties
For more changes please see the changelog at the beginnig of the file. No changes have been made to the existing translations except if the information was out of date due to the recent update to Minecraft 1.8. All translations are socially acceptable (usable for children).
2015-06-09 00:10:53 +02:00
lol768
de38826897 Escape apostrophes
"The java.text.MessageFormat class uses the apostrophe (\u0027) as an escape character. Consequently, you need to write two consecutive apostrophes in your translation if you wish to display a single apostrophe"
2015-04-25 22:59:33 +01:00
xion87
f63e793006 Update locale_it.properties
Fixed italian locale for use bow skill command
2015-04-21 09:46:51 +02:00
TfT_02
ecfdd75e36 This should be SNAPSHOT 2015-04-05 20:27:39 +02:00
TfT_02
90b31a29f5 We can simplify this!
Didn’t realize there was a event.getBlocks() method for
BlockPistonRetractEvent as well.
2015-03-22 14:49:51 +01:00
TfT_02
cfa0daefc5 Fix the issues with sticky pistons and slime blocks
This is a fix for issues #2419 and #2494
2015-03-21 19:24:06 +01:00
t00thpick1
4aeda6e9e8 Still not fully on track with the original event, but as we want them to see the potions we create, we can't be fully correct. However, correcting the behavior to decrement the ingredient after the event shouldn't harm anything. Fixes #2486 2015-03-18 16:23:07 -04:00
t00thpick1
4f1f10333f Use notification settings for critical hits Fixes #2498 2015-03-18 16:09:15 -04:00
t00thpick1
342c37a02c Merge pull request #2426 from zreed/master
Empty constructors don't take arguments  Sure why not.
2015-03-18 15:31:44 -04:00
t00thpick1
e347bc1c9e Short data, Fixed #1909 2015-03-18 15:28:57 -04:00
t00thpick1
42116f4467 Include license in builds 2015-03-18 03:56:46 -04:00
t00thpick1
7ce72bafb0 Merge pull request #2489 from isokissa3/master
Fixed duplication Bug #2489 
Tentatively pulling this as I assume its valid.
2015-03-18 03:51:35 -04:00
isokissa3
f76771f0a8 Fixed duplication bug #2419 (Correct fix) 2015-03-11 14:31:56 +02:00
isokissa3
6c29da94f3 Fixed duplication Bug #2419 2015-03-11 11:36:51 +02:00
t00thpick1
981523789e Add Debug and change a line 2015-03-09 14:20:52 -04:00
t00thpick1
d9aacfa059 Back to dev 2015-03-02 15:15:08 -05:00
t00thpick1
5efc5289f7 Version bump release 2015-03-02 15:14:16 -05:00
t00thpick1
1f68f4e654 More debug for rare cases where things don't work. 2015-02-23 20:37:03 -05:00
TfT_02
5670e6696a Archery distance XP bonus cannot exceed indefinitely anymore
Fixes #2465
2015-02-21 09:42:22 +01:00
t00thpick1
ca6dc5195d Properly convert SQL to Flatfile when UUIDs are null 2015-02-16 23:12:50 -05:00
t00thpick1
30ebe318e0 Since apparently we magically can no longer compile without these. 2015-02-16 22:13:32 -05:00
t00thpick1
a1c3f0d651 WHERE'S HARVEY DENT 2015-02-16 21:43:51 -05:00
t00thpick1
347e03d75e When did this break? It was working before. 2015-02-16 12:09:00 -05:00
t00thpick1
8543382bde We want answers for the issues. 2015-02-15 22:03:58 -05:00
t00thpick1
4f1004472c Possibly fix berserk bug 2015-02-15 22:03:58 -05:00
t00thpick1
7aee829b94 Merge pull request #2456 from ulumulu1510/patch-1
Resolve duplication Bug #2419
2015-02-15 12:34:08 -05:00
Benjamin
98701104d8 Resolve duplication Bug #2419
https://github.com/mcMMO-Dev/mcMMO/issues/2419
2015-02-11 20:17:08 +01:00
t00thpick1
7a14e61762 Fix flatfile UUID conversion I think. Fixes #2225, #2411 2015-01-31 14:38:49 -05:00
wolfwork
f42f5c31ed Update locale_ko.properties 2015-01-31 15:10:15 +09:00
t00thpick1
342662c944 Round 3: DeathMatch 2015-01-25 23:28:30 -05:00
t00thpick1
50088fe0bd Round 2 2015-01-25 23:04:02 -05:00
t00thpick1
687f87a748 No more opening inventories with ability tools. Fixes #2416 2015-01-25 22:55:18 -05:00
zreed
6815c66a0e Empty constructors don't take arguments 2015-01-22 07:14:14 -05:00
TfT_02
385fe1bb05 Added option for XP gained by killing bred animals
Fixes #2402
2015-01-10 12:31:13 +01:00
t00thpick1
eddadcc179 Properly allow searches by name without UUID 2015-01-01 23:56:30 -05:00
mjkaufer
9426f44cdd Added isUnarmed Method
Checks if the player is not holding a tool, as opposed to checking if
the player is holding air. This means that attacking with something such
as a dirt block would count as unarmed.
2014-12-29 16:31:18 +01:00
TfT_02
af7ff3df58 Make Archery distance multiplier configurable
Add #2385
2014-12-24 11:00:43 +01:00
TfT_02
7c0cc8794f Whoops, should've incremented these 2014-12-23 18:49:26 +01:00
TfT_02
eda18bc990 Only show the scoreboard tips a couple of times
We can assume a player knows how scoreboards work after showing them
the tips a few times across multiple login sessions

Adds #1833
2014-12-23 14:08:29 +01:00
TfT_02
a2c395db36 Fixed bug where MobHealthbarTypes were not saved 2014-12-23 14:07:10 +01:00
TfT_02
522b085499 Fix bug where no XP was granted when Flux Mining
Fixes #2359
2014-12-22 17:25:55 +01:00
TfT_02
3ea845cfd9 Changed Flux Mining mechanics
Previously, Flux Mining would get unlocked at a specified level with a
specified chance. Once unlocked, the player would have no control over
this ability and some players complained they would like to be able to
turn it on and off.

By adding a new furnace recipe, to craft a special pickaxe - a Flux
Pickaxe - this issue is solved. If a player doesn’t want to use Flux
Mining, they simply shouldn’t mine using a Flux Pickaxe.

Crafting a Flux Pickaxe is simple, just place one of the vanilla
pickaxes in a furnace and cook it up.

Every time the ability is successful, extra durability damage is dealt
to the tool. Just like with other abilities.

Adds #2320
2014-12-22 16:58:22 +01:00
TfT_02
93013b2db1 Fix an NPE when loading potion configs 2014-12-21 17:50:31 +01:00
TfT_02
d5a2dea06b Add option to shake items from player inventories 2014-12-20 23:55:49 +01:00
TfT_02
d188224c06 Make it possible to shake heads from players 2014-12-20 23:55:49 +01:00
TfT_02
3422c5d3eb Don't need this here 2014-12-20 19:14:52 +01:00
TfT_02
ebeebbde72 Randomize spawn location of Call of the Wild pets
So that when you’re spawning multiple pets at once, they don’t all
spawn at the same spot.
2014-12-20 19:14:52 +01:00
t00thpick1
e71eff852c Add ChatColor support for lore and custom item names. Add lore and custom item name support for potions and dyes. 2014-12-20 02:16:23 -05:00
t00thpick1
bfff5682b5 As a semi-temporary measure, lets move 1.8 specific objects into their own classes, so we can be 1.7 and 1.8 compatable. 2014-12-19 13:48:06 -05:00
t00thpick1
429a7d926a 1.8 changed the inheritance structure of Squids, this update resolves issues that cropped up from this change. 2014-12-18 18:15:02 -05:00
TfT_02
262e711bcc Add option for Chimaera Wings to ignore bed spawns
Adds #2365
2014-12-18 23:04:38 +01:00
t00thpick1
b44b1cc859 And back to development 2014-12-18 14:15:59 -05:00
t00thpick1
75dfec1236 Bump version for release build. 2014-12-18 14:14:58 -05:00
t00thpick1
8c2f3cff8f Silly me, prismarine isn't an ore. 2014-12-18 14:11:54 -05:00
t00thpick1
32336b712b Quick initial update for 1.8
Adds default configuration for new blocks and entities.
Updates a few hardcoded utilities to account for new blocks and entities.
2014-12-18 01:36:02 -05:00
t00thpick1
cfc51e9b96 use players for events 2014-12-17 22:34:42 -05:00
399 changed files with 28850 additions and 15548 deletions

12
.gitignore vendored
View File

@@ -2,6 +2,18 @@
/.classpath
/.project
/.settings
/dependency-reduced-pom.xml
#vs code
/.vscode
# Maven Depends
/lib
# gradle
/.gradle
/mcMMO-core/.gradle
/mcMMO-core/gradle
# netbeans
/nbproject

View File

@@ -7,7 +7,596 @@ Key:
! Change
- Removal
Version 1.5.01-dev
Version 2.1.47
Fix NPE when party leader is offline and players grab a party list
Version 2.1.46
Party member lists now show the whole party, including offline players again.
Party lists now have special markers for players who are in shared XP range
Party lists now have special markers for players who are offline
Party lists now have special markers for the party leader
Fixed an error where bleed was setting health outside minimum values
[See NOTE] Fixed a bug where Creepers and Zombies were not dropping the correct heads from Shake (thanks Zed-I)
[See NOTE] Fixed a bug where salvage was not returning the correct amount of materials for AXE items (thanks Zed-I)
[See NOTE] Added missing STRIPPED_WOOD entries to experience.yml for Woodcutting
[See NOTE] Added about 15-20 missing entries to experience.yml for coral to Herbalism
Fixed a bug where admin chat from console would fail to send (thanks OverCrave)
Reduced default XP values for DEAD_* coral plants from 30 -> 10
Updated hu_HU locale (thanks andris155)
NOTE: These bugfixes were related to default config values, to receive these changes you can either delete experience.yml, treasures.yml and salvage.vanilla.yml to generate new ones or make the necessary edits.
This is what the files should look like after being edited.
Experience Correct Default Config - https://paste.gg/p/anonymous/ff695df1417e4232957a3d176fd14ed4
Salvage Correct Default Config - https://paste.gg/p/anonymous/c4eb2f4e66ed444e872021051760f3be
Treasures Correct Default Config - https://paste.gg/p/anonymous/b0120210f8c149958ca0303c68c19ebd
Version 2.1.45
mcMMO will now check to see if the server version is incompatible and inform server admins on how to fix the problem.
Version 2.1.44
Fixed a NPE with Alchemy brewing
Version 2.1.43
Fixed a bug that would result in players being told they they failed to salvage enchantments when in reality they succeeded.
Version 2.1.42
Fixed McMMOPlayerNotFoundException being thrown instead of null
(API) UserManager.getPlayer() returns null again (oopsie)
Added new perk permission node `mcmmo.perks.bypass.salvageenchant` - guarantees full enchantment return for Salvage
Added alternative permission node `mcmmo.perks.bypass.repairenchant` - guarantees full enchantment return for Repair
Added new wildcard perk `mcmmo.perks.bypass.*` and `mcmmo.perks.bypass.all` (either of these will grant all new mcmmo.perks.bypass perk permissions)
NOTE: Sorry about that, when trying to improve Bungee Cord compatibility I made a big oopsie!
NOTE: Repair's new perk permission works in the exact same way as mcmmo.bypass.arcanebypass, bypass perk permissions will all eventually be moved to `mcmmo.perks.bypass`
NOTE: Expect perk permissions to all be moved to `mcmmo.perks.X` in the near future
Version 2.1.41
Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded
Added new locale string Profile.PendingLoad
Added new locale string Commands.Database.CooldownMS
Fixed a display error preventing the remaining time on /mcrank from being shown if it was on cooldown
Version 2.1.40
(API) mcMMO will now return null in all cases for UserManager.getPlayerProfile() if they have not been loaded yet
(API) Roll stores exploit data in AcrobaticsManager now
Added new locale string "Profile.Loading.FailureNotice"
Added new locale string "Profile.Loading.FailurePlayer"
mcMMO no longer gives up forever if a player profile fails to load and the player is still online
mcMMO will attempt to save a profile up to 10 times now, previously it would only try one time.
Fixed an ArrayIndexOutOfBounds error with Party Chat
Player data for mcMMO is now loaded 3 seconds after a player connects in order to give any ongoing save tasks from other servers a small grace period to finish. This will mostly be useful to Bungee servers.
NOTES: I received reports from some users saying that saving and loading was failing could fail and not recover, I have implemented some fail safes to greatly reduce the the odds of that happening.
Version 2.1.39
Salvaging an item should now only play the item break sound (was playing the anvil sound simultaneously before)
Fixed bug where Tall_Grass was not giving full XP
Added Tall_Seagrass and Seagrass to experience.yml under Herbalism (update your configs)
NOTE: This is what your herbalism section in experience.yml should look like - https://paste.gg/p/anonymous/d5b03bd56e8442f2836f8a954d2974de
Version 2.1.38
Roll XP cooldown down from 60 seconds to 10
Updated pt_BR localization (thanks FabioZumbi12)
NOTE: The XP Cooldown will be configurable in 2.2 which is nearing the finish line
Version 2.1.37
Fixed a potential IndexOutOfBoundsException when informing a disconnected player that their Blast Mining was off CD
Updated hu_HU locale (thanks andris)
Version 2.1.36
Updated German locale (Thanks OverCrave)
Fixed a bug preventing Villagers from giving combat XP
The /mcnotify command will now squelch almost all chat messages or action bar notifications sent to the player from mcMMO
mcMMO will now remind players on an hourly basis that they are are not receiving notifications from mcMMO if they have run the mcnotify command and toggled squelch mode
Added a new setting to advanced.yml "Feedback.PlayerTips", when set to true this will allow mcMMO to send periodic helpful messages to players, currently this only affects mcnotify reminders.
Version 2.1.35
Readded the detonator config option
NOTE: I decided to make the detonator configurable again because 2.2 is some ways off. Sorry for the inconvenience.
NOTE: Pickaxes are now usable for blast mining, this is in addition to the detonator that you can specify in the config. This will be more configurable in the upcoming 2.2 update.
Version 2.1.34
Added Llama to taming XP tables
Added Parrot to taming XP tables
Pickaxes are now used to activate Blast Mining instead of Flint
The detonator for Blast Mining is no longer configurable
Fixed a bug where Blast Mining did not show cooldown length correctly
NOTE: You'll have to add these entries in yourself, this is what it should look like: https://paste.gg/p/anonymous/aadbcfde3eb3470fb13caebde4065a03
Alternatively you can delete the experience config file to generate a new one
Version 2.1.33
Renamed "Skills.Acrobatics.Prevent_AFK_Leveling" to "ExploitFix.Acrobatics"
ExploitFix.Acrobatics when set to false allows gaining XP in Acrobatics freely with no anti-grind measures
NOTE: The anti-grinding/exploit stuff is fully configurable in update 2.2 coming soon, this hotfix is to hold you over until that update comes out.
Version 2.1.32
Completely removed Fireworks from mcMMO because they lag
Added 'General.AprilFoolsEvent' setting to config.yml to turn off April Fools
NOTE: April Fools event has been in mcMMO for a long time, I did not write it so I didn't know it spawned fireworks like crazy.
Version 2.1.31
Fixed a bug where certain SubSkills did not properly send unlock or rank up notifications
Fixed a bug where unlock notifications would send simultaneously for a specific skill (still happens if mmoedit changes all skill levels on a player at once)
Fixed a bug where mmoedit triggered notifications for skills already gained
Fixed NPE with grabbing offline player skill ranks through certain API methods (thanks Ineusia)
Updated German language locale (thanks OverCrave)
Version 2.1.30
Fixed double drops behaving oddly
Double_Drop config table has been renamed to Bonus_Drops, this is to jankily auto-update everyones config
DoubleDrop config tables now must contain all things that can possibly be doubled, such as the Ore block, the ore itself, etc.
Added the following items to the Bonus_Drops tables for Mining: Coal, Diamond, Emerald, Glowstone_Dust, Iron_Ingot, Lapis_Lazuli, Nether_Quartz, Redstone, Cobblestone
Added the following items to the Bonus_Drops tables for Herbalism: Beetroot, Carrot, Cocoa_Beans, Melon_Slice, Potatoe
Added the following items to the Bonus_Drops tables for Woodcutting: Birch_Wood, Spruce_Wood, Jungle_Wood, Dark_Oak_Wood, Oak_Wood, Acacia_Wood
NOTE: You don't need to update your configs for this one unless you had custom entries in the Double_Drop tables, the renaming of the key will auto-insert default values and give everyone correct defaults
NOTE: I'm gonna have to blame Bukkit on this one, several API methods I used are actually unfinished and kind of janky. So I hacked something together to make them work.
Version 2.1.29
Fixed a bug where double drops and triple drops were not activating
Version 2.1.28
Fixed a bug where Archery could not gain XP
Version 2.1.27
Fixed an exploit that allowed players to duplicate torches, and rails
Version 2.1.26
Added new scaling damage buffs to all existing Combat Skills
Added a new subskill named Stab to Swords
Fixed a bug where Berserk was not adding 50% damage to attacks
Changed how Iron Arm damage is calculated (Rank 1 now effectively gives twice the damage bonus it used to, higher ranks have more damage)
NOTE: Combat skills will be completely configurable in the upcoming 2.2 update, be patient <3
New Permissions
- mcmmo.ability.unarmed.unarmedlimitbreak
- mcmmo.ability.axes.axeslimitbreak
- mcmmo.ability.archery.archerylimitbreak
- mcmmo.ability.swords.swordslimitbreak
- mcmmo.ability.swords.stab
Notes:
The new Limit Break subskills are intended to make Prot IV players less tanky and for you to feel more powerful for having high skill level.
Limit Break has 10 ranks, each rank gives 1 extra RAW damage, this is damage before reductions from armor and enchantments. The net result is you deal about 50% more damage with an end game skill compared to before.
With these new changes, most skills can 2 shot normal diamond armor, and it takes about 5 hits to kill someone in Prot IV Diamond Armor.
I'm not sure everyone will like these changes, the net result is players are a lot easier to kill now, whereas before you could take quite a beating before getting killed.
I collected several sets of data before making these changes, including damage to player with and without prot 4 diamond armor, damage to those players with and without enchanted weapons, damage with and without leveling your skills, and combinations of the previously mentioned things.
Version 2.1.25
Shake now has an upper limit of damage (10) - Will be configurable in 2.2 which is coming in the near future
Rank 1 of Catalysis & Concoctions are now available at level 0 by default (update skillranks.yml or delete it to regen a new one)
NOTE: The change to shake was to make mcMMO more compatible with plugins that spawn entities with large amounts of HP
Version 2.1.24
Fixed an exploit where you could clone inventories
Version 2.1.23
Fixed a bug with Double Drops for Mining (Update your configs instructions below)
Fixed a 7 year old bug where damage in mcMMO from SkillBs was potentially getting reduced by damage reduction TWICE
Fixed a bug where killing entities with Rupture would not properly credit you as the killer
Fixed a bug where Serrated Strikes was applying Rupture twice
Players will now be ejected from Minecarts if they cast their fishing rod (anti-afk)
Many nerfs to Rupture, its now much more reasonable and not very useful against Protection IV opponents
Rupture's strength is now related to your equipped Sword
Rupture will no longer be applied if the target is blocking, this doesn't prevent existing bleed damage from occurring though.
Wolf's Rupture has strength equivalent to a Stone Sword
Only Diamond swords will have bonus rupture damage at Rank 4
Rupture damage is cut in half for weapons below Diamond in quality, if the weapon is wooden, the damage is cut in half again.
Swords below Diamond quality will have their tick duration drastically reduced
Rupture damage is reduced by 25% on players if they are wearing Full Armor (can be any type)
Note: You'll need to add these entries to your config.yml manually, or wait for the upcoming config update where this will be fixed for you automatically.
NOTE: Here's what your Double_Drop entries in Config.yml for Mining should look like
https://paste.gg/p/anonymous/dcd06f1215844311b4f2225f200090d1
IMPORTANT: Version 2.1.22 which came before this had a similar fix for Herbalism, instructions on how to fix your Herbalism Double Drops can be found here
https://www.spigotmc.org/resources/official-mcmmo.64348/update?update=269868
NOTE: Due to the nature of these fixes, Fortune enchants now work with Double/Triple drops
Version 2.1.22
Less aggressive spam click protection on Fishing
Updated Hungarian file for missing entries related to Fishing messages (credit: andris155)
Added all missing flowers to Double Drop tables for Herbalism
Fixed bug where Repair Mastery was calculating player skill level incorrectly when determining bonuses
Fixed Double Drop entries for all farming crops for Herbalism
It no longer requires seeds to replant crops if you are harvesting crops with a hoe (will still consume seeds if you aren't)
NOTE: You'll need to add these entries to your config.yml manually, or wait for the upcoming config update where this will be fixed for you automatically.
NOTE: Here's what your Double_Drop entries in Config.yml for Herbalism should look like: https://paste.gg/p/anonymous/8d8db4ac69bd495fa48a7f5190484c5e
Version 2.1.21
Improved anti-farm/anti-grinding mechanics for Rolling
When you gain XP from Rolling there is a cooldown period (60~ seconds) for gaining XP again
This XP cooldown period extends if players are taking fall damage within the cooldown period
NOTE: Roll already has a few built in measures to prevent XP grinding / abuse, those are still the same.
NOTE: Rolls still happen in the cooldown period, you just won't gain XP.
Version 2.1.20
Added Hungarian localization (Locale code: hu_HU) (thanks andris155)
Players can now fish in the same spot about 3 times before mcMMO will mark the area as being over-fished (over-fishing is to prevent abuse)
Added a toggle to turn off the fishing exploit detection to experience.yml "ExploitFix.Fishing"
Note: The new config update is coming soon and will use a different setting, putting this out as a band-aid fix for people that don't like the new fishing exploit prevention stuff
Added a message to warn players that their next fishing attempt will result in over-fishing (Locale: Fishing.LowResources)
Version 2.1.19
Greatly Improved Fishing AFK/Exploit Detection
Fixed a bug where Fishing AFK detection did not work on a new exploit
Certain exploits for Fishing now result in players losing small amounts of hunger and durability
Players who get detected by Fishing's anti-exploit measures will no longer get vanilla rewards from Minecraft
**Note: Previously if mcMMO detected you abusing Fishing it just switched you over to vanilla Minecraft fishing rewards, this change is to help server admins who don't want players to get any kind of reward from AFK fishing
Fishing now drops several hints to players if they are triggering the exploit detection
**Note: Not all types of exploit detection will warn players, this is just to prevent legitimate fishers from being confused by the aggressive exploit detection.
Added messages to warn players about fishing in the same spot (Locale: Fishing.Scarcity)
Added messages to warn players who exploit in order to catch fish unusually fast (Locale: Fishing.Scared)
Added messages to warn players about casting the fishing rod too often (Locale: Fishing.Exhausting)
Version 2.1.18
You will need to add Kelp to your experience.yml file for this fix to be fully functional
Breaking Kelp will now properly count its XP
Added "Kelp" to experience.yml (Kelp is actually made up of two blocks mixed together)
It is recommended that Kelp and Kelp_Plant have the same XP value in experience.yml
mcMMO will now calculate XP for plants that are taller than naturally allowed (Cactus above 3 block height, etc)
Version 2.1.17
Fixed a logic error that resulted in Drowned giving no XP
Fixed a bug that resulted in mob spawner entities to not be marked for no xp after being transforming into Drowned
Version 2.1.16
Breaking Kelp should now count the whole plant for XP
Spawned Mobs that are not supposed to award XP will no longer reward XP once transformed (ie: drowned)
Version 2.1.15
Fixed a bug where a max rank of Fuel Efficiency would cause its benefits to be lost
Version 2.1.14
Added a config option to toggle double drops for Silk Touch pickaxes (advanced.yml "Skills.Mining.DoubleDrops.SilkTouch"
Mycelium removed from Woodcutting XP tables (because its soil!)
Kelp added to Herbalism XP tables
mcMMO now flags blocks moved by piston as not natural to prevent automated XP farms
Fixed a bug where Fuel Efficiency was way too good
Fixed a display issue with Fisherman's Diet
Fuel Efficiency now uses the rank system
Removed Fuel Efficiency config options in advanced.yml
Added Tropical Fish, Raw Cod, Raw Salmon to the list of foods that benefit from Fisherman's Diet
Version 2.1.13
Fixed a bug where Archery's Arrow Retrieval was using the wrong permission node
Version 2.1.12
Salvage config entries are no longer case sensitive
Fixed a bug where Fishing was not rewarding vanilla XP orbs
Version 2.1.11
Fixed a bug where Rupture was using the wrong permission node (new permission node: mcmmo.ability.swords.rupture)
Version 2.1.10
Fishing command did an oopsie
Endstone now gives the same XP as Stone (update your experience.yml)
Version 2.1.9
Fixed a bug where grabbing the version of WG would throw classnotdefined errors
Version 2.1.8
mcMMO now checks for WG 7 before attempting to use the WG API
Made some optimizations for our WG integration
Fixed a bug where Bite chance for Master Angler was displaying too many decimal places
Fixed a bug where Abilities didn't check for permission nodes before activating
MaxBonusLevel now has specific entries for Standard and Retro in advanced.yml
MaxBonusLevel for Critical Strikes changed from 75/750 to 100/1000
MaxBonusLevel of Dodge changed from 80/800 to 100/1000
MaxBonusLevel of Rupture changed from 20/200 to 100/1000
MaxBonusLevel of Counter Attack changed from 60/600 to 100/1000
Version 2.1.7
Fixed an almost 6 year old bug where Salvage materials did not have a defined material count so they defaulted to 2 (which could lead to shovels giving back more diamonds than normal)
Added spam detection for Unarmed's bonus damage and disarm
Corrected an error where master angler for retro only required level 150 instead of 500 (update your skillranks.yml)
Fixed a bug where Players could see hidden party members in the party member listings
(API) Added addXpFromBlocks to ExperienceAPI to help make adding XP for a player easier
(API) Added addXpFromBlocksBySkill to ExperienceAPI to help make adding XP for a player easier
(API) Added addXpFromBlock to ExperienceAPI to help make adding XP for a player easier
(API) Added addXpFromBlockBySkill to ExperienceAPI to help make adding XP for a player easier
Version 2.1.6
Fixed a bug where Arcane Salvage could never fail
Recolored some lines in the locale related to failure from white to red
Fixed a bug where Salvage was giving back too many resources
SubSkillFailure renamed to SubSkillFailed in config.yml
SubSkillFailed now sends copies to chat by default
SubSkillFailed no longer sends messages to the action bar by default
Version 2.1.5
mcMMO no longer ignores cancelled events relating to the player left or right clicking
Version 2.1.4
Fixed a bug where Alchemy didn't gain XP
Fixed a bug where Archery gained XP from mob spawned entities
Fixed a display bug with Roll on /acrobatics command
Fixed a display bug for bite chance on Fishing
Fixed a display bug for treasure drop chances on Fishing
Fixed a display bug for Arcane Forging on Repair
Fixed a display bug for Super Repair on Repair
Fixed a display bug for Repair Mastery on Repair
Fixed a display bug for Second Smelt on Smelting
Repair Mastery now uses a rank system
Super Repair now uses a rank system
Changed the stat for bite chance to be more clear that its additive chance
Fixed Styling for the /salvage command
Temporarily disabled Flux Mining
Removed XP from entities that target endermite to prevent easy exploitation (Credits to TheBentoBox for the tip!) [Can be turned off in experience.yml]
Fixed a bug where static chance skills like Arcane Salvage were using incorrect calculations for success
Advanced Salvage now uses a rank system
Arcane Salvage now goes by your rank to determine the maximum amount of materials salvaged and is no longer percentage based
Fixed a bug where Iron Arm was checking for Iron Grip to be unlocked instead of itself
(Plugin Compatibility) mcMMO no longer ignores cancelled block place events (this is to prevent XP gains from placed blocks)
(Plugin Compatibility) mcMMO now ignores cancelled events relating to the player left or right clicking
(Locale) Changed the string for "Salvage.Ability.Bonus.1" to fit the new material recovery mechanics of Salvage
(Config) Added a toggle for the new endermite enderman xp farm fix in experience.yml "ExploitFix.EndermanEndermiteFarms"
(Config) Cleaned up some leftover 'unlocklevel' settings, this stuff is now handled in skillranks.yml
(Config) Removed Salvage.MaxPercentage
(Config) Removed Salvage.MaxPercentageChance
(Config) Added Salvage.ArcaneSalvage.MaxBonusLevel
(Config) Added Salvage.ArcaneSalvage.MaxChance
Version 2.1.3
Temporarily removed the unarmed no-item pickup feature until its fixed
Version 2.1.2
(Compatibility) mcMMO now deals custom damage type for all damage sources to be more compatible with other plugins (such as anti-cheat)
(Perks) Fixed a bug where the Lucky perk wasn't adding to success
(Skills) mcMMO will now listen to cancelled events to remove our temporary enchantments from tools
(Skills) Fixing a bug where Shake didn't calculate success correctly
(Skills) Fixed a bug where Arcane Forging didn't calculate success and failure correctly
(Skills) Fixed a bug where Salvage didn't calculate success and failure correctly
(Skills) Fixed a bug where Flux Mining didn't calculate success correctly
(Skills) Fixed a bug where Shake didn't calculate correctly
(Skills) Fixed a bug where Pummel didn't calculate correctly
(Skills) Tree Feller now works on Mushroom Stems
(Skills) Fixed a bug where magic chance would show as null
(Skills) Fixed a bug where Trap percentages were added to Fishing even though they no longer exist
(Skills) Magic Hunter now uses a rank system
(Skills) Fixed a bug where Magic Hunter would work without treasure hunter
(Skills) As long are you are empty handed mcMMO will no longer put items into your hands
(Skills) Improved the styling on /smelting
(Skills) Iron Arm Style can now reach a bonus damage of 10 (up from 8)
(Skills) Iron Arm Style now uses a rank system
(Skills) Iron Grip now uses a rank system
(Skills) Disarm now uses a rank system
(Skills) Arrow Deflect now uses a rank system
(Skills) Flux Mining is now a passive effect when you mine ore instead of requiring a special pickaxe
(Skills) Removed the Flux Mining mcMMO Pickaxe Item
(Style) Locked skills now are styled differently in the skill command display
(Experience) Phantoms have been added to the default experience.yml with a value of 4.0 (update your config!)
(Experience) Default XP value for witch set to 0.1 instead of 0.0
(Experience) Default XP value for ender dragon set to 1.0 instead of 0.0
(Style) Added @ symbol styling for hover tooltips to the locale
(Style) Added the skill names in the skill commands display to the locale so it can now be edited and styled
(Experience) Renamed Grass to Grass_Block in treasures.yml to allow grass to give items again (update your configs manually or delete to regen)
(Experience) Wood blocks now give XP and are affected by Tree Feller (6 sided bark blocks)
(API) Moved XPGainReason from skills to experience package
(API) Added XpGainSource for tracking sources of XP
(API) You can now specify XpGainSource when adding xp to players
(Config) The Extra Stats option for XP bars now overrides the setting for updating XP bars every time XP is gained
(Config) Added an option for Party XP gains to not update XP bars
(Config) Added an option for Passive XP gains to not update XP bars (smelting/brewing)
(Config) Added warnings if mcMMO finds a MaxBonusLevel of 0 for any skill that incorporates RNG
(Config) Removed config options for Iron Arm
(Config) Removed the options related to the Flux Mining Item
(Config) Second Smelt has a max activation chance of 50% instead of 100% (you can update your configs or gen new ones to get this change)
Version 2.1.1
= Fixed an issue where excavation wasn't using the correct permission node
= Added protection against AFK fishing
= Acrobatics now uses much better anti-exploit detection
Version 2.1.0
+ mcMMO now features XP bars! Configurable in experience.yml
+ Locale files now support & codes for colors and formatting!
+ Prevented exploits involving blocks made from entities (snowmen, etc..)
+ Added JSON integration to all Skill Commands
+ Added config setting to enable or disable old mcMMO skill scaling (General.RetroMode) this is on by default for existing installs
+ You can now disable specific skills in coreskills.yml without the need for permissions
+ Added links to mcMMO related websites to various commands
+ Certain elements of mcMMO's UI have been restyled
+ Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
+ You can now disable mcMMO completely for specific worlds via world_blacklist.txt in /plugins/mcMMO/
+ (WorldGuard) mcMMO now supports worldguard, you can use the flags "mcmmo" and "mcmmo-xp" on regions (they default to on unless otherwise specified)
! (Scoreboards) Scoreboards are now disabled by default, I don't like them. You can turn them back on in config.yml
+ (Sounds) Rolling now plays a sound (Graceful Roll has a different sound :) )
+ (Sounds) Activating Super abilities plays a sound (other plays can hear this)
+ (Sounds) Skill Unlock Notifications have sounds
+ (Sounds) Readying a tool for a super ability now plays a sound
+ (Sounds) Bleed DOT now plays a sound
+ (Experience) mcMMO now notifies you when you progress in a skill!
+ (Experience) Coral (blocks) now give Mining XP
+ (Experience) Coral (plants) now give Herbalism XP
+ (Experience) Blue Ice now gives Mining XP
+ (Experience) Dolphins now give combat XP
+ (Experience) Drowned mobs now count towards combat XP
+ (Experience) You can now set guaranteed minimum values for XP gained if diminishing returns are enabled, this value defaults to 5% (experience.yml)
+ (Events) Starting an XP event will now use the title API (toggle this in advanced.yml)
+ (Sound) Volume and Pitch of sounds can now be configured in the new sounds.yml file
+ (MySQL) Added support for SSL for MySQL/MariaDB (On by default)
! (Skills) Taming's Gore now uses Rupture Rank 1 for its DoT calculations
! (Skills) Sword's Bleed has been renamed to Rupture
! (Skills) Sword's Rupture no longer has an internal hard coded limit
! (Skills) Sword's Serrated Strikes now uses your Rupture rank to determine the damage/ticks for its bleed effect.
! (Skills) Sword's Rupture now ticks four times as fast
! (Skills) Sword's Rupture now refreshes bleed duration instead of adding duration when applying bleed to the same target
! (Skills) Sword's Rupture will now deal lethal damage
= (Skills) Fixed a bug where Rupture would apply an incorrect amount of bleed ticks
! (Skills) Sword's Rupture now reaches its max proc chance at level 20 (200 in Retro)
! (Skills) Sword's Rupture now has a max chance to proc of 33% instead of 70%
! (Skills) Sword's Rupture now deals 50% more damage at above Rank 3 and can last much longer! The base damage for Bleed has been increased as well (update your advanced.yml admins)
! (Skills) Sword's Rupture no longer triggers invincibility frames when damaging your opponent
= (Skills) Furnaces now give XP to the last person to modify their inventory instead of the first person to open them
+ (Skills) Ability Lengths now have a default skill cap at which they stop increasing in length, configurable in advanced.yml (endurance perks extend this limit)
+ (Skills) Added a new subskill to some skills 'Understanding The Art' this adds nothing new, but tracks benefits that increase together that seemed unrelated, which was previously a bit obfuscated.
+ (Skills) Tool alerts now are sent to the Action Bar
+ (Skills) Super Ability activation alerts are now sent to the Action Bar
+ (Skills) Certain Skill messages are now sent to the Action Bar
+ (Skills) Added some missing information to skill stats
+ (Config) Skill Rank requirements are now defined in skillranks.yml you cannot add or remove ranks from this file
+ (Config) Added option to use SSL for MySQL in config.yml
+ (Config) Added option to disable the new URL links to config.yml
+ (Config) New config file added coreskills.yml
+ (Config) Added rank settings for the new Woodcutting skill
+ (Config) Added configurable parameters for the new Tree Feller
+ (Config) Added retro toggle for Tree Feller
+ (Config) Added toggle to disable all scoreboards
+ (Chat) Added ability for admins to spy on party chat (off unless toggled on)
+ (Commands) Added new info command /mmoinfo or /mcinfo
+ (Commands) Added toggle command /mcchatspy
+ (API) Added many missing SubSkills to SubSkillType class
+ (Permissions) Added permission node mcmmo.commands.mcchatspy & mcmmo.commands.mcchatspy.others
+ (Permissions) Added permission nodes for Harvest Lumber, Splinter, Nature's Bounty, and Bark Surgeon
+ (Permissions) Added mcmmo.commands.mmoinfo for the new mmoinfo/mcinfo command
! (Permissions) Call of the wild now uses mcmmo.ability.taming.callofthewild instead of mcmmo.ability.taming.callofthewild.all
+ (Locale) Added locale strings for new Woodcutting abilities
+ (Locale) Added locale strings for mcchatspy command
+ (Locale) Added locale strings for JSON integration
+ (Locale) Added locale strings for Taming's Pummel SubSkill
+ (Locale) Added locale strings for Unarmed's Block Cracker SubSkill
- (Locale) Removed localizations with the following codes for being almost empty: id, HR_hr, et_EE, lv, lt, no, pl_PL, pt_PT, tr_TR
- (Config) Removed SkillShot's IncreaseLevel & IncreasePercentage (replaced by RankDamageMultiplier)
- (Config) Removed AxeMastery's MaxBonus & MaxBonusLevel (replaced by RankDamageMultiplier)
= (Events) Fixed bug where XP rate could be a negative number
= (Experience) Fixed a bug where you could set a players levels into the negative and bad things would happen
= (Plugin Compatibility) mcMMO now fires new custom events relating to changes it makes to player scoreboards, plugin authors can listen to these events to improve compatibility
= (Items) Chimaera Wing now tracks cooldowns between sessions for players (no more disconnect abuse)
= (Skills) Added missing mushroom blocks to experience.yml defaults
= (Skills) Tridents will no longer be considered unarmed
= (MySQL) You can now inspect offline players
= (MySQL) When converting from MySQL to flatfile mcMMO will now properly include all users in the conversion process
= (Commands) '/mcMMO help' no longer displays the other/special commands category to players lacking permissions
+ (Party) Parties can now have size limits (configurable in config.yml), party size is unlimited by default
+ (Party) You can now turn on Friendly Fire for parties in config.yml
+ (Debug Stick) The Debug stick can now tell you about properties of a block related to Excavation
! (Deaths) Fixed the bug where mob names would be replaced by hearts
! (Experience) The XP values of fish are now based on their rarity and have been drastically changed
! (Experience) Skills now start at level 1 (configurable in advanced.yml)
! (Item) Improved some of the messages sent to the player regarding the Chimaera Wing
! (Party) Party member list will only include members of the party that you can see (aren't vanished)
! (Skills) Excavation Treasure Hunter is renamed to Archaeology
! (Skills) Swords no longer require blocking with a shield to trigger counter attacks
! (Skills) Stripping wood and right clicking on stripped wood will no longer ready your Axe
! (Skills) Some skill level rank requirements have changed
! (Skills) Green Thumb now uses a rank system
! (Skills) Farmer's Diet & Fisherman's Diet now use a rank system
! (Skills) Fixed an edge case bug where Blast Mining wouldn't inform the player that it was on cooldown
! (Skills) mcMMO skills will now be on a scale from 1-100 instead of 0-1000 (for existing mcMMO installs this is opt-in and off by default)
! (Skills) Skill Super Powers now use a rank system, almost all of them unlocking first at level 10
! (Skills) Acrobatics' Roll exploit detection was tweaked to still allow for Roll to trigger even if it rewards no XP
! (Skills) Acrobatics' Roll & Gracefull Roll are now considered the same skill (both mechanics are still there)
! (Skills) Woodcutting's Double Drop subskill is now named Harvest Lumber
! (Skills) Archery's Skill Shot now uses a rank system
! (Skills) Swords' Bleed now uses a rank system
! (Skills) Swords' Counter Attack now uses a rank system
! (Skills) Axe's Axe Mastery now uses a rank system
! (Skills) Axe's Impact now uses a rank system
! (Skills) Herbalism's Farmer's Diet now uses a rank system
! (Skills) Herbalism's Green Thumb now uses a rank system
! (Skills) Shake now uses a rank system
! (Skills) Flux Mining now uses a rank system
! (Skills) Removed traps from fishing
! (Skills) Dodge now uses a rank system
! (Skills) Arrow Retrieval now uses a rank system
! (Skills) Axes' Critical Strikes now uses a rank system
! (Skills) Axes' Greater Impact now uses a rank system
! (Skills) Taming's Beast Lore now uses a rank system
! (Skills) Taming's Gore now uses a rank system
! (Skills) Taming's Call of the Wild now uses a rank system
! (Skills) Taming's Pummel now uses a rank system
! (Kraken) Removed everything involving the kraken
= (Skills) Shake now sends custom damage types for better nocheat compat
! (Config) Unarmed.IronArm in advanced.yml is now Unarmed.IronArmStyle
! (Config) Unarmed.Deflect in advanced.yml is now Unarmed.ArrowDeflect
! (Config) Swords.Counter in advanced.yml is now Swords.CounterAttack
! (Config) Archery.Retrieve in advanced.yml is now Archery.ArrowRetrieval
! (Config) Axes.CriticalHit in advanced.yml is now Axes.CriticalStrikes
! (Config) Archery's Skill Shot now uses RankDamageMultiplier for its damage bonus calculations
! (Config) Axe's Axe mastery now uses RankDamageMultiplier for its damage bonus calculations
! (Permissions) Replaced the old Double Drop permission node for woodcutting with a new Harvest Lumber permission node
! (Permissions) Fast Food Service permission node renamed to mcmmo.ability.taming.fastfoodservice
! (Permissions) Counter Attack permission node renamed to mcmmo.ability.swords.counterattack
! (Permissions) Arrow Deflect permission node renamed to mcmmo.ability.unarmed.arrowdeflect
! (Permissions) Iron Arm Style permission node renamed to mcmmo.ability.unarmed.ironarmstyle
! (Permissions) Remove all mob health bar permissions, this is no longer a per-player setting.
! (Commands) Removed the mobhealthbar command, this is no longer a per-player setting.
! (Locale) The descriptions of a few skills have changed
! (Locale) Removed redundant information from some skill names and descriptions en_US (other locales will need to be updated)
! (Locale) SubSkill locale keys are now located at {ParentSkill}.SubSkill.SubSkillName
! (Locale) Super Abilities no longer have (ABILITY) in their Skill.Effect strings
! (API) mcMMO is now built against Spigot-API instead of Bukkit
! (API) Moved a lot of methods from SkillCommand to SkillUtils
! (API) SkillType is now PrimarySkillType
! (API) SecondarySkill is now SubSkillType
! (API) AbilityType is now SuperAbilityType
! (API) SecondaryAbilityEvent is now SubSkillEvent
! (API) SubSkillType has had many helpful methods added to it
! (API) GREEN_THUMB_PLANT & GREEN_THUMB_BLOCK are replaced by GREEN_THUMB
! (Code) Refactored some unreadable code relating to SecondaryAbilityType activation in SkillUtils
Version 2.0.0
= Fixed an interaction between Tree Feller and Stripped Wood
! Fireworks no longer fire by default for ability activation/deactivation
! Website has been changed and the MOTD string relating to it reflects this
! Discord link added to mcMMO command
! Updated misc strings relating to mcMMO
Version 1.5.05-SNAPSHOT
Version 1.5.04
+ Added option to config.yml to control mcMMO generated sound volume
+ Added option to config.yml to truncate existing player skill levels that exceed the skill level cap
+ Falling blocks persist mcMMO natural data
= Woodcutting double drops correctly identify acacia and dark oak logs
= Skill Reset command now correctly identifies arguments
= Hylian Treasure config options are now actually used
= Child skills now use parent skills configured skill caps properly
= Auto Update config now properly works
! Item dropped from blocks now drop from the center
! Potions Config updated for 1.9
! Flux mining now simulates a block break event for other plugins to act upon
! Zombie Pigmen spawned from nether portals are now considered spawner mobs
! Flux Pickaxe lore now appends to existing lore as opposed to replacing it
! Party chat no longer displays colors when logged in server console
- Treefeller no longer lowers exp for big trees
- No longer supports 1.8 :(
- Removed plugin metrics
Version 1.5.03
= Fixed bug where absorption hearts could be attacked by allied players
= Fixed bug where new forms of stone would drop the wrong type when mined with Silk Touch
= Fixed bug where blocks would not get tracked correctly when using sticky pistons and slime blocks in certain situations
= Fixed bug where config value for Daze damage was ignored
= Fixed UUID updater to not lose data on errors
= Fixed bug where uuid update could result in large amounts of user data being deleted
= Fixed bug where custom potions were missed in potion stage calculation
= Fixed piston dupe bugs permanently
= Fixed bug involving user name changes
= Fixed old user purge to properly calculate months
= Fixed bug where Repair would incorrectly check items
= Fixed bug where apostrophes in locale files would not read correctly
= Fixed bug where treasure data was limited to 255 instead of Short.MAX_VALUE
! Moved more user loading calculations to async loading thread to reduce lag on login
Version 1.5.02
+ Added option to config.yml for Chimaera Wings to stop using bed spawn points
+ Added option to config.yml to let non-tools in hand count as unarmed
+ Added option to experience.yml to control XP gained by killing bred animals
+ Added support for 1.8 mobs and features
= Fixed bug where no Mining XP was granted when Flux Mining was successful
= Fixed bug with UUID conversions in Flatfile
= Fixed a couple Dupe bugs that were introduced recently
= Fixed bug where MobHealthbarTypes were not saved between server restarts
! Changed Flux Mining mechanics. In order to use the ability, you need to infuse a pickaxe with furnace powers first.
! Scoreboard tips are only shown a couple of times to the player, instead of once per login session
! Changed Archery distance multiplier to be configurable
! Archery distance XP bonus cannot exceed indefinitely anymore
Version 1.5.01
+ Added new child skill; Salvage
+ Added UUID support!
+ Added SQL connection pooling and async loading!
@@ -56,6 +645,7 @@ Version 1.5.01-dev
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
! Changed behavior of the Blast Mining ability "Demolition Expert"; now only decreases damage for the ability user
! Updated for new getOnlinePlayers() behavior
! Updated for new blocks and entities
! Changed McMMOPlayerDeathPenaltyEvent to get fired after hardcore penalty calculations, use McMMOPlayerPreDeathPenaltyEvent for old behavior
! Moved Refresh_Chunks setting from hidden.yml to config.yml
- Removed salvage ability from Repair, salvage has it's own (child) skill now

234
Changelog_2.1.0.md Normal file
View File

@@ -0,0 +1,234 @@
# **Version 2.1.0+**
### Please use Spigot or Paper!
* **mcMMO is now built against Spigot-API instead of Bukkit**
### New Level Scaling
* mcMMO now features an optional 1-100 scaling mode!
* This is on by default for new installs, if you are upgrading mcMMO you will be put into Retro Mode instead (1-1000) scaling.
* The two scaling modes are the same, the changes are completely cosmetic!
* Skill Requirements in the config file will be multiplied by 10 if you are using Retro mode unless the setting has Retro in its name, keep this in mind if you need to edit anything!
### WorldGuard Support
* Added support for WorldGuard regions!
* `mcmmo` region flag turns on or off a players ability to use anything related to mcMMO other than commands
* `mcmmo-xp` region flag turns on or off a player's ability to gain XP
* These flags default to on unless you specify otherwise
### World Blacklist
* You can now disable mcMMO completely for specific worlds via `world_blacklist.txt` in /plugins/mcMMO/
* This file appears once mcMMO has been run at least once
* Every line of this file should be the name of a world where you don't want mcMMO to be enabled!
### Rank System
* Skills that are not yet unlocked will show up as `???` until learned
* Many skills now make use of a rank system!
* Rank level requirements are modified in `skillranks.yml`
* Woodcutting's Double Drop subskill is now named Harvest Lumber
* Archery's Skill Shot now uses a rank system
* Swords' Bleed now uses a rank system
* Swords' Counter Attack now uses a rank system
* Axe's Axe Mastery now uses a rank system
* Axe's Impact now uses a rank system
* Herbalism's Farmer's Diet now uses a rank system
* Herbalism's Green Thumb now uses a rank system
* Shake now uses a rank system
* Flux Mining now uses a rank system
* Removed traps from fishing
* Dodge now uses a rank system
* Arrow Retrieval now uses a rank system
* Axes' Critical Strikes now uses a rank system
* Axes' Greater Impact now uses a rank system
* Taming's Beast Lore now uses a rank system
* Taming's Gore now uses a rank system
* Taming's Call of the Wild now uses a rank system
* Taming's Pummel now uses a rank system
* Green Thumb now uses a rank system
* Farmer's Diet & Fisherman's Diet now use a rank system
### mcMMO Chat Alerts
* mcMMO no longer spams your chat!
* Most messages are sent to your action bar instead!
* Completely configurable! You can have mcMMO spam your chat again if you want!
* You can configure it so that messages will be sent to your action bar AND your chat system!
* Improved some of the messages sent to the player regarding the Chimaera Wing
### Localization File
* The descriptions of a few skills have changed
* Locale files now support & codes for colors and formatting!
* Added locale strings for new Woodcutting abilities
* Added locale strings for mcchatspy command
* Added locale strings for JSON integration
* Added locale strings for Taming's Pummel SubSkill
* Added locale strings for Unarmed's Block Cracker SubSkill
* Removed localizations with the following codes for being almost empty: `id`, `HR_hr`, `et_EE`, `lv`, `lt`, `no`, `pl_PL`, `pt_PT`, `tr_TR`
* Removed redundant information from some skill names and descriptions `en_US` (other locales will need to be updated)
* SubSkill locale keys are now located at `{ParentSkill}.SubSkill.SubSkillName`
* Super Abilities no longer have `(ABILITY)` in their `Skill.Effect` strings
### UI
* Certain elements of mcMMO's UI have been restyled
* Skills can now be clicked on and hovered over for more information!
* Added links to mcMMO related websites to various commands
* Customizeable and optional XP Bars
* Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
* Added option to disable the new URL links to `config.yml`
### Sounds
* Volume and Pitch of sounds can now be configured in the new `sounds.yml` file
### Super Ability Changes
* Skill Super Abilities now use a rank system, the default rank to unlock is level 5
* Activating Super abilities plays a sound (other plays can hear this)
* Ability Lengths now have a default skill cap at which they stop increasing in length
* Setting the cap to 0 removes it!
* Configurable in `advanced.yml` (endurance perks extend this limit)
### Skills
* mcMMO now notifies you when you progress in a skill!
* Excavation Treasure Hunter is renamed to Archaeology
* Readying a tool for a super ability now plays a sound
* Skill Unlock Notifications have sounds
* Stripping wood and right clicking on stripped wood will no longer ready your Axe
* Added new skill 'Understanding The Art' which adds nothing new but tracks previously hidden benefits of raising a skill
* Tool alerts now are sent to the Action Bar
* Super Ability activation alerts are now sent to the Action Bar
* Almost all Skill-related messages are now sent to the Action Bar
* Added some missing information to skill stats
* Swords no longer require blocking with a shield to trigger counter attacks
* Sword's Bleed has been renamed to Rupture
* Sword's Rupture no longer has an internal hard coded limit
* Sword's Serrated Strikes now uses your Rupture rank to determine the damage/ticks for its bleed effect.
* Sword's Rupture now ticks four times as fast
* Sword's Rupture now refreshes bleed duration instead of adding duration when applying bleed to the same target
* Sword's Rupture will now deal lethal damage
* Sword's Rupture now reaches its max proc chance at level 20 (200 in Retro)
* Sword's Rupture now has a max chance to proc of 33% instead of 70%
* Sword's Rupture now deals 50% more damage at above Rank 3 and can last much longer!
* The base damage for Bleed has been increased as well (update your `advanced.yml` admins)
* Sword's Rupture no longer triggers invincibility frames when damaging your opponent
* Sword's Rupture now plays a sound
* Taming's Gore now uses Rupture Rank 1 for its DoT calculations
* Furnaces now give XP to the last person to modify their inventory instead of the first person to open them
* Rolling now plays a sound (Graceful Roll has a different sound :) )
* Acrobatics' Roll exploit detection was tweaked to still allow for Roll to trigger even if it rewards no XP
* Acrobatics' Roll & Gracefull Roll are now considered the same skill (both mechanics are still there)
* Some skill level rank requirements have changed
### Experience
* Skills now start at level 1 (configurable in advanced.yml)
* Starting an XP event will now use the title API (toggle this in `advanced.yml`)
* The XP values of fish are now based on their rarity and have been drastically changed
* Coral (blocks) now give Mining XP
* Coral (plants) now give Herbalism XP
* Blue Ice now gives Mining XP
* Dolphins now give combat XP
* Drowned mobs now count towards combat XP
* Added missing mushroom blocks for XP
* You can now set guaranteed minimum values for XP gained if diminishing returns are enabled, this value defaults to 5% (`experience.yml`)
### Bug Fixes
* Fixed the bug where mob names would be replaced by hearts
* Fixed a bug where Rupture would apply an incorrect amount of bleed ticks
* Fixed bug where XP rate could be a negative number
* Fixed a bug where you could set a players levels into the negative and bad things would happen
* Fixed an edge case bug where Blast Mining wouldn't inform the player that it was on cooldown
### Plugin Compatibility
* mcMMO now fires new custom events relating to changes it makes to player scoreboards, plugin authors can listen to these events to improve compatibility
### Exploit Fixes
* Prevented exploits involving blocks made from entities (snowmen, etc..)
* Chimaera Wing now tracks cooldowns between sessions for players (no more disconnect abuse)
* Tridents will no longer be considered unarmed
* Prevented exploits involving 2 high herbs and chorus flowers
* Vastly Improved the Acrobatics exploit detection checks
### Parties
* Parties can now have size limits (configurable in `config.yml`), party size is unlimited by default
* You can now turn on Friendly Fire for parties in `config.yml`
* Party member list will only include members of the party that you can see (aren't vanished)
### Scoreboards
* Scoreboards are now disabled by default since most of their functionality is handled better by XP bars.
* Added toggle to disable all scoreboards (previously you had to disable them one by one)
* You can turn them back on in `config.yml`
* You can have XP bars and scoreboards on at the same time
### MySQL
* Added support for SSL for MySQL/MariaDB in config.yml (On by default)
* mcMMO no longer spams your console if you are not using SSL for your MySQL server
* You can now inspect offline players
* When converting from MySQL to flatfile mcMMO will now properly include all users in the conversion process
### Admins
* Added ability for admins to spy on party chat (off unless toggled on) /mcchatspy
* The Debug stick can now tell you about properties of a block related to Excavation
### API
* Detailed guide to API changes is available at http://api.mcmmo.org
* Added many missing `SubSkills` to `SubSkillType` class
* Moved a lot of methods from `SkillCommand` to `SkillUtils`
* `SkillType` is now `PrimarySkillType`
* `SecondarySkill` is now `SubSkillType`
* `AbilityType` is now `SuperAbilityType`
* `SecondaryAbilityEvent` is now `SubSkillEvent`
* `SubSkillType` has had many helpful methods added to it
* `GREEN_THUMB_PLANT` & `GREEN_THUMB_BLOCK` are replaced by `GREEN_THUMB`
### Permissions
* Removed all mob health bar permissions, this is no longer a per-player setting.
* Added permission node `mcmmo.commands.mcchatspy` & `mcmmo.commands.mcchatspy.others`
* Added `mcmmo.commands.mmoinfo` for the new `mmoinfo`/`mcinfo` command
* Added permission nodes for Harvest Lumber, Splinter, Nature's Bounty, and Bark Surgeon
* Call of the wild now uses `mcmmo.ability.taming.callofthewild` instead of `mcmmo.ability.taming.callofthewild.all`
* Replaced the old Double Drop permission node for woodcutting with a new Harvest Lumber permission node
* Fast Food Service permission node renamed to `mcmmo.ability.taming.fastfoodservice`
* Counter Attack permission node renamed to `mcmmo.ability.swords.counterattack`
* Arrow Deflect permission node renamed to `mcmmo.ability.unarmed.arrowdeflect`
* Iron Arm Style permission node renamed to `mcmmo.ability.unarmed.ironarmstyle`
### Commands
* Added new info command `/mmoinfo` or `/mcinfo`
* Added toggle command `/mcchatspy`
* `/mcMMO help` no longer displays the other/special commands category to players lacking permissions
* Removed the `mobhealthbar` command, this is no longer a per-player setting.
### Misc Config Changes
* Removed `SkillShot`'s `IncreaseLevel` & `IncreasePercentage` (replaced by `RankDamageMultiplier`)
* Removed `AxeMastery`'s `MaxBonus` & `MaxBonusLevel` (replaced by `RankDamageMultiplier`)
* `Unarmed.IronArm` in `advanced.yml` is now `Unarmed.IronArmStyle`
* `Unarmed.Deflect` in `advanced.yml` is now `Unarmed.ArrowDeflect`
* `Swords.Counter` in `advanced.yml` is now `Swords.CounterAttack`
* `Archery.Retrieve` in `advanced.yml` is now `Archery.ArrowRetrieval`
* `Axes.CriticalHit` in `advanced.yml` is now `Axes.CriticalStrikes`
* Archery's Skill Shot now uses `RankDamageMultiplier` for its damage bonus calculations
* Axe's Axe mastery now uses `RankDamageMultiplier` for its damage bonus calculations
### Misc Changes
* Removed everything involving the kraken
* Code cleanup in a lot of places... unfortunately there is still much left to do!

View File

@@ -1,41 +1,47 @@
# mcMMO
## The RPG lovers mod
## Website
I'm working on a brand new website for mcMMO
You can check it out here http://www.mcmmo.org
Spigot Resource: https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/
I plan to post links to our new wiki (its still under development), downloads, and dev blogs there.
### Builds
Currently, you can obtain our builds via the Spigot resource page: http://www.spigotmc.org/resources/mcmmo.2445/
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 add 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 nossr50 returned as project lead for mcMMO once again to develop and improve mcMMO.
The mcMMO team currently has two members, nossr50 (lead) and t00thpick1 (classic maintainer).
mcMMO is currently developed almost entirely by nossr50, many thanks go out to the many developers who have worked on the project over the years.
mcMMO is currently developed by a team of individuals from all over the world.
### Glorious Leader
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)]
(https://github.com/gmcferrin)
### Project Lead & Founder
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50)
### Developers
[![bm01](http://www.gravatar.com/avatar/ec8146f5358177f12e9a252271bbc391.png)]
(https://github.com/bm01)
[![Glitchfinder](http://www.gravatar.com/avatar/5aa4cce22f72ae9c002ecec30f061d00.png)]
(https://github.com/Glitchfinder)
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)]
(https://github.com/nossr50)
[![NuclearW](http://www.gravatar.com/avatar/90926bdcf1c8a75918df5ea5fa801ce6.png)]
(https://github.com/NuclearW)
[![shatteredbeam](http://www.gravatar.com/avatar/cad3b5d7d39cf5387afb87f494389610.png)]
(https://github.com/shatteredbeam)
[![TfT_02](http://www.gravatar.com/avatar/b8914f9970e1f6ffd5281ce4770e20a7.png)]
(https://github.com/TfT-02)
[![t00thpick1](http://www.gravatar.com/avatar/ee23c7794a0c40120c3474287c7bce06.png)]
(https://github.com/t00thpick1)
[![riking](https://1.gravatar.com/avatar/aca9f37e569ac3a63929920035a91ba4.png)]
(https://github.com/riking)
Other mcMMO Projects
### Special thanks
[![EasyMFnE](https://www.gravatar.com/avatar/99c9a1fa3bbf957791ceac7b45daadb0.png)]
(https://github.com/EasyMFnE)
Added the Alchemy skill
### 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)
[![shatteredbeam](http://www.gravatar.com/avatar/cad3b5d7d39cf5387afb87f494389610.png)](https://github.com/shatteredbeam)
[![TfT_02](http://www.gravatar.com/avatar/b8914f9970e1f6ffd5281ce4770e20a7.png)](https://github.com/TfT-02)
[![riking](https://1.gravatar.com/avatar/aca9f37e569ac3a63929920035a91ba4.png)](https://github.com/riking)
[![TheYeti](https://i.imgur.com/tzFrxdo.png)](https://github.com/TheYeti)
## Compiling
@@ -44,8 +50,10 @@ mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary c
The typical command used to build mcMMO is: `mvn clean package install`
Required Libraries:
* JUnit
* EMetrics
* Bukkit
* JUnit
* WorldGuard 7
* bStats Bukkit
http://dev.bukkit.org/server-mods/mcmmo for more up to date information.
http://spigot.mcmmo.org for more up to date information.
https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/

95
pom.xml
View File

@@ -2,15 +2,22 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>1.5.01-SNAPSHOT</version>
<version>2.1.47</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<connection>scm:git:git://github.com/mcMMO-Dev/mcMMO.git</connection>
<developerConnection>scm:git:git@github.com:mcMMO-Dev/mcMMO.git</developerConnection>
<tag>HEAD</tag>
</scm>
<issueManagement>
<url>https://github.com/mcMMO-Dev/mcMMO/issues</url>
<system>GitHub</system>
</issueManagement>
<packaging>jar</packaging>
<build>
<finalName>mcMMO</finalName>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
@@ -38,15 +45,28 @@
<include>*.yml</include>
</includes>
</resource>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}</directory>
<includes>
<include>LICENSE</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
<excludes>
</excludes>
</configuration>
@@ -71,13 +91,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<version>3.1.1</version>
<configuration>
<artifactSet>
<includes>
<include>commons-logging:commons-logging</include>
<include>org.apache.tomcat:tomcat-jdbc</include>
<include>org.apache.tomcat:tomcat-juli</include>
<include>org.bstats:bstats-bukkit</include>
</includes>
</artifactSet>
<relocations>
@@ -93,6 +114,10 @@
<pattern>org.apache.tomcat</pattern>
<shadedPattern>com.gmail.nossr50.database.tomcat</shadedPattern>
</relocation>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.gmail.nossr50.metrics.bstat</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
@@ -115,26 +140,52 @@
</build>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository>
<id>Plugin MetricsExtension</id>
<url>http://repo.turt2live.com</url>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.10-R0.1-SNAPSHOT</version>
<type>jar</type>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-core</artifactId>
<version>7.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-legacy</artifactId>
<version>7.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
@@ -148,21 +199,7 @@
<scope>compile</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>md_5-snapshots</id>
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<ciManagement>
<system>Jenkins</system>
<url>http://ci.ecocitycraft.com/job/mcMMO</url>
</ciManagement>
</project>

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.gmail.nossr50.mcMMO

View File

@@ -1,48 +1,47 @@
package com.gmail.nossr50.api;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType;
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 UserManager.getPlayer(player).getAbilityMode(AbilityType.BERSERK);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.BERSERK);
}
public static boolean gigaDrillBreakerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GIGA_DRILL_BREAKER);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER);
}
public static boolean greenTerraEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GREEN_TERRA);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.GREEN_TERRA);
}
public static boolean serratedStrikesEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SERRATED_STRIKES);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.SERRATED_STRIKES);
}
public static boolean skullSplitterEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SKULL_SPLITTER);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.SKULL_SPLITTER);
}
public static boolean superBreakerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SUPER_BREAKER);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.SUPER_BREAKER);
}
public static boolean treeFellerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.TREE_FELLER);
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.TREE_FELLER);
}
public static boolean isAnyAbilityEnabled(Player player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
for (AbilityType ability : AbilityType.values()) {
for (SuperAbilityType ability : SuperAbilityType.values()) {
if (mcMMOPlayer.getAbilityMode(ability)) {
return true;
}
@@ -56,31 +55,31 @@ public final class AbilityAPI {
}
public static void setBerserkCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.BERSERK, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.BERSERK, cooldown);
}
public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GIGA_DRILL_BREAKER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.GIGA_DRILL_BREAKER, cooldown);
}
public static void setGreenTerraCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GREEN_TERRA, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.GREEN_TERRA, cooldown);
}
public static void setSerratedStrikesCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SERRATED_STRIKES, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.SERRATED_STRIKES, cooldown);
}
public static void setSkullSplitterCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SKULL_SPLITTER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.SKULL_SPLITTER, cooldown);
}
public static void setSuperBreakerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SUPER_BREAKER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.SUPER_BREAKER, cooldown);
}
public static void setTreeFellerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.TREE_FELLER, cooldown);
}
public static boolean isBleeding(LivingEntity entity) {

View File

@@ -1,14 +1,13 @@
package com.gmail.nossr50.api;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
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() {}

View File

@@ -1,25 +1,23 @@
package com.gmail.nossr50.api;
import java.util.Set;
import java.util.UUID;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.api.exceptions.InvalidFormulaTypeException;
import com.gmail.nossr50.api.exceptions.InvalidPlayerException;
import com.gmail.nossr50.api.exceptions.InvalidSkillException;
import com.gmail.nossr50.api.exceptions.InvalidXPGainReasonException;
import com.gmail.nossr50.api.exceptions.McMMOPlayerNotFoundException;
import com.gmail.nossr50.api.exceptions.*;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;
public final class ExperienceAPI {
private ExperienceAPI() {}
@@ -34,7 +32,7 @@ public final class ExperienceAPI {
* @return true if this is a valid mcMMO skill
*/
public static boolean isValidSkillType(String skillType) {
return SkillType.getSkill(skillType) != null;
return PrimarySkillType.getSkill(skillType) != null;
}
/**
@@ -48,7 +46,7 @@ public final class ExperienceAPI {
* @return true if this is a valid, non-child mcMMO skill
*/
public static boolean isNonChildSkill(String skillType) {
SkillType skill = SkillType.getSkill(skillType);
PrimarySkillType skill = PrimarySkillType.getSkill(skillType);
return skill != null && !skill.isChildSkill();
}
@@ -107,11 +105,11 @@ public final class ExperienceAPI {
*/
public static void addRawXP(Player player, String skillType, float XP, String xpGainReason, boolean isUnshared) {
if (isUnshared) {
getPlayer(player).beginUnsharedXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
getPlayer(player).beginUnsharedXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
return;
}
getPlayer(player).applyXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
getPlayer(player).applyXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
}
/**
@@ -193,7 +191,7 @@ public final class ExperienceAPI {
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/
public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) {
getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
}
/**
@@ -261,14 +259,14 @@ public final class ExperienceAPI {
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/
public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) {
SkillType skill = getSkillType(skillType);
PrimarySkillType skill = getSkillType(skillType);
if (isUnshared) {
getPlayer(player).beginUnsharedXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
getPlayer(player).beginUnsharedXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
return;
}
getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
}
/**
@@ -285,7 +283,7 @@ public final class ExperienceAPI {
*/
@Deprecated
public static void addModifiedXPOffline(String playerName, String skillType, int XP) {
SkillType skill = getSkillType(skillType);
PrimarySkillType skill = getSkillType(skillType);
addOfflineXP(playerName, skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()));
}
@@ -342,11 +340,11 @@ public final class ExperienceAPI {
*/
public static void addXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) {
if (isUnshared) {
getPlayer(player).beginUnsharedXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
getPlayer(player).beginUnsharedXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
return;
}
getPlayer(player).beginXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
getPlayer(player).beginXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason), XPGainSource.CUSTOM);
}
/**
@@ -515,7 +513,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill
*/
public static int getXPRemaining(Player player, String skillType) {
SkillType skill = getNonChildSkillType(skillType);
PrimarySkillType skill = getNonChildSkillType(skillType);
PlayerProfile profile = getPlayer(player).getProfile();
@@ -537,7 +535,7 @@ public final class ExperienceAPI {
*/
@Deprecated
public static int getOfflineXPRemaining(String playerName, String skillType) {
SkillType skill = getNonChildSkillType(skillType);
PrimarySkillType skill = getNonChildSkillType(skillType);
PlayerProfile profile = getOfflineProfile(playerName);
return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
@@ -557,7 +555,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill
*/
public static float getOfflineXPRemaining(UUID uuid, String skillType) {
SkillType skill = getNonChildSkillType(skillType);
PrimarySkillType skill = getNonChildSkillType(skillType);
PlayerProfile profile = getOfflineProfile(uuid);
return profile.getXpToLevel(skill) - profile.getSkillXpLevelRaw(skill);
@@ -593,12 +591,12 @@ public final class ExperienceAPI {
@Deprecated
public static void addLevelOffline(String playerName, String skillType, int levels) {
PlayerProfile profile = getOfflineProfile(playerName);
SkillType skill = getSkillType(skillType);
PrimarySkillType skill = getSkillType(skillType);
if (skill.isChildSkill()) {
Set<SkillType> parentSkills = FamilyTree.getParents(skill);
Set<PrimarySkillType> parentSkills = FamilyTree.getParents(skill);
for (SkillType parentSkill : parentSkills) {
for (PrimarySkillType parentSkill : parentSkills) {
profile.addLevels(parentSkill, (levels / parentSkills.size()));
}
@@ -624,12 +622,12 @@ public final class ExperienceAPI {
*/
public static void addLevelOffline(UUID uuid, String skillType, int levels) {
PlayerProfile profile = getOfflineProfile(uuid);
SkillType skill = getSkillType(skillType);
PrimarySkillType skill = getSkillType(skillType);
if (skill.isChildSkill()) {
Set<SkillType> parentSkills = FamilyTree.getParents(skill);
Set<PrimarySkillType> parentSkills = FamilyTree.getParents(skill);
for (SkillType parentSkill : parentSkills) {
for (PrimarySkillType parentSkill : parentSkills) {
profile.addLevels(parentSkill, (levels / parentSkills.size()));
}
@@ -716,7 +714,7 @@ public final class ExperienceAPI {
int powerLevel = 0;
PlayerProfile profile = getOfflineProfile(playerName);
for (SkillType type : SkillType.NON_CHILD_SKILLS) {
for (PrimarySkillType type : PrimarySkillType.NON_CHILD_SKILLS) {
powerLevel += profile.getSkillLevel(type);
}
@@ -737,7 +735,7 @@ public final class ExperienceAPI {
int powerLevel = 0;
PlayerProfile profile = getOfflineProfile(uuid);
for (SkillType type : SkillType.NON_CHILD_SKILLS) {
for (PrimarySkillType type : PrimarySkillType.NON_CHILD_SKILLS) {
powerLevel += profile.getSkillLevel(type);
}
@@ -785,7 +783,7 @@ public final class ExperienceAPI {
*/
@Deprecated
public static int getPlayerRankSkill(String playerName, String skillType) {
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get(getNonChildSkillType(skillType));
return mcMMO.getDatabaseManager().readRank(mcMMO.p.getServer().getOfflinePlayer(playerName).getName()).get(getNonChildSkillType(skillType));
}
/**
@@ -803,7 +801,7 @@ public final class ExperienceAPI {
* @return the position on the leaderboard
*/
public static int getPlayerRankSkill(UUID uuid, String skillType) {
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(uuid).getPlayerName()).get(getNonChildSkillType(skillType));
return mcMMO.getDatabaseManager().readRank(mcMMO.p.getServer().getOfflinePlayer(uuid).getName()).get(getNonChildSkillType(skillType));
}
/**
@@ -819,7 +817,7 @@ public final class ExperienceAPI {
*/
@Deprecated
public static int getPlayerRankOverall(String playerName) {
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get(null);
return mcMMO.getDatabaseManager().readRank(mcMMO.p.getServer().getOfflinePlayer(playerName).getName()).get(null);
}
/**
@@ -834,7 +832,7 @@ public final class ExperienceAPI {
* @return the position on the power level leaderboard
*/
public static int getPlayerRankOverall(UUID uuid) {
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(uuid).getPlayerName()).get(null);
return mcMMO.getDatabaseManager().readRank(mcMMO.p.getServer().getOfflinePlayer(uuid).getName()).get(null);
}
/**
@@ -1014,8 +1012,76 @@ public final class ExperienceAPI {
return mcMMO.getFormulaManager().getCachedXpToLevel(level, getFormulaType(formulaType));
}
/**
* Will add the appropriate type of XP from the block to the player based on the material of the blocks given
* @param blockStates the blocks to reward XP for
* @param mcMMOPlayer the target player
*/
public static void addXpFromBlocks(ArrayList<BlockState> blockStates, McMMOPlayer mcMMOPlayer)
{
for(BlockState bs : blockStates)
{
for(PrimarySkillType skillType : PrimarySkillType.values())
{
if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0)
{
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
}
}
/**
* Will add the appropriate type of XP from the block to the player based on the material of the blocks given if it matches the given skillType
* @param blockStates the blocks to reward XP for
* @param mcMMOPlayer the target player
* @param skillType target primary skill
*/
public static void addXpFromBlocksBySkill(ArrayList<BlockState> blockStates, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType)
{
for(BlockState bs : blockStates)
{
if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0)
{
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
}
/**
* Will add the appropriate type of XP from the block to the player based on the material of the blocks given
* @param blockState The target blockstate
* @param mcMMOPlayer The target player
*/
public static void addXpFromBlock(BlockState blockState, McMMOPlayer mcMMOPlayer)
{
for(PrimarySkillType skillType : PrimarySkillType.values())
{
if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0)
{
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
}
/**
* Will add the appropriate type of XP from the block to the player based on the material of the blocks given if it matches the given skillType
* @param blockState The target blockstate
* @param mcMMOPlayer The target player
* @param skillType target primary skill
*/
public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType)
{
if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0)
{
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
// Utility methods follow.
private static void addOfflineXP(UUID playerUniqueId, SkillType skill, int XP) {
private static void addOfflineXP(UUID playerUniqueId, PrimarySkillType skill, int XP) {
PlayerProfile profile = getOfflineProfile(playerUniqueId);
profile.addXp(skill, XP);
@@ -1023,7 +1089,7 @@ public final class ExperienceAPI {
}
@Deprecated
private static void addOfflineXP(String playerName, SkillType skill, int XP) {
private static void addOfflineXP(String playerName, PrimarySkillType skill, int XP) {
PlayerProfile profile = getOfflineProfile(playerName);
profile.addXp(skill, XP);
@@ -1052,8 +1118,8 @@ public final class ExperienceAPI {
return profile;
}
private static SkillType getSkillType(String skillType) throws InvalidSkillException {
SkillType skill = SkillType.getSkill(skillType);
private static PrimarySkillType getSkillType(String skillType) throws InvalidSkillException {
PrimarySkillType skill = PrimarySkillType.getSkill(skillType);
if (skill == null) {
throw new InvalidSkillException();
@@ -1062,8 +1128,8 @@ public final class ExperienceAPI {
return skill;
}
private static SkillType getNonChildSkillType(String skillType) throws InvalidSkillException, UnsupportedOperationException {
SkillType skill = getSkillType(skillType);
private static PrimarySkillType getNonChildSkillType(String skillType) throws InvalidSkillException, UnsupportedOperationException {
PrimarySkillType skill = getSkillType(skillType);
if (skill.isChildSkill()) {
throw new UnsupportedOperationException("Child skills do not have XP");
@@ -1092,6 +1158,13 @@ public final class ExperienceAPI {
return formulaType;
}
/**
* @deprecated Use UserManager::getPlayer(Player player) instead
* @param player target player
* @return McMMOPlayer for that player if the profile is loaded, otherwise null
* @throws McMMOPlayerNotFoundException
*/
@Deprecated
private static McMMOPlayer getPlayer(Player player) throws McMMOPlayerNotFoundException {
if (!UserManager.hasPlayerDataKey(player)) {
throw new McMMOPlayerNotFoundException(player);

View File

@@ -1,19 +1,17 @@
package com.gmail.nossr50.api;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.UUID;
import com.gmail.nossr50.config.Config;
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.NotificationManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyLeader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import java.util.*;
public final class PartyAPI {
private PartyAPI() {}
@@ -43,6 +41,9 @@ public final class PartyAPI {
* @return true if the player is in a party, false otherwise
*/
public static boolean inParty(Player player) {
if(UserManager.getPlayer(player) == null)
return false;
return UserManager.getPlayer(player).inParty();
}
@@ -77,8 +78,54 @@ public final class PartyAPI {
*
* @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(UserManager.getPlayer(player) == null)
return;
Party party = PartyManager.getParty(partyName);
if (party == null) {
party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName);
} else {
if(PartyManager.isPartyFull(player, party))
{
NotificationManager.sendPlayerInformation(player, NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull", party.toString());
return;
}
}
PartyManager.addToParty(UserManager.getPlayer(player), party);
}
/**
* The max party size of the server
* 0 or less for no size limit
* @return the max party size on this server
*/
public static int getMaxPartySize()
{
return Config.getInstance().getPartyMaxSize();
}
/**
* 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(UserManager.getPlayer(player) == null)
return;
Party party = PartyManager.getParty(partyName);
if (party == null) {
@@ -96,6 +143,10 @@ public final class PartyAPI {
* @param player The player to remove
*/
public static void removeFromParty(Player player) {
//Check if player profile is loaded
if(UserManager.getPlayer(player) == null)
return;
PartyManager.removeFromParty(UserManager.getPlayer(player));
}

View File

@@ -1,11 +1,11 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.gmail.nossr50.datatypes.skills.SkillType;
public final class SkillAPI {
private SkillAPI() {}
@@ -18,7 +18,7 @@ public final class SkillAPI {
* @return a list of strings with valid skill names
*/
public static List<String> getSkills() {
return getListFromEnum(Arrays.asList(SkillType.values()));
return getListFromEnum(Arrays.asList(PrimarySkillType.values()));
}
/**
@@ -30,7 +30,7 @@ public final class SkillAPI {
* @return a list of strings with valid skill names
*/
public static List<String> getNonChildSkills() {
return getListFromEnum(SkillType.NON_CHILD_SKILLS);
return getListFromEnum(PrimarySkillType.NON_CHILD_SKILLS);
}
/**
@@ -42,7 +42,7 @@ public final class SkillAPI {
* @return a list of strings with valid skill names
*/
public static List<String> getChildSkills() {
return getListFromEnum(SkillType.CHILD_SKILLS);
return getListFromEnum(PrimarySkillType.CHILD_SKILLS);
}
/**
@@ -54,7 +54,7 @@ public final class SkillAPI {
* @return a list of strings with valid skill names
*/
public static List<String> getCombatSkills() {
return getListFromEnum(SkillType.COMBAT_SKILLS);
return getListFromEnum(PrimarySkillType.COMBAT_SKILLS);
}
/**
@@ -66,7 +66,7 @@ public final class SkillAPI {
* @return a list of strings with valid skill names
*/
public static List<String> getGatheringSkills() {
return getListFromEnum(SkillType.GATHERING_SKILLS);
return getListFromEnum(PrimarySkillType.GATHERING_SKILLS);
}
/**
@@ -78,14 +78,14 @@ public final class SkillAPI {
* @return a list of strings with valid skill names
*/
public static List<String> getMiscSkills() {
return getListFromEnum(SkillType.MISC_SKILLS);
return getListFromEnum(PrimarySkillType.MISC_SKILLS);
}
private static List<String> getListFromEnum(List<SkillType> skillsTypes) {
private static List<String> getListFromEnum(List<PrimarySkillType> skillsTypes) {
List<String> skills = new ArrayList<String>();
for (SkillType skillType : skillsTypes) {
skills.add(skillType.name());
for (PrimarySkillType primarySkillType : skillsTypes) {
skills.add(primarySkillType.name());
}
return skills;

View File

@@ -6,6 +6,6 @@ public class McMMOPlayerNotFoundException extends RuntimeException {
private static final long serialVersionUID = 761917904993202836L;
public McMMOPlayerNotFoundException(Player player) {
super("McMMOPlayer object was not found for: " + player.getName() + " " + player.getUniqueId());
super("McMMOPlayer object was not found for [NOTE: This can mean the profile is not loaded yet!] : " + player.getName() + " " + player.getUniqueId());
}
}

View File

@@ -1,9 +1,8 @@
package com.gmail.nossr50.chat;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
import org.bukkit.plugin.Plugin;
public class AdminChatManager extends ChatManager {
protected AdminChatManager(Plugin plugin) {

View File

@@ -1,11 +1,14 @@
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.McMMOChatEvent;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.events.chat.McMMOChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
public abstract class ChatManager {
protected Plugin plugin;
protected boolean useDisplayNames;
@@ -33,6 +36,38 @@ public abstract class ChatManager {
message = LocaleLoader.formatString(chatPrefix, displayName) + " " + event.getMessage();
sendMessage();
/*
* Party Chat Spying
* Party messages will be copied to people with the mcmmo.admin.chatspy permission node
*/
if(event instanceof McMMOPartyChatEvent)
{
//We need to grab the party chat name
McMMOPartyChatEvent partyChatEvent = (McMMOPartyChatEvent) event;
//Find the people with permissions
for(McMMOPlayer mcMMOPlayer : UserManager.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.getName().equalsIgnoreCase(partyChatEvent.getParty()))
player.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Chat", partyChatEvent.getParty(), message));
} else {
player.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Chat", partyChatEvent.getParty(), message));
}
}
}
}
}
public void handleChat(String senderName, String message) {

View File

@@ -1,10 +1,9 @@
package com.gmail.nossr50.chat;
import java.util.HashMap;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import java.util.HashMap;
public class ChatManagerFactory {
private static final HashMap<Plugin, AdminChatManager> adminChatManagers = new HashMap<Plugin, AdminChatManager>();

View File

@@ -1,11 +1,10 @@
package com.gmail.nossr50.chat;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.runnables.party.PartyChatTask;
import org.bukkit.plugin.Plugin;
public class PartyChatManager extends ChatManager {
private Party party;

View File

@@ -1,70 +0,0 @@
package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public class KrakenCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
if (!Permissions.kraken(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
UserManager.getPlayer(sender.getName()).getFishingManager().unleashTheKraken();
return true;
case 1:
if (!Permissions.krakenOthers(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) {
return true;
}
mcMMOPlayer.getFishingManager().unleashTheKraken();
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 = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();
}
}
}

View File

@@ -0,0 +1,45 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.config.Config;
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.gmail.nossr50.util.player.UserManager;
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 MHDCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (mcMMO.getDatabaseManager() instanceof SQLDatabaseManager) {
SQLDatabaseManager m = (SQLDatabaseManager) mcMMO.getDatabaseManager();
m.resetMobHealthSettings();
for (McMMOPlayer player : UserManager.getPlayers()) {
player.getProfile().setMobHealthbarType(Config.getInstance().getMobHealthbarDefault());
}
sender.sendMessage("Mob health reset");
return true;
}
if (mcMMO.getDatabaseManager() instanceof FlatfileDatabaseManager) {
FlatfileDatabaseManager m = (FlatfileDatabaseManager) mcMMO.getDatabaseManager();
m.resetMobHealthSettings();
for (McMMOPlayer player : UserManager.getPlayers()) {
player.getProfile().setMobHealthbarType(Config.getInstance().getMobHealthbarDefault());
}
sender.sendMessage("Mob health reset");
return true;
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,23 +1,16 @@
package com.gmail.nossr50.commands;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import com.gmail.nossr50.datatypes.skills.ModConfigType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Misc;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.skills.ModConfigType;
import com.gmail.nossr50.util.Misc;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
public class McImportCommand implements CommandExecutor {
int fileAmount;

View File

@@ -1,10 +1,9 @@
package com.gmail.nossr50.commands;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.command.CommandSender;
public class McabilityCommand extends ToggleCommand {
@Override

View File

@@ -1,23 +1,21 @@
package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
import com.gmail.nossr50.database.DatabaseManagerFactory;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class McconvertCommand implements TabExecutor {
private static final List<String> FORMULA_TYPES;

View File

@@ -1,10 +1,9 @@
package com.gmail.nossr50.commands;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.command.CommandSender;
public class McgodCommand extends ToggleCommand {
@Override

View File

@@ -1,16 +1,15 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class McmmoCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@@ -27,7 +26,7 @@ public class McmmoCommand implements CommandExecutor {
if (Config.getInstance().getDonateMessageEnabled()) {
sender.sendMessage(LocaleLoader.getString("MOTD.Donate"));
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "tft_02@hotmail.com" + ChatColor.GOLD + " Paypal");
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "nossr50@gmail.com" + ChatColor.GOLD + " Paypal");
}
if (Permissions.showversion(sender)) {
@@ -71,6 +70,10 @@ public class McmmoCommand implements CommandExecutor {
}
private void displayOtherCommands(CommandSender sender) {
//Don't show them this category if they have none of the permissions
if(!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender))
return;
sender.sendMessage(LocaleLoader.getString("Commands.Other"));
if (Permissions.skillreset(sender)) {

View File

@@ -1,17 +1,15 @@
package com.gmail.nossr50.commands;
import java.util.List;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
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 com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.List;
public class McnotifyCommand implements TabExecutor {
@Override
@@ -20,6 +18,10 @@ public class McnotifyCommand implements TabExecutor {
case 0:
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
//Not Loaded yet
if(mcMMOPlayer == null)
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
mcMMOPlayer.toggleChatNotifications();
return true;

View File

@@ -1,10 +1,9 @@
package com.gmail.nossr50.commands;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.command.CommandSender;
public class McrefreshCommand extends ToggleCommand {
@Override

View File

@@ -1,19 +1,17 @@
package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
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 McscoreboardCommand implements TabExecutor {
private static final List<String> FIRST_ARGS = ImmutableList.of("keep", "time", "clear");
@@ -33,7 +31,7 @@ public class McscoreboardCommand implements TabExecutor {
}
if (args[0].equalsIgnoreCase("keep")) {
if (!Config.getInstance().getAllowKeepBoard()) {
if (!Config.getInstance().getAllowKeepBoard() || !Config.getInstance().getScoreboardsEnabled()) {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true;
}

View File

@@ -1,71 +0,0 @@
package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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 com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public class MobhealthCommand implements TabExecutor {
private static final List<String> MOB_HEALTHBAR_TYPES;
static {
ArrayList<String> types = new ArrayList<String>();
for (MobHealthbarType type : MobHealthbarType.values()) {
types.add(type.toString());
}
Collections.sort(types);
MOB_HEALTHBAR_TYPES = ImmutableList.copyOf(types);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) {
case 1:
try {
MobHealthbarType type = MobHealthbarType.valueOf(args[0].toUpperCase().trim());
UserManager.getPlayer((Player) sender).getProfile().setMobHealthbarType(type);
sender.sendMessage(LocaleLoader.getString("Commands.Healthbars.Changed." + type.name()));
return true;
}
catch (IllegalArgumentException ex) {
sender.sendMessage(LocaleLoader.getString("Commands.Healthbars.Invalid"));
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], MOB_HEALTHBAR_TYPES, new ArrayList<String>(MOB_HEALTHBAR_TYPES.size()));
default:
return ImmutableList.of();
}
}
}

View File

@@ -1,18 +1,16 @@
package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public abstract class ToggleCommand implements TabExecutor {
@Override

View File

@@ -1,21 +1,22 @@
package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.NotificationManager;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class XprateCommand implements TabExecutor {
private final double ORIGINAL_XP_RATE = ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier();
@@ -24,7 +25,7 @@ public class XprateCommand implements TabExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if (!args[0].equalsIgnoreCase("reset")) {
if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) {
return false;
}
@@ -34,7 +35,18 @@ public class XprateCommand implements TabExecutor {
}
if (mcMMO.p.isXPEventEnabled()) {
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.over"));
if(AdvancedConfig.getInstance().useTitlesForXPEvent())
{
NotificationManager.broadcastTitle(mcMMO.p.getServer(),
LocaleLoader.getString("Commands.Event.Stop"),
LocaleLoader.getString("Commands.Event.Stop.Subtitle"),
10, 10*20, 20);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop.Subtitle"));
mcMMO.p.toggleXpEventEnabled();
}
@@ -62,11 +74,25 @@ public class XprateCommand implements TabExecutor {
}
int newXpRate = Integer.parseInt(args[0]);
if(newXpRate < 0)
{
sender.sendMessage(ChatColor.RED+LocaleLoader.getString("Commands.NegativeNumberWarn"));
return true;
}
ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate);
if (mcMMO.p.isXPEventEnabled()) {
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.0"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.1", newXpRate));
if(AdvancedConfig.getInstance().useTitlesForXPEvent())
{
NotificationManager.broadcastTitle(mcMMO.p.getServer(),
LocaleLoader.getString("Commands.Event.Start"),
LocaleLoader.getString("Commands.Event.XP", newXpRate),
10, 10*20, 20);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate));
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate));

View File

@@ -1,8 +1,7 @@
package com.gmail.nossr50.commands.chat;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import org.bukkit.command.CommandSender;
public class AdminChatCommand extends ChatCommand {
public AdminChatCommand() {

View File

@@ -1,15 +1,5 @@
package com.gmail.nossr50.commands.chat;
import java.util.ArrayList;
import java.util.List;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.chat.ChatManager;
import com.gmail.nossr50.chat.ChatManagerFactory;
import com.gmail.nossr50.config.Config;
@@ -17,10 +7,18 @@ 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.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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;
@@ -57,14 +55,13 @@ public abstract class ChatCommand implements TabExecutor {
return true;
case 1:
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
if (CommandUtils.shouldEnableToggle(args[0])) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
enableChatMode(UserManager.getPlayer(sender.getName()), sender);
return true;
@@ -74,6 +71,9 @@ public abstract class ChatCommand implements TabExecutor {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
disableChatMode(UserManager.getPlayer(sender.getName()), sender);
return true;

View File

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

View File

@@ -1,8 +1,5 @@
package com.gmail.nossr50.commands.chat;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.chat.PartyChatManager;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.chat.ChatMode;
@@ -11,6 +8,8 @@ import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyChatCommand extends ChatCommand {
public PartyChatCommand() {
@@ -23,6 +22,10 @@ public class PartyChatCommand extends ChatCommand {
String message;
if (sender instanceof Player) {
//Check if player profile is loaded
if(UserManager.getPlayer((Player) sender) == null)
return;
party = UserManager.getPlayer((Player) sender).getParty();
if (party == null) {

View File

@@ -1,19 +1,18 @@
package com.gmail.nossr50.commands.database;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.database.DatabaseConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override

View File

@@ -1,16 +1,14 @@
package com.gmail.nossr50.commands.database;
import java.util.List;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.google.common.collect.ImmutableList;
import java.util.List;
public class McpurgeCommand implements TabExecutor {
@Override

View File

@@ -1,19 +1,17 @@
package com.gmail.nossr50.commands.database;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class McremoveCommand implements TabExecutor {
@Override

View File

@@ -1,16 +1,14 @@
package com.gmail.nossr50.commands.database;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.locale.LocaleLoader;
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 MmoshowdbCommand implements TabExecutor {
@Override

View File

@@ -1,14 +1,13 @@
package com.gmail.nossr50.commands.experience;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class AddlevelsCommand extends ExperienceCommand {
@Override
@@ -22,7 +21,7 @@ public class AddlevelsCommand extends ExperienceCommand {
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
float xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.addLevels(skill, value);
@@ -40,7 +39,7 @@ public class AddlevelsCommand extends ExperienceCommand {
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, SkillType skill) {
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, skill.getName()));
}
}

View File

@@ -1,14 +1,14 @@
package com.gmail.nossr50.commands.experience;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
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.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
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 {
@Override
@@ -22,9 +22,13 @@ public class AddxpCommand extends ExperienceCommand {
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
if (player != null) {
UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND);
//Check if player profile is loaded
if(UserManager.getPlayer(player) == null)
return;
UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND);
}
else {
profile.addXp(skill, value);
@@ -38,7 +42,7 @@ public class AddxpCommand extends ExperienceCommand {
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, SkillType skill) {
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, skill.getName()));
}
}

View File

@@ -1,17 +1,16 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.database.FormulaConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.database.FormulaConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.util.player.UserManager;
public class ConvertExperienceCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

View File

@@ -1,28 +1,28 @@
package com.gmail.nossr50.commands.experience;
import java.util.ArrayList;
import java.util.List;
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.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public abstract class ExperienceCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
SkillType skill;
PrimarySkillType skill;
switch (args.length) {
case 2:
@@ -39,12 +39,26 @@ public abstract class ExperienceCommand implements TabExecutor {
return true;
}
skill = SkillType.getSkill(args[0]);
skill = PrimarySkillType.getSkill(args[0]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
if (skill != null && skill.isChildSkill())
{
sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill"));
return true;
}
//Profile not loaded
if(UserManager.getPlayer(sender.getName()) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]));
return true;
@@ -58,12 +72,18 @@ public abstract class ExperienceCommand implements TabExecutor {
return true;
}
skill = SkillType.getSkill(args[1]);
skill = PrimarySkillType.getSkill(args[1]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
if (skill != null && skill.isChildSkill())
{
sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill"));
return true;
}
int value = Integer.parseInt(args[2]);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
@@ -71,7 +91,12 @@ public abstract class ExperienceCommand implements TabExecutor {
// 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 = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false);
UUID uuid = null;
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(playerName);
if (player != null) {
uuid = player.getUniqueId();
}
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, uuid, false);
if (CommandUtils.unloadedProfile(sender, profile)) {
return true;
@@ -98,7 +123,7 @@ public abstract class ExperienceCommand implements TabExecutor {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
return StringUtil.copyPartialMatches(args[1], PrimarySkillType.SKILL_NAMES, new ArrayList<String>(PrimarySkillType.SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
@@ -106,15 +131,15 @@ public abstract class ExperienceCommand implements TabExecutor {
protected abstract boolean permissionsCheckSelf(CommandSender sender);
protected abstract boolean permissionsCheckOthers(CommandSender sender);
protected abstract void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value);
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, SkillType skill);
protected abstract void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill);
private boolean validateArguments(CommandSender sender, String skillName, String value) {
return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName)));
}
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
if (skill == null) {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
}
@@ -123,10 +148,10 @@ public abstract class ExperienceCommand implements TabExecutor {
}
}
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, skillType, value);
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, primarySkillType, value);
}
if (player != null) {

View File

@@ -1,14 +1,13 @@
package com.gmail.nossr50.commands.experience;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class MmoeditCommand extends ExperienceCommand {
@Override
@@ -22,7 +21,7 @@ public class MmoeditCommand extends ExperienceCommand {
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
int skillLevel = profile.getSkillLevel(skill);
float xpRemoved = profile.getSkillXpLevelRaw(skill);
@@ -37,7 +36,7 @@ public class MmoeditCommand extends ExperienceCommand {
return;
}
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND);
EventUtils.handleLevelChangeEventEdit(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND, skillLevel);
}
@Override
@@ -46,7 +45,7 @@ public class MmoeditCommand extends ExperienceCommand {
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, SkillType skill) {
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", skill.getName(), value));
}
}

View File

@@ -1,26 +1,26 @@
package com.gmail.nossr50.commands.experience;
import java.util.ArrayList;
import java.util.List;
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.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* This class mirrors the structure of ExperienceCommand, except the
@@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableList;
public class SkillresetCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
PrimarySkillType skill;
switch (args.length) {
case 1:
if (CommandUtils.noConsoleUsage(sender)) {
@@ -44,7 +45,14 @@ public class SkillresetCommand implements TabExecutor {
return true;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]));
if (args[0].equalsIgnoreCase("all")) {
skill = null;
}
else {
skill = PrimarySkillType.getSkill(args[1]);
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill);
return true;
case 2:
@@ -57,12 +65,11 @@ public class SkillresetCommand implements TabExecutor {
return true;
}
SkillType skill;
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
else {
skill = SkillType.getSkill(args[1]);
skill = PrimarySkillType.getSkill(args[1]);
}
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
@@ -70,7 +77,12 @@ public class SkillresetCommand implements TabExecutor {
// 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 = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false);
UUID uuid = null;
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(playerName);
if (player != null) {
uuid = player.getUniqueId();
}
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, uuid, false);
if (CommandUtils.unloadedProfile(sender, profile)) {
return true;
@@ -97,13 +109,13 @@ public class SkillresetCommand implements TabExecutor {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
return StringUtil.copyPartialMatches(args[1], PrimarySkillType.SKILL_NAMES, new ArrayList<String>(PrimarySkillType.SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill) {
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill) {
int levelsRemoved = profile.getSkillLevel(skill);
float xpRemoved = profile.getSkillXpLevelRaw(skill);
@@ -129,15 +141,15 @@ public class SkillresetCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Commands.Reset.All"));
}
protected void handlePlayerMessageSkill(Player player, SkillType skill) {
protected void handlePlayerMessageSkill(Player player, PrimarySkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
}
private boolean validateArguments(CommandSender sender, String skillName) {
return !(CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all"));
return skillName.equalsIgnoreCase("all") || !CommandUtils.isInvalidSkill(sender, skillName);
}
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
if (skill == null) {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
}
@@ -146,10 +158,10 @@ public class SkillresetCommand implements TabExecutor {
}
}
protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, skillType);
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, primarySkillType);
}
if (player != null) {

View File

@@ -1,12 +1,11 @@
package com.gmail.nossr50.commands.hardcore;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SkillType;
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 org.bukkit.command.CommandSender;
public class HardcoreCommand extends HardcoreModeCommand {
@Override
@@ -20,10 +19,10 @@ public class HardcoreCommand extends HardcoreModeCommand {
}
@Override
protected boolean checkEnabled(SkillType skill) {
protected boolean checkEnabled(PrimarySkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.values()) {
if (!skillType.getHardcoreStatLossEnabled()) {
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
if (!primarySkillType.getHardcoreStatLossEnabled()) {
return false;
}
}
@@ -35,12 +34,12 @@ public class HardcoreCommand extends HardcoreModeCommand {
}
@Override
protected void enable(SkillType skill) {
protected void enable(PrimarySkillType skill) {
toggle(true, skill);
}
@Override
protected void disable(SkillType skill) {
protected void disable(PrimarySkillType skill) {
toggle(false, skill);
}
@@ -50,10 +49,10 @@ public class HardcoreCommand extends HardcoreModeCommand {
sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
}
private void toggle(boolean enable, SkillType skill) {
private void toggle(boolean enable, PrimarySkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
skillType.setHardcoreStatLossEnabled(enable);
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
primarySkillType.setHardcoreStatLossEnabled(enable);
}
}
else {

View File

@@ -1,20 +1,18 @@
package com.gmail.nossr50.commands.hardcore;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
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 com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.google.common.collect.ImmutableList;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
public abstract class HardcoreModeCommand implements TabExecutor {
protected final DecimalFormat percent = new DecimalFormat("##0.00%");
@@ -76,7 +74,7 @@ public abstract class HardcoreModeCommand implements TabExecutor {
return true;
}
SkillType skill = SkillType.getSkill(args[0]);
PrimarySkillType skill = PrimarySkillType.getSkill(args[0]);
if (!CommandUtils.isChildSkill(sender, skill)) {
return true;
@@ -125,8 +123,8 @@ public abstract class HardcoreModeCommand implements TabExecutor {
protected abstract boolean checkTogglePermissions(CommandSender sender);
protected abstract boolean checkModifyPermissions(CommandSender sender);
protected abstract boolean checkEnabled(SkillType skill);
protected abstract void enable(SkillType skill);
protected abstract void disable(SkillType skill);
protected abstract boolean checkEnabled(PrimarySkillType skill);
protected abstract void enable(PrimarySkillType skill);
protected abstract void disable(PrimarySkillType skill);
protected abstract void modify(CommandSender sender, double newPercentage);
}

View File

@@ -1,12 +1,11 @@
package com.gmail.nossr50.commands.hardcore;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SkillType;
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 org.bukkit.command.CommandSender;
public class VampirismCommand extends HardcoreModeCommand {
@Override
@@ -20,10 +19,10 @@ public class VampirismCommand extends HardcoreModeCommand {
}
@Override
protected boolean checkEnabled(SkillType skill) {
protected boolean checkEnabled(PrimarySkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.values()) {
if (!skillType.getHardcoreVampirismEnabled()) {
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
if (!primarySkillType.getHardcoreVampirismEnabled()) {
return false;
}
}
@@ -35,12 +34,12 @@ public class VampirismCommand extends HardcoreModeCommand {
}
@Override
protected void enable(SkillType skill) {
protected void enable(PrimarySkillType skill) {
toggle(true, skill);
}
@Override
protected void disable(SkillType skill) {
protected void disable(PrimarySkillType skill) {
toggle(false, skill);
}
@@ -50,10 +49,10 @@ public class VampirismCommand extends HardcoreModeCommand {
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
}
private void toggle(boolean enable, SkillType skill) {
private void toggle(boolean enable, PrimarySkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
skillType.setHardcoreVampirismEnabled(enable);
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
primarySkillType.setHardcoreVampirismEnabled(enable);
}
}
else {

View File

@@ -1,14 +1,13 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -16,8 +15,17 @@ public class PartyAcceptCommand implements CommandExecutor {
switch (args.length) {
case 1:
Player player = (Player) sender;
//Check if player profile is loaded
if(UserManager.getPlayer(player) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (!mcMMOPlayer.hasPartyInvite()) {
sender.sendMessage(LocaleLoader.getString("mcMMO.NoInvites"));
return true;

View File

@@ -1,23 +1,29 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
public class PartyChangeOwnerCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
//Check if player profile is loaded
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);

View File

@@ -1,17 +1,22 @@
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 org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
public class PartyChangePasswordCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Party party = UserManager.getPlayer((Player) sender).getParty();
switch (args.length) {

View File

@@ -1,17 +1,5 @@
package com.gmail.nossr50.commands.party;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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 com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
@@ -21,8 +9,18 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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;
public class PartyCommand implements TabExecutor {
private static final List<String> PARTY_SUBCOMMANDS;
@@ -76,6 +74,12 @@ public class PartyCommand implements TabExecutor {
return true;
}
if(UserManager.getPlayer(player) == null)
{
player.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (args.length < 1) {
@@ -199,6 +203,14 @@ public class PartyCommand implements TabExecutor {
if (matches.size() == 0) {
Player player = (Player) sender;
//Not Loaded
if(UserManager.getPlayer(player) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return ImmutableList.of();
}
Party party = UserManager.getPlayer(player).getParty();
playerNames = party.getOnlinePlayerNames(player);

View File

@@ -1,14 +1,13 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -19,6 +18,12 @@ public class PartyCreateCommand implements CommandExecutor {
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if(UserManager.getPlayer(player) == null)
{
player.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
// Check to see if the party exists, and if it does cancel creating a new party
if (PartyManager.checkPartyExistence(player, args[1])) {
return true;

View File

@@ -1,21 +1,26 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String partyName = playerParty.getName();

View File

@@ -1,11 +1,10 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.locale.LocaleLoader;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.locale.LocaleLoader;
public class PartyHelpCommand implements CommandExecutor {
@Override

View File

@@ -1,14 +1,5 @@
package com.gmail.nossr50.commands.party;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
@@ -17,6 +8,14 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -24,6 +23,11 @@ public class PartyInfoCommand implements CommandExecutor {
switch (args.length) {
case 0:
case 1:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
Party party = mcMMOPlayer.getParty();
@@ -116,11 +120,15 @@ public class PartyInfoCommand implements CommandExecutor {
}
private void displayMemberInfo(Player player, McMMOPlayer mcMMOPlayer, Party party) {
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
int membersOnline = party.getOnlineMembers().size() - 1;
/*
* Only show members of the party that this member can see
*/
List<Player> nearMembers = PartyManager.getNearVisibleMembers(mcMMOPlayer);
int membersOnline = party.getVisibleMembers(player).size();
player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header"));
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size(), membersOnline));
player.sendMessage(party.createMembersList(player.getName(), nearMembers));
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size()+1, membersOnline));
player.sendMessage(party.createMembersList(player));
}
}

View File

@@ -1,16 +1,16 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -25,6 +25,13 @@ public class PartyInviteCommand implements CommandExecutor {
}
Player target = mcMMOTarget.getPlayer();
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
String playerName = player.getName();
@@ -45,6 +52,13 @@ public class PartyInviteCommand implements CommandExecutor {
}
Party playerParty = mcMMOPlayer.getParty();
if(PartyManager.isPartyFull(target, playerParty))
{
player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), Config.getInstance().getPartyMaxSize()));
return true;
}
mcMMOTarget.setPartyInvite(playerParty);
sender.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));

View File

@@ -1,10 +1,5 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.ItemShareType;
import com.gmail.nossr50.datatypes.party.Party;
@@ -14,10 +9,20 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyItemShareCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Party party = UserManager.getPlayer((Player) sender).getParty();
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) {

View File

@@ -1,16 +1,15 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -33,6 +32,13 @@ public class PartyJoinCommand implements CommandExecutor {
}
Player player = (Player) sender;
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
Party targetParty = mcMMOTarget.getParty();
@@ -55,6 +61,12 @@ public class PartyJoinCommand implements CommandExecutor {
return true;
}
if(PartyManager.isPartyFull(player, targetParty))
{
player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull", targetParty.toString()));
return true;
}
player.sendMessage(LocaleLoader.getString("Commands.Party.Join", partyName));
PartyManager.addToParty(mcMMOPlayer, targetParty);
return true;

View File

@@ -1,24 +1,29 @@
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.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
public class PartyKickCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = CommandUtils.getMatchedPlayerName(args[1]);

View File

@@ -1,15 +1,14 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -55,6 +54,12 @@ public class PartyLockCommand implements CommandExecutor {
}
private void togglePartyLock(CommandSender sender, boolean lock) {
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return;
}
Party party = UserManager.getPlayer((Player) sender).getParty();
if (!Permissions.partySubcommand(sender, lock ? PartySubcommandType.LOCK : PartySubcommandType.UNLOCK)) {

View File

@@ -1,16 +1,15 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
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.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -18,6 +17,13 @@ public class PartyQuitCommand implements CommandExecutor {
switch (args.length) {
case 1:
Player player = (Player) sender;
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
Party playerParty = mcMMOPlayer.getParty();

View File

@@ -1,22 +1,27 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
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.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
Party playerParty = mcMMOPlayer.getParty();

View File

@@ -1,10 +1,5 @@
package com.gmail.nossr50.commands.party;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
@@ -13,10 +8,20 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Party party = UserManager.getPlayer((Player) sender).getParty();
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.XP_SHARE)) {

View File

@@ -1,20 +1,24 @@
package com.gmail.nossr50.commands.party.alliance;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);

View File

@@ -1,16 +1,5 @@
package com.gmail.nossr50.commands.party.alliance;
import java.util.ArrayList;
import java.util.List;
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 com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
@@ -19,8 +8,17 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 Player player;
@@ -39,6 +37,12 @@ public class PartyAllianceCommand implements TabExecutor {
return true;
}
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
@@ -128,8 +132,8 @@ public class PartyAllianceCommand implements TabExecutor {
private void displayMemberInfo(McMMOPlayer mcMMOPlayer) {
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Members.Header"));
player.sendMessage(playerParty.createMembersList(player.getName(), nearMembers));
player.sendMessage(playerParty.createMembersList(player));
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");
player.sendMessage(targetParty.createMembersList(player.getName(), nearMembers));
player.sendMessage(targetParty.createMembersList(player));
}
}

View File

@@ -1,21 +1,25 @@
package com.gmail.nossr50.commands.party.alliance;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
Party party = mcMMOPlayer.getParty();

View File

@@ -1,16 +1,15 @@
package com.gmail.nossr50.commands.party.alliance;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
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 {
@Override
@@ -25,6 +24,13 @@ public class PartyAllianceInviteCommand implements CommandExecutor {
}
Player target = mcMMOTarget.getPlayer();
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
String playerName = player.getName();

View File

@@ -1,13 +1,12 @@
package com.gmail.nossr50.commands.party.teleport;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class PtpAcceptAnyCommand implements CommandExecutor {
@Override

View File

@@ -1,17 +1,16 @@
package com.gmail.nossr50.commands.party.teleport;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillUtils;
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 {
@Override
@@ -21,6 +20,12 @@ public class PtpAcceptCommand implements CommandExecutor {
return true;
}
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
PartyTeleportRecord ptpRecord = UserManager.getPlayer(player).getPartyTeleportRecord();

View File

@@ -1,22 +1,13 @@
package com.gmail.nossr50.commands.party.teleport;
import java.util.ArrayList;
import java.util.List;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.WorldBlacklist;
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.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.runnables.items.TeleportationWarmup;
import com.gmail.nossr50.util.EventUtils;
@@ -25,8 +16,18 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.worldguard.WorldGuardManager;
import com.gmail.nossr50.worldguard.WorldGuardUtils;
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.List;
public class PtpCommand implements TabExecutor {
public static final List<String> TELEPORT_SUBCOMMANDS = ImmutableList.of("toggle", "accept", "acceptany", "acceptall");
@@ -43,10 +44,27 @@ public class PtpCommand implements TabExecutor {
Player player = (Player) sender;
/* WORLD GUARD MAIN FLAG CHECK */
if(WorldGuardUtils.isWorldGuardLoaded())
{
if(!WorldGuardManager.getInstance().hasMainFlag(player))
return true;
}
/* WORLD BLACKLIST CHECK */
if(WorldBlacklist.isWorldBlacklisted(player.getWorld()))
return true;
if (!UserManager.hasPlayerDataKey(player)) {
return true;
}
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (!mcMMOPlayer.inParty()) {
@@ -119,6 +137,12 @@ public class PtpCommand implements TabExecutor {
List<String> matches = StringUtil.copyPartialMatches(args[0], TELEPORT_SUBCOMMANDS, new ArrayList<String>(TELEPORT_SUBCOMMANDS.size()));
if (matches.size() == 0) {
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return ImmutableList.of();
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
@@ -193,6 +217,18 @@ public class PtpCommand implements TabExecutor {
}
protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) {
if(UserManager.getPlayer(targetPlayer) == null)
{
targetPlayer.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return;
}
if(UserManager.getPlayer(teleportingPlayer) == null)
{
teleportingPlayer.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer);
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer);

View File

@@ -1,13 +1,12 @@
package com.gmail.nossr50.commands.party.teleport;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class PtpToggleCommand implements CommandExecutor {
@Override

View File

@@ -1,26 +1,24 @@
package com.gmail.nossr50.commands.player;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.Config;
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.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
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 com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class InspectCommand implements TabExecutor {
@Override
@@ -42,7 +40,7 @@ public class InspectCommand implements TabExecutor {
return true;
}
if (sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
if (Config.getInstance().getScoreboardsEnabled() && sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, profile);
if (!Config.getInstance().getInspectUseChat()) {
@@ -53,17 +51,17 @@ public class InspectCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName));
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
for (SkillType skill : SkillType.GATHERING_SKILLS) {
for (PrimarySkillType skill : PrimarySkillType.GATHERING_SKILLS) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
}
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
for (SkillType skill : SkillType.COMBAT_SKILLS) {
for (PrimarySkillType skill : PrimarySkillType.COMBAT_SKILLS) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
}
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
for (SkillType skill : SkillType.MISC_SKILLS) {
for (PrimarySkillType skill : PrimarySkillType.MISC_SKILLS) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
}
@@ -81,7 +79,7 @@ public class InspectCommand implements TabExecutor {
return true;
}
if (sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
if (Config.getInstance().getScoreboardsEnabled() && sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile());
if (!Config.getInstance().getInspectUseChat()) {

View File

@@ -1,21 +1,19 @@
package com.gmail.nossr50.commands.player;
import java.util.List;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
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 com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.google.common.collect.ImmutableList;
import java.util.List;
public class MccooldownCommand implements TabExecutor {
@Override
@@ -32,7 +30,7 @@ public class MccooldownCommand implements TabExecutor {
case 0:
Player player = (Player) sender;
if (Config.getInstance().getCooldownUseBoard()) {
if (Config.getInstance().getScoreboardsEnabled() && Config.getInstance().getCooldownUseBoard()) {
ScoreboardManager.enablePlayerCooldownScoreboard(player);
if (!Config.getInstance().getCooldownUseChat()) {
@@ -40,12 +38,18 @@ public class MccooldownCommand implements TabExecutor {
}
}
if(UserManager.getPlayer(player) == null)
{
player.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
for (AbilityType ability : AbilityType.values()) {
for (SuperAbilityType ability : SuperAbilityType.values()) {
if (!ability.getPermissions(player)) {
continue;
}

View File

@@ -1,8 +1,14 @@
package com.gmail.nossr50.commands.player;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
@@ -10,16 +16,8 @@ import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class McrankCommand implements TabExecutor {
@Override
@@ -90,10 +88,17 @@ public class McrankCommand implements TabExecutor {
private void display(CommandSender sender, String playerName) {
if (sender instanceof Player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
if(mcMMOPlayer == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return;
}
long cooldownMillis = Math.min(Config.getInstance().getDatabasePlayerCooldown(), 1750);
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
sender.sendMessage(LocaleLoader.getString("Commands.Database.CooldownMS", getCDSeconds(mcMMOPlayer, cooldownMillis)));
return;
}
@@ -107,9 +112,13 @@ public class McrankCommand implements TabExecutor {
mcMMOPlayer.actualizeDatabaseATS();
}
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getRankUseBoard());
boolean useBoard = Config.getInstance().getScoreboardsEnabled() && (sender instanceof Player) && (Config.getInstance().getRankUseBoard());
boolean useChat = !useBoard || Config.getInstance().getRankUseChat();
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
}
private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) {
return ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis());
}
}

View File

@@ -1,19 +1,17 @@
package com.gmail.nossr50.commands.player;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
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 McstatsCommand implements TabExecutor {
@Override
@@ -28,9 +26,15 @@ public class McstatsCommand implements TabExecutor {
switch (args.length) {
case 0:
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
if (Config.getInstance().getStatsUseBoard()) {
if (Config.getInstance().getStatsUseBoard() && Config.getInstance().getScoreboardsEnabled()) {
ScoreboardManager.enablePlayerStatsScoreboard(player);
if (!Config.getInstance().getStatsUseChat()) {

View File

@@ -1,8 +1,16 @@
package com.gmail.nossr50.commands.player;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
@@ -10,22 +18,13 @@ import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class MctopCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
SkillType skill = null;
PrimarySkillType skill = null;
switch (args.length) {
case 0:
@@ -70,13 +69,13 @@ public class MctopCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
return StringUtil.copyPartialMatches(args[0], PrimarySkillType.SKILL_NAMES, new ArrayList<String>(PrimarySkillType.SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
private void display(int page, SkillType skill, CommandSender sender, Command command) {
private void display(int page, PrimarySkillType skill, CommandSender sender, Command command) {
if (skill != null && !Permissions.mctop(sender, skill)) {
sender.sendMessage(command.getPermissionMessage());
return;
@@ -91,7 +90,12 @@ public class MctopCommand implements TabExecutor {
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000;
if (seconds < 1) {
seconds = 1;
}
sender.sendMessage(LocaleLoader.formatString(LocaleLoader.getString("Commands.Database.Cooldown"), seconds));
return;
}
@@ -108,19 +112,19 @@ public class MctopCommand implements TabExecutor {
display(page, skill, sender);
}
private void display(int page, SkillType skill, CommandSender sender) {
private void display(int page, PrimarySkillType skill, CommandSender sender) {
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getTopUseBoard());
boolean useChat = !useBoard || Config.getInstance().getTopUseChat();
new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
}
private SkillType extractSkill(CommandSender sender, String skillName) {
private PrimarySkillType extractSkill(CommandSender sender, String skillName) {
if (CommandUtils.isInvalidSkill(sender, skillName)) {
return null;
}
SkillType skill = SkillType.getSkill(skillName);
PrimarySkillType skill = PrimarySkillType.getSkill(skillName);
if (CommandUtils.isChildSkill(sender, skill)) {
return null;

View File

@@ -0,0 +1,15 @@
package com.gmail.nossr50.commands.server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
/**
* This command facilitates switching the skill system scale between classic and modern scale
*/
public class Mcmmoupgrade implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return false;
}
}

View File

@@ -1,97 +1,99 @@
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.locale.LocaleLoader;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.random.RandomChanceSkill;
import com.gmail.nossr50.util.random.RandomChanceUtil;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class AcrobaticsCommand extends SkillCommand {
private String dodgeChance;
private String dodgeChanceLucky;
private String rollChance;
private String rollChanceLucky;
private String gracefulRollChance;
private String gracefulRollChanceLucky;
private boolean canDodge;
private boolean canRoll;
private boolean canGracefulRoll;
public AcrobaticsCommand() {
super(SkillType.ACROBATICS);
super(PrimarySkillType.ACROBATICS);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// DODGE
protected void dataCalculations(Player player, float skillValue) {
// ACROBATICS_DODGE
if (canDodge) {
String[] dodgeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DODGE, isLucky);
String[] dodgeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_DODGE);
dodgeChance = dodgeStrings[0];
dodgeChanceLucky = dodgeStrings[1];
}
// ROLL
if (canRoll) {
String[] rollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.ROLL, isLucky);
rollChance = rollStrings[0];
rollChanceLucky = rollStrings[1];
}
// GRACEFUL ROLL
if (canGracefulRoll) {
String[] gracefulRollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GRACEFUL_ROLL, isLucky);
gracefulRollChance = gracefulRollStrings[0];
gracefulRollChanceLucky = gracefulRollStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canDodge = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DODGE);
canRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ROLL);
canGracefulRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GRACEFUL_ROLL);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canRoll) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1")));
}
if (canGracefulRoll) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.2"), LocaleLoader.getString("Acrobatics.Effect.3")));
}
if (canDodge) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.4"), LocaleLoader.getString("Acrobatics.Effect.5")));
}
return messages;
canDodge = canUseSubskill(player, SubSkillType.ACROBATICS_DODGE);
canRoll = canUseSubskill(player, SubSkillType.ACROBATICS_ROLL);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canRoll) {
messages.add(LocaleLoader.getString("Acrobatics.Roll.Chance", rollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : ""));
}
if (canGracefulRoll) {
messages.add(LocaleLoader.getString("Acrobatics.Roll.GraceChance", gracefulRollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", gracefulRollChanceLucky) : ""));
}
if (canDodge) {
messages.add(LocaleLoader.getString("Acrobatics.DodgeChance", dodgeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance)
+ (isLucky ? LocaleLoader.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(player, SubSkillType.ACROBATICS_ROLL);
//Chance to graceful roll
RandomChanceSkill grace_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL);
grace_rcs.setSkillLevel(grace_rcs.getSkillLevel() * 2); //Double Odds
//Chance Stat Calculations
rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs);
graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs);
//damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
String rollStrings[] = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL);
//Format
double rollChanceLucky = rollChance * 1.333D;
double graceChanceLucky = graceChance * 1.333D;
messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0])
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollStrings[1]) : ""));
/*messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, String.valueOf(graceChance))
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", String.valueOf(graceChanceLucky)) : ""));*/
}
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ACROBATICS);
return textComponents;
}
}

View File

@@ -1,19 +1,19 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.alchemy.Alchemy.Tier;
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
public class AlchemyCommand extends SkillCommand {
private String brewSpeed;
private String brewSpeedLucky;
@@ -26,13 +26,22 @@ public class AlchemyCommand extends SkillCommand {
private boolean canConcoctions;
public AlchemyCommand() {
super(SkillType.ALCHEMY);
super(PrimarySkillType.ALCHEMY);
}
protected String[] calculateAbilityDisplayValues(Player player, boolean isLucky) {
protected String[] calculateAbilityDisplayValues(Player player) {
//TODO: Needed?
if(UserManager.getPlayer(player) == null)
{
player.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return new String[] {"DATA NOT LOADED", "DATA NOT LOADED"};
}
AlchemyManager alchemyManager = UserManager.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;
@@ -40,15 +49,15 @@ public class AlchemyCommand extends SkillCommand {
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// CATALYSIS
protected void dataCalculations(Player player, float skillValue) {
// ALCHEMY_CATALYSIS
if (canCatalysis) {
String[] catalysisStrings = calculateAbilityDisplayValues(player, isLucky);
String[] catalysisStrings = calculateAbilityDisplayValues(player);
brewSpeed = catalysisStrings[0];
brewSpeedLucky = catalysisStrings[1];
}
// CONCOCTIONS
// ALCHEMY_CONCOCTIONS
if (canConcoctions) {
AlchemyManager alchemyManager = UserManager.getPlayer(player).getAlchemyManager();
tier = alchemyManager.getTier();
@@ -59,23 +68,8 @@ public class AlchemyCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canCatalysis = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CATALYSIS);
canConcoctions = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CONCOCTIONS);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canCatalysis) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Alchemy.Effect.0"), LocaleLoader.getString("Alchemy.Effect.1")));
}
if (canConcoctions) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Alchemy.Effect.2"), LocaleLoader.getString("Alchemy.Effect.3")));
}
return messages;
canCatalysis = canUseSubskill(player, SubSkillType.ALCHEMY_CATALYSIS);
canConcoctions = canUseSubskill(player, SubSkillType.ALCHEMY_CONCOCTIONS);
}
@Override
@@ -83,21 +77,27 @@ public class AlchemyCommand extends SkillCommand {
List<String> messages = new ArrayList<String>();
if (canCatalysis) {
int unlockLevel = AdvancedConfig.getInstance().getCatalysisUnlockLevel();
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Alchemy.Ability.Locked.0", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Alchemy.Catalysis.Speed", brewSpeed) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", brewSpeedLucky) : ""));
}
messages.add(getStatMessage(SubSkillType.ALCHEMY_CATALYSIS, brewSpeed)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", brewSpeedLucky) : ""));
}
if (canConcoctions) {
messages.add(LocaleLoader.getString("Alchemy.Concoctions.Rank", tier, Tier.values().length));
messages.add(LocaleLoader.getString("Alchemy.Concoctions.Ingredients", ingredientCount, ingredientList));
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(LocaleLoader.getString("Alchemy.Concoctions.Rank", tier, RankUtils.getHighestRank(SubSkillType.ALCHEMY_CONCOCTIONS)));
//messages.add(LocaleLoader.getString("Alchemy.Concoctions.Ingredients", ingredientCount, ingredientList));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ALCHEMY);
return textComponents;
}
}

View File

@@ -1,21 +1,19 @@
package com.gmail.nossr50.commands.skills;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.HolidayManager.FakeSkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
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.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
public class AprilCommand implements TabExecutor {
private String skillName;

View File

@@ -1,16 +1,18 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.util.Permissions;
public class ArcheryCommand extends SkillCommand {
private String skillShotBonus;
private String dazeChance;
@@ -23,74 +25,70 @@ public class ArcheryCommand extends SkillCommand {
private boolean canRetrieve;
public ArcheryCommand() {
super(SkillType.ARCHERY);
super(PrimarySkillType.ARCHERY);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// SKILL SHOT
if (canSkillShot) {
double bonus = (skillValue / Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage;
skillShotBonus = percent.format(Math.min(bonus, Archery.skillShotMaxBonusPercentage));
protected void dataCalculations(Player player, float skillValue) {
// ARCHERY_ARROW_RETRIEVAL
if (canRetrieve) {
String[] retrieveStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
retrieveChance = retrieveStrings[0];
retrieveChanceLucky = retrieveStrings[1];
}
// DAZE
// ARCHERY_DAZE
if (canDaze) {
String[] dazeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DAZE, isLucky);
String[] dazeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_DAZE);
dazeChance = dazeStrings[0];
dazeChanceLucky = dazeStrings[1];
}
// RETRIEVE
if (canRetrieve) {
String[] retrieveStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.RETRIEVE, isLucky);
retrieveChance = retrieveStrings[0];
retrieveChanceLucky = retrieveStrings[1];
// SKILL SHOT
if (canSkillShot) {
skillShotBonus = percent.format(Archery.getDamageBonusPercent(player));
}
}
@Override
protected void permissionsCheck(Player player) {
canSkillShot = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SKILL_SHOT);
canDaze = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DAZE);
canRetrieve = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.RETRIEVE);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canSkillShot) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Archery.Effect.0"), LocaleLoader.getString("Archery.Effect.1")));
}
if (canDaze) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Archery.Effect.2"), LocaleLoader.getString("Archery.Effect.3", Archery.dazeBonusDamage)));
}
if (canRetrieve) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Archery.Effect.4"), LocaleLoader.getString("Archery.Effect.5")));
}
return messages;
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, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canSkillShot) {
messages.add(LocaleLoader.getString("Archery.Combat.SkillshotBonus", skillShotBonus));
}
if (canDaze) {
messages.add(LocaleLoader.getString("Archery.Combat.DazeChance", dazeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : ""));
}
if (canRetrieve) {
messages.add(LocaleLoader.getString("Archery.Combat.RetrieveChance", retrieveChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.ARCHERY_ARROW_RETRIEVAL, retrieveChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : ""));
}
if (canDaze) {
messages.add(getStatMessage(SubSkillType.ARCHERY_DAZE, dazeChance)
+ (isLucky ? LocaleLoader.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(CombatUtils.getLimitBreakDamage(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ARCHERY);
return textComponents;
}
}

View File

@@ -1,15 +1,20 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.axes.Axes;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
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;
@@ -26,96 +31,85 @@ public class AxesCommand extends SkillCommand {
private boolean canGreaterImpact;
public AxesCommand() {
super(SkillType.AXES);
super(PrimarySkillType.AXES);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// ARMOR IMPACT
if (canImpact) {
impactDamage = 1 + (skillValue / Axes.impactIncreaseLevel);
impactDamage = UserManager.getPlayer(player).getAxesManager().getImpactDurabilityDamage();
}
// AXE MASTERY
if (canAxeMastery) {
axeMasteryDamage = Axes.getAxeMasteryBonusDamage(player);
}
// CRITICAL HIT
if (canCritical) {
String[] criticalHitStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.AXES_CRITICAL_STRIKES);
critChance = criticalHitStrings[0];
critChanceLucky = criticalHitStrings[1];
}
// SKULL SPLITTER
if (canSkullSplitter) {
String[] skullSplitterStrings = calculateLengthDisplayValues(player, skillValue);
skullSplitterLength = skullSplitterStrings[0];
skullSplitterLengthEndurance = skullSplitterStrings[1];
}
// CRITICAL HIT
if (canCritical) {
String[] criticalHitStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.CRITICAL_HIT, isLucky);
critChance = criticalHitStrings[0];
critChanceLucky = criticalHitStrings[1];
}
// AXE MASTERY
if (canAxeMastery) {
axeMasteryDamage = Math.min(skillValue / (Axes.axeMasteryMaxBonusLevel / Axes.axeMasteryMaxBonus), Axes.axeMasteryMaxBonus);
}
}
@Override
protected void permissionsCheck(Player player) {
canSkullSplitter = Permissions.skullSplitter(player);
canCritical = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CRITICAL_HIT);
canAxeMastery = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.AXE_MASTERY);
canImpact = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ARMOR_IMPACT);
canGreaterImpact = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GREATER_IMPACT);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canSkullSplitter) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.0"), LocaleLoader.getString("Axes.Effect.1")));
}
if (canCritical) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.2"), LocaleLoader.getString("Axes.Effect.3")));
}
if (canAxeMastery) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.4"), LocaleLoader.getString("Axes.Effect.5")));
}
if (canImpact) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.6"), LocaleLoader.getString("Axes.Effect.7")));
}
if (canGreaterImpact) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.8"), LocaleLoader.getString("Axes.Effect.9")));
}
return messages;
canSkullSplitter = Permissions.skullSplitter(player) && RankUtils.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, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canImpact) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.2"), LocaleLoader.getString("Axes.Ability.Bonus.3", impactDamage)));
}
if (canAxeMastery) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", axeMasteryDamage)));
}
if (canImpact) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.2"), LocaleLoader.getString("Axes.Ability.Bonus.3", impactDamage)));
if (canCritical) {
messages.add(getStatMessage(SubSkillType.AXES_CRITICAL_STRIKES, critChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", critChanceLucky) : ""));
}
if (canGreaterImpact) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.4"), LocaleLoader.getString("Axes.Ability.Bonus.5", Axes.greaterImpactBonusDamage)));
}
if (canCritical) {
messages.add(LocaleLoader.getString("Axes.Combat.CritChance", critChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", critChanceLucky) : ""));
if (canSkullSplitter) {
messages.add(getStatMessage(SubSkillType.AXES_SKULL_SPLITTER, skullSplitterLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", skullSplitterLengthEndurance) : ""));
}
if (canSkullSplitter) {
messages.add(LocaleLoader.getString("Axes.Combat.SS.Length", skullSplitterLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", skullSplitterLengthEndurance) : ""));
if(canUseSubskill(player, SubSkillType.AXES_AXES_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.AXES_AXES_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamage(player, SubSkillType.AXES_AXES_LIMIT_BREAK))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.AXES);
return textComponents;
}
}

View File

@@ -1,15 +1,17 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.RankUtils;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class ExcavationCommand extends SkillCommand {
private String gigaDrillBreakerLength;
private String gigaDrillBreakerLengthEndurance;
@@ -18,11 +20,11 @@ public class ExcavationCommand extends SkillCommand {
private boolean canTreasureHunt;
public ExcavationCommand() {
super(SkillType.EXCAVATION);
super(PrimarySkillType.EXCAVATION);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// GIGA DRILL BREAKER
if (canGigaDrill) {
String gigaDrillStrings[] = calculateLengthDisplayValues(player, skillValue);
@@ -33,23 +35,8 @@ public class ExcavationCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canGigaDrill = Permissions.gigaDrillBreaker(player);
canTreasureHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.EXCAVATION_TREASURE_HUNTER);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canGigaDrill) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Excavation.Effect.0"), LocaleLoader.getString("Excavation.Effect.1")));
}
if (canTreasureHunt) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Excavation.Effect.2"), LocaleLoader.getString("Excavation.Effect.3")));
}
return messages;
canGigaDrill = Permissions.gigaDrillBreaker(player) && RankUtils.hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER);
canTreasureHunt = canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY);
}
@Override
@@ -57,9 +44,21 @@ public class ExcavationCommand extends SkillCommand {
List<String> messages = new ArrayList<String>();
if (canGigaDrill) {
messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
messages.add(getStatMessage(SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER, gigaDrillBreakerLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
//messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.EXCAVATION);
return textComponents;
}
}

View File

@@ -1,23 +1,25 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.treasure.Rarity;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.fishing.Fishing;
import com.gmail.nossr50.skills.fishing.FishingManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.random.RandomChanceUtil;
import com.gmail.nossr50.util.skills.RankUtils;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.treasure.Rarity;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.fishing.Fishing;
import com.gmail.nossr50.skills.fishing.Fishing.Tier;
import com.gmail.nossr50.skills.fishing.FishingManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import java.util.ArrayList;
import java.util.List;
public class FishingCommand extends SkillCommand {
private int lootTier;
@@ -44,11 +46,11 @@ public class FishingCommand extends SkillCommand {
private boolean canIceFish;
public FishingCommand() {
super(SkillType.FISHING);
super(PrimarySkillType.FISHING);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
// TREASURE HUNTER
@@ -56,7 +58,6 @@ public class FishingCommand extends SkillCommand {
lootTier = fishingManager.getLootTier();
// Item drop rates
trapTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.TRAP) / 100.0);
commonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);
uncommonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);
rareTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);
@@ -68,29 +69,33 @@ public class FishingCommand extends SkillCommand {
double totalEnchantChance = 0;
for (Rarity rarity : Rarity.values()) {
if (rarity != Rarity.TRAP && rarity != Rarity.RECORD) {
if (rarity != Rarity.RECORD) {
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
}
}
magicChance = percent.format(totalEnchantChance / 100.0);
if(totalEnchantChance >= 1)
magicChance = percent.format(totalEnchantChance / 100.0);
else
magicChance = percent.format(0);
}
// SHAKE
// FISHING_SHAKE
if (canShake) {
String[] shakeStrings = calculateAbilityDisplayValues(UserManager.getPlayer(player).getFishingManager().getShakeProbability(), isLucky);
String[] shakeStrings = RandomChanceUtil.calculateAbilityDisplayValuesStatic(player, PrimarySkillType.FISHING, fishingManager.getShakeChance());
shakeChance = shakeStrings[0];
shakeChanceLucky = shakeStrings[1];
}
// FISHERMAN'S DIET
if (canFishermansDiet) {
fishermansDietRank = calculateRank(skillValue, Fishing.fishermansDietMaxLevel, Fishing.fishermansDietRankLevel1);
fishermansDietRank = RankUtils.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) {
@@ -105,101 +110,68 @@ public class FishingCommand extends SkillCommand {
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
}
biteChance = calculateAbilityDisplayValues(rawBiteChance * 100.0, isLucky)[0];
double luckyModifier = Permissions.lucky(player, PrimarySkillType.FISHING) ? 1.333D : 1.0D;
biteChance = percent.format((rawBiteChance * 100.0D) * luckyModifier);
}
}
@Override
protected void permissionsCheck(Player player) {
canTreasureHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FISHING_TREASURE_HUNTER);
canMagicHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.MAGIC_HUNTER);
canShake = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHAKE);
canFishermansDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FISHERMANS_DIET);
canMasterAngler = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.MASTER_ANGLER);
canIceFish = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ICE_FISHING);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canTreasureHunt) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Fishing.Effect.0"), LocaleLoader.getString("Fishing.Effect.1")));
}
if (canMagicHunt) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Fishing.Effect.2"), LocaleLoader.getString("Fishing.Effect.3")));
}
if (canIceFish) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Fishing.Effect.10"), LocaleLoader.getString("Fishing.Effect.11")));
}
if (canMasterAngler) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Fishing.Effect.8"), LocaleLoader.getString("Fishing.Effect.9")));
}
if (canShake) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Fishing.Effect.4"), LocaleLoader.getString("Fishing.Effect.5")));
}
if (canFishermansDiet) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Fishing.Effect.6"), LocaleLoader.getString("Fishing.Effect.7")));
}
return messages;
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);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canTreasureHunt) {
messages.add(LocaleLoader.getString("Fishing.Ability.Rank", lootTier, Tier.values().length));
messages.add(LocaleLoader.getString("Fishing.Ability.TH.DropRate", trapTreasure, commonTreasure, uncommonTreasure, rareTreasure, epicTreasure, legendaryTreasure, recordTreasure));
if (canFishermansDiet) {
messages.add(getStatMessage(false, true, SubSkillType.FISHING_FISHERMANS_DIET, String.valueOf(fishermansDietRank)));
}
if (canMagicHunt) {
messages.add(LocaleLoader.getString("Fishing.Ability.TH.MagicRate", magicChance));
}
if (canIceFish) {
int unlockLevel = AdvancedConfig.getInstance().getIceFishingUnlockLevel();
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Fishing.Ability.Locked.1", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Fishing.Ability.IceFishing"));
}
messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription()));
}
if (canMagicHunt) {
messages.add(getStatMessage(SubSkillType.FISHING_MAGIC_HUNTER, magicChance));
}
if (canMasterAngler) {
int unlockLevel = AdvancedConfig.getInstance().getMasterAnglerUnlockLevel();
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Fishing.Ability.Locked.2", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Fishing.Ability.Chance", biteChance));
}
//TODO: Update this with more details
messages.add(getStatMessage(false, true, SubSkillType.FISHING_MASTER_ANGLER, biteChance));
}
if (canShake) {
int unlockLevel = AdvancedConfig.getInstance().getFishingTierLevel(Tier.ONE);
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Fishing.Ability.Locked.0", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Fishing.Ability.Shake", shakeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : ""));
}
messages.add(getStatMessage(SubSkillType.FISHING_SHAKE, shakeChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : ""));
}
if (canFishermansDiet) {
messages.add(LocaleLoader.getString("Fishing.Ability.FD", fishermansDietRank));
if (canTreasureHunt) {
messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(RankUtils.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)));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.FISHING);
return textComponents;
}
}

View File

@@ -1,16 +1,18 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.herbalism.Herbalism;
import com.gmail.nossr50.util.Permissions;
import java.util.ArrayList;
import java.util.List;
public class HerbalismCommand extends SkillCommand {
private String greenTerraLength;
@@ -35,11 +37,24 @@ public class HerbalismCommand extends SkillCommand {
private boolean canShroomThumb;
public HerbalismCommand() {
super(SkillType.HERBALISM);
super(PrimarySkillType.HERBALISM);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS);;
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
// FARMERS DIET
if (canFarmersDiet) {
farmersDietRank = RankUtils.getRank(player, SubSkillType.HERBALISM_FARMERS_DIET);
}
// GREEN TERRA
if (canGreenTerra) {
String[] greenTerraStrings = calculateLengthDisplayValues(player, skillValue);
@@ -47,37 +62,25 @@ public class HerbalismCommand extends SkillCommand {
greenTerraLengthEndurance = greenTerraStrings[1];
}
// FARMERS DIET
if (canFarmersDiet) {
farmersDietRank = calculateRank(skillValue, Herbalism.farmersDietMaxLevel, Herbalism.farmersDietRankLevel1);
}
// GREEN THUMB
if (canGreenThumbBlocks || canGreenThumbPlants) {
greenThumbStage = calculateRank(skillValue, Herbalism.greenThumbStageMaxLevel, Herbalism.greenThumbStageChangeLevel);
greenThumbStage = RankUtils.getRank(player, SubSkillType.HERBALISM_GREEN_THUMB);
String[] greenThumbStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GREEN_THUMB_PLANT, isLucky);
String[] greenThumbStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_GREEN_THUMB);
greenThumbChance = greenThumbStrings[0];
greenThumbChanceLucky = greenThumbStrings[1];
}
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.HERBALISM_DOUBLE_DROPS, isLucky);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
// HYLIAN LUCK
if (hasHylianLuck) {
String[] hylianLuckStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.HYLIAN_LUCK, isLucky);
String[] hylianLuckStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_HYLIAN_LUCK);
hylianLuckChance = hylianLuckStrings[0];
hylianLuckChanceLucky = hylianLuckStrings[1];
}
// SHROOM THUMB
if (canShroomThumb) {
String[] shroomThumbStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.SHROOM_THUMB, isLucky);
String[] shroomThumbStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_SHROOM_THUMB);
shroomThumbChance = shroomThumbStrings[0];
shroomThumbChanceLucky = shroomThumbStrings[1];
}
@@ -85,82 +88,64 @@ public class HerbalismCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
hasHylianLuck = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HYLIAN_LUCK);
hasHylianLuck = canUseSubskill(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
canGreenTerra = Permissions.greenTerra(player);
canGreenThumbPlants = Permissions.greenThumbPlant(player, Material.CROPS) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.NETHER_WARTS) || Permissions.greenThumbPlant(player, Material.COCOA);
canGreenThumbBlocks = Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK);
canFarmersDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FARMERS_DIET);
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canShroomThumb = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHROOM_THUMB);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canGreenTerra) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.0"), LocaleLoader.getString("Herbalism.Effect.1")));
}
if (canGreenThumbPlants) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.2"), LocaleLoader.getString("Herbalism.Effect.3")));
}
if (canGreenThumbBlocks) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.4"), LocaleLoader.getString("Herbalism.Effect.5")));
}
if (canFarmersDiet) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.6"), LocaleLoader.getString("Herbalism.Effect.7")));
}
if (hasHylianLuck) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.10"), LocaleLoader.getString("Herbalism.Effect.11")));
}
if (canShroomThumb) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.12"), LocaleLoader.getString("Herbalism.Effect.13")));
}
if (canDoubleDrop) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Herbalism.Effect.8"), LocaleLoader.getString("Herbalism.Effect.9")));
}
return messages;
canGreenThumbPlants = RankUtils.hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (Permissions.greenThumbPlant(player, Material.WHEAT) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.BEETROOT) || Permissions.greenThumbPlant(player, Material.NETHER_WART) || Permissions.greenThumbPlant(player, Material.COCOA));
canGreenThumbBlocks = RankUtils.hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLESTONE_WALL) || Permissions.greenThumbBlock(player, Material.STONE_BRICKS));
canFarmersDiet = canUseSubskill(player, SubSkillType.HERBALISM_FARMERS_DIET);
canDoubleDrop = canUseSubskill(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canShroomThumb = canUseSubskill(player, SubSkillType.HERBALISM_SHROOM_THUMB);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canDoubleDrop) {
messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
}
if (canFarmersDiet) {
messages.add(getStatMessage(false, true, SubSkillType.HERBALISM_FARMERS_DIET, String.valueOf(farmersDietRank)));
}
if (canGreenTerra) {
messages.add(LocaleLoader.getString("Herbalism.Ability.GTe.Length", greenTerraLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_TERRA, greenTerraLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
//messages.add(LocaleLoader.getString("Herbalism.Ability.GTe.Length", greenTerraLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
}
if (canGreenThumbBlocks || canGreenThumbPlants) {
messages.add(LocaleLoader.getString("Herbalism.Ability.GTh.Chance", greenThumbChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_THUMB, greenThumbChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
//messages.add(LocaleLoader.getString("Herbalism.Ability.GTh.Chance", greenThumbChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
}
if (canGreenThumbPlants) {
messages.add(LocaleLoader.getString("Herbalism.Ability.GTh.Stage", greenThumbStage));
}
if (canFarmersDiet) {
messages.add(LocaleLoader.getString("Herbalism.Ability.FD", farmersDietRank));
messages.add(getStatMessage(true, true,SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage)));
}
if (hasHylianLuck) {
messages.add(LocaleLoader.getString("Herbalism.Ability.HylianLuck", hylianLuckChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", hylianLuckChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.HERBALISM_HYLIAN_LUCK, hylianLuckChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", hylianLuckChanceLucky) : ""));
}
if (canShroomThumb) {
messages.add(LocaleLoader.getString("Herbalism.Ability.ShroomThumb.Chance", shroomThumbChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shroomThumbChanceLucky) : ""));
}
if (canDoubleDrop) {
messages.add(LocaleLoader.getString("Herbalism.Ability.DoubleDropChance", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.HERBALISM_SHROOM_THUMB, shroomThumbChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shroomThumbChanceLucky) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.HERBALISM);
return textComponents;
}
}

View File

@@ -1,20 +1,20 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.mining.MiningManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.mining.BlastMining;
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
import com.gmail.nossr50.skills.mining.MiningManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
public class MiningCommand extends SkillCommand {
private String doubleDropChance;
private String doubleDropChanceLucky;
@@ -35,25 +35,11 @@ public class MiningCommand extends SkillCommand {
private boolean canDemoExpert;
public MiningCommand() {
super(SkillType.MINING);
super(PrimarySkillType.MINING);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// SUPER BREAKER
if (canSuperBreaker) {
String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue);
superBreakerLength = superBreakerStrings[0];
superBreakerLengthEndurance = superBreakerStrings[1];
}
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.MINING_DOUBLE_DROPS, isLucky);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
protected void dataCalculations(Player player, float skillValue) {
// BLAST MINING
if (canBlast || canDemoExpert || canBiggerBombs) {
MiningManager miningManager = UserManager.getPlayer(player).getMiningManager();
@@ -65,89 +51,71 @@ public class MiningCommand extends SkillCommand {
blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D);
blastRadiusIncrease = miningManager.getBlastRadiusModifier();
}
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
// SUPER BREAKER
if (canSuperBreaker) {
String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue);
superBreakerLength = superBreakerStrings[0];
superBreakerLengthEndurance = superBreakerStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBiggerBombs = Permissions.biggerBombs(player);
canBlast = Permissions.remoteDetonation(player);
canDemoExpert = Permissions.demolitionsExpertise(player);
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.MINING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canSuperBreaker = Permissions.superBreaker(player);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canSuperBreaker) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Mining.Effect.0"), LocaleLoader.getString("Mining.Effect.1")));
}
if (canDoubleDrop) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Mining.Effect.2"), LocaleLoader.getString("Mining.Effect.3")));
}
if (canBlast) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Mining.Effect.4"), LocaleLoader.getString("Mining.Effect.5")));
}
if (canBiggerBombs) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Mining.Effect.6"), LocaleLoader.getString("Mining.Effect.7")));
}
if (canDemoExpert) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Mining.Effect.8"), LocaleLoader.getString("Mining.Effect.9")));
}
return messages;
canBiggerBombs = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && Permissions.biggerBombs(player);
canBlast = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(player);
canDemoExpert = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(player);
canDoubleDrop = Permissions.isSubSkillEnabled(player, SubSkillType.MINING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canSuperBreaker = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canBiggerBombs) {
messages.add(getStatMessage(true, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastRadiusIncrease)));
//messages.add(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease));
}
if (canBlast) {
messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING)), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
//messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
}
if (canDemoExpert) {
messages.add(getStatMessage(SubSkillType.MINING_DEMOLITIONS_EXPERTISE, blastDamageDecrease));
//messages.add(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease));
}
if (canDoubleDrop) {
messages.add(LocaleLoader.getString("Mining.Effect.DropChance", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
//messages.add(LocaleLoader.getString("Mining.Effect.DropChance", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
}
if (canSuperBreaker) {
messages.add(LocaleLoader.getString("Mining.Ability.Length", superBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
}
if (canBlast) {
int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRankLevel(Tier.ONE);
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, Tier.values().length, LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
}
}
if (canBiggerBombs) {
int unlockLevel = BlastMining.getBiggerBombsUnlockLevel();
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.1", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease));
}
}
if (canDemoExpert) {
int unlockLevel = BlastMining.getDemolitionExpertUnlockLevel();
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.2", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease));
}
messages.add(getStatMessage(SubSkillType.MINING_SUPER_BREAKER, superBreakerLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
//messages.add(LocaleLoader.getString("Mining.Ability.Length", superBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.MINING);
return textComponents;
}
}

View File

@@ -0,0 +1,101 @@
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.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
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 {
@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(Permissions.mmoinfo(player))
{
if(args == null || args[0] == null)
return false;
if(args[0].equalsIgnoreCase( "???"))
{
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", "???"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mystery"));
return true;
} else if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0]))
{
displayInfo(player, args[0]);
return true;
}
//Not a real skill
player.sendMessage(LocaleLoader.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], PrimarySkillType.SUBSKILL_NAMES, new ArrayList<String>(PrimarySkillType.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);
//TextComponentFactory.sendPlayerUrlHeader(player);
} else {
/*
* Skill is only in the old system
*/
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", subSkillName));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.OldSkill"));
}
for(SubSkillType subSkillType : SubSkillType.values())
{
if(subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName))
subSkillName = subSkillType.getWikiName(subSkillType.toString());
}
//Send Player Wiki Link
TextComponentFactory.sendPlayerSubSkillWikiLink(player, subSkillName);
}
}

View File

@@ -1,23 +1,25 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.ArcaneForging;
import com.gmail.nossr50.skills.repair.ArcaneForging.Tier;
import com.gmail.nossr50.skills.repair.Repair;
import com.gmail.nossr50.skills.repair.RepairManager;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
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 RepairCommand extends SkillCommand {
private String repairMasteryBonus;
@@ -42,14 +44,14 @@ public class RepairCommand extends SkillCommand {
private int stoneLevel;
public RepairCommand() {
super(SkillType.REPAIR);
super(PrimarySkillType.REPAIR);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// We're using pickaxes here, not the best but it works
Repairable diamondRepairable = mcMMO.getRepairableManager().getRepairable(Material.DIAMOND_PICKAXE);
Repairable goldRepairable = mcMMO.getRepairableManager().getRepairable(Material.GOLD_PICKAXE);
Repairable goldRepairable = mcMMO.getRepairableManager().getRepairable(Material.GOLDEN_PICKAXE);
Repairable ironRepairable = mcMMO.getRepairableManager().getRepairable(Material.IRON_PICKAXE);
Repairable stoneRepairable = mcMMO.getRepairableManager().getRepairable(Material.STONE_PICKAXE);
@@ -66,7 +68,7 @@ public class RepairCommand extends SkillCommand {
// SUPER REPAIR
if (canSuperRepair) {
String[] superRepairStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.SUPER_REPAIR, isLucky);
String[] superRepairStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.REPAIR_SUPER_REPAIR);
superRepairChance = superRepairStrings[0];
superRepairChanceLucky = superRepairStrings[1];
}
@@ -74,9 +76,9 @@ public class RepairCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canSuperRepair = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SUPER_REPAIR);
canMasterRepair = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.REPAIR_MASTERY);
canArcaneForge = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ARCANE_FORGING);
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, MaterialType.DIAMOND);
canRepairGold = Permissions.repairMaterialType(player, MaterialType.GOLD);
canRepairIron = Permissions.repairMaterialType(player, MaterialType.IRON);
@@ -84,76 +86,46 @@ public class RepairCommand extends SkillCommand {
canRepairString = Permissions.repairMaterialType(player, MaterialType.STRING);
canRepairLeather = Permissions.repairMaterialType(player, MaterialType.LEATHER);
canRepairWood = Permissions.repairMaterialType(player, MaterialType.WOOD);
arcaneBypass = Permissions.arcaneBypass(player);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canRepairLeather || canRepairString || canRepairWood || canRepairStone || canRepairIron || canRepairGold || canRepairDiamond) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.0"), LocaleLoader.getString("Repair.Effect.1")));
}
if (canMasterRepair) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.2"), LocaleLoader.getString("Repair.Effect.3")));
}
if (canSuperRepair) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.4"), LocaleLoader.getString("Repair.Effect.5")));
}
/* Repair Level Requirements */
if (canRepairStone && stoneLevel > 0) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.14", stoneLevel), LocaleLoader.getString("Repair.Effect.15")));
}
if (canRepairIron && ironLevel > 0) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.12", ironLevel), LocaleLoader.getString("Repair.Effect.13")));
}
if (canRepairGold && goldLevel > 0) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.10", goldLevel), LocaleLoader.getString("Repair.Effect.11")));
}
if (canRepairDiamond && diamondLevel > 0) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.6", diamondLevel), LocaleLoader.getString("Repair.Effect.7")));
}
if (canArcaneForge) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.8"), LocaleLoader.getString("Repair.Effect.9")));
}
return messages;
arcaneBypass = (Permissions.arcaneBypass(player) || Permissions.hasRepairEnchantBypassPerk(player));
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canMasterRepair) {
messages.add(LocaleLoader.getString("Repair.Skills.Mastery", repairMasteryBonus));
}
if (canSuperRepair) {
messages.add(LocaleLoader.getString("Repair.Skills.Super.Chance", superRepairChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", superRepairChanceLucky) : ""));
}
if (canArcaneForge) {
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
messages.add(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), Tier.values().length));
messages.add(getStatMessage(false, true,
SubSkillType.REPAIR_ARCANE_FORGING,
String.valueOf(RankUtils.getRank(player, SubSkillType.REPAIR_ARCANE_FORGING)),
RankUtils.getHighestRankStr(SubSkillType.REPAIR_ARCANE_FORGING)));
if (ArcaneForging.arcaneForgingEnchantLoss) {
messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Success", (arcaneBypass ? 100 : repairManager.getKeepEnchantChance())));
if (ArcaneForging.arcaneForgingEnchantLoss || ArcaneForging.arcaneForgingDowngrades) {
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 (ArcaneForging.arcaneForgingDowngrades) {
messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Downgrade", (arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance())));
}
if (canSuperRepair) {
messages.add(getStatMessage(SubSkillType.REPAIR_SUPER_REPAIR, superRepairChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", superRepairChanceLucky) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.REPAIR);
return textComponents;
}
}

View File

@@ -1,51 +1,37 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.salvage.Salvage;
import com.gmail.nossr50.skills.salvage.SalvageManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils;
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 canAdvancedSalvage;
private boolean canArcaneSalvage;
public SalvageCommand() {
super(SkillType.SALVAGE);
super(PrimarySkillType.SALVAGE);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// TODO Auto-generated method stub
}
@Override
protected void permissionsCheck(Player player) {
canAdvancedSalvage = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ADVANCED_SALVAGE);
canArcaneSalvage = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ARCANE_SALVAGE);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canAdvancedSalvage) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Salvage.Effect.0"), LocaleLoader.getString("Salvage.Effect.1")));
}
if (canArcaneSalvage) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Salvage.Effect.2"), LocaleLoader.getString("Salvage.Effect.3")));
}
return messages;
canAdvancedSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ADVANCED_SALVAGE);
canArcaneSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE);
}
@Override
@@ -54,16 +40,14 @@ public class SalvageCommand extends SkillCommand {
SalvageManager salvageManager = UserManager.getPlayer(player).getSalvageManager();
if (canAdvancedSalvage) {
if (skillValue < Salvage.advancedSalvageUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Salvage.Ability.Locked.0", Salvage.advancedSalvageUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Ability.Bonus.0"), LocaleLoader.getString("Salvage.Ability.Bonus.1", percent.format(salvageManager.getMaxSalvagePercentage()))));
}
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Ability.Bonus.0"),
LocaleLoader.getString("Salvage.Ability.Bonus.1", salvageManager.getSalvageableAmount())));
}
if (canArcaneSalvage) {
messages.add(LocaleLoader.getString("Salvage.Arcane.Rank", salvageManager.getArcaneSalvageRank(), Salvage.Tier.values().length));
messages.add(getStatMessage(false, true, SubSkillType.SALVAGE_ARCANE_SALVAGE,
String.valueOf(salvageManager.getArcaneSalvageRank()),
String.valueOf(RankUtils.getHighestRank(SubSkillType.SALVAGE_ARCANE_SALVAGE))));
if (Salvage.arcaneSalvageEnchantLoss) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Arcane.ExtractFull"), percent.format(salvageManager.getExtractFullEnchantChance() / 100)));
@@ -76,4 +60,13 @@ public class SalvageCommand extends SkillCommand {
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SALVAGE);
return textComponents;
}
}

View File

@@ -1,34 +1,38 @@
package com.gmail.nossr50.commands.skills;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Set;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.random.RandomChanceUtil;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.PerksUtils;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import com.google.common.collect.ImmutableList;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.Motd;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.PerksUtils;
import com.google.common.collect.ImmutableList;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public abstract class SkillCommand implements TabExecutor {
protected SkillType skill;
protected PrimarySkillType skill;
private String skillName;
protected DecimalFormat percent = new DecimalFormat("##0.00%");
@@ -36,7 +40,7 @@ public abstract class SkillCommand implements TabExecutor {
private CommandExecutor skillGuideCommand;
public SkillCommand(SkillType skill) {
public SkillCommand(PrimarySkillType skill) {
this.skill = skill;
skillName = skill.getName();
skillGuideCommand = new SkillGuideCommand(skill);
@@ -52,6 +56,12 @@ public abstract class SkillCommand implements TabExecutor {
return true;
}
if(UserManager.getPlayer((Player) sender) == null)
{
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
switch (args.length) {
case 0:
Player player = (Player) sender;
@@ -61,63 +71,147 @@ public abstract class SkillCommand implements TabExecutor {
boolean hasEndurance = (PerksUtils.handleActivationPerks(player, 0, 0) != 0);
float skillValue = mcMMOPlayer.getSkillLevel(skill);
permissionsCheck(player);
dataCalculations(player, skillValue, isLucky);
//Send the players a few blank lines to make finding the top of the skill command easier
if(AdvancedConfig.getInstance().doesSkillCommandSendBlankLines())
for(int i = 0; i < 2; i++)
{
player.sendMessage("");
}
if (Config.getInstance().getSkillUseBoard()) {
permissionsCheck(player);
dataCalculations(player, skillValue);
sendSkillCommandHeader(player, mcMMOPlayer, (int) skillValue);
//Make JSON text components
List<TextComponent> subskillTextComponents = getTextComponents(player);
//Subskills Header
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", LocaleLoader.getString("Effects.SubSkills.Overhaul")));
//Send JSON text components
TextComponentFactory.sendPlayerSubSkillList(player, subskillTextComponents);
/*for(TextComponent tc : subskillTextComponents)
{
player.spigot().sendMessage(new TextComponent[]{tc, new TextComponent(": TESTING")});
}*/
//Stats
getStatMessages(player, isLucky, hasEndurance, skillValue);
//Header
//Link Header
if(Config.getInstance().getUrlLinksEnabled())
{
player.sendMessage(LocaleLoader.getString("Overhaul.mcMMO.Header"));
TextComponentFactory.sendPlayerUrlHeader(player);
}
if (Config.getInstance().getScoreboardsEnabled() && Config.getInstance().getSkillUseBoard()) {
ScoreboardManager.enablePlayerSkillScoreboard(player, skill);
}
if (!skill.isChildSkill()) {
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
player.sendMessage(LocaleLoader.getString("Effects.Level", (int) skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
}
else {
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName + " " + LocaleLoader.getString("Skills.Child")));
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain.Child")));
player.sendMessage(LocaleLoader.getString("Effects.Child", (int) skillValue));
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Skills.Parents")));
Set<SkillType> parents = FamilyTree.getParents(skill);
for (SkillType parent : parents) {
player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)));
}
}
List<String> effectMessages = effectsDisplay();
if (!effectMessages.isEmpty()) {
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Effects.Effects")));
if (isLucky) {
player.sendMessage(Motd.PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc", skillName)));
}
for (String message : effectMessages) {
player.sendMessage(message);
}
}
List<String> statsMessages = statsDisplay(player, skillValue, hasEndurance, isLucky);
if (!statsMessages.isEmpty()) {
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Commands.Stats.Self")));
for (String message : statsMessages) {
player.sendMessage(message);
}
}
player.sendMessage(LocaleLoader.getString("Guides.Available", skillName, skillName.toLowerCase()));
return true;
default:
return skillGuideCommand.onCommand(sender, command, label, args);
}
}
private void getStatMessages(Player player, boolean isLucky, boolean hasEndurance, float skillValue) {
List<String> statsMessages = statsDisplay(player, skillValue, hasEndurance, isLucky);
if (!statsMessages.isEmpty()) {
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", LocaleLoader.getString("Commands.Stats.Self.Overhaul")));
for (String message : statsMessages) {
player.sendMessage(message);
}
}
player.sendMessage(LocaleLoader.getString("Guides.Available", skillName, skillName.toLowerCase()));
}
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
ChatColor hd1 = ChatColor.DARK_AQUA;
ChatColor c1 = ChatColor.GOLD;
ChatColor c2 = ChatColor.RED;
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", skillName));
if(!skill.isChildSkill())
{
/*
* NON-CHILD SKILLS
*/
//XP GAIN METHOD
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
//LEVEL
player.sendMessage(LocaleLoader.getString("Effects.Level.Overhaul", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
} else {
/*
* CHILD SKILLS
*/
Set<PrimarySkillType> parents = FamilyTree.getParents(skill);
ArrayList<PrimarySkillType> parentList = new ArrayList<>();
//TODO: Add JSON here
for (PrimarySkillType parent : parents) {
parentList.add(parent);
/*player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/;
}
String parentMessage = "";
for(int i = 0; i < parentList.size(); i++)
{
if(i+1 < parentList.size())
{
parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i)));
parentMessage += ChatColor.GRAY+", ";
} else {
parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i)));
}
}
//XP GAIN METHOD
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain.Child")));
player.sendMessage(LocaleLoader.getString("Effects.Child.Overhaul", skillValue, parentMessage));
//LEVEL
//player.sendMessage(LocaleLoader.getString("Effects.Child.Overhaul", skillValue, skillValue));
}
/*
if (!skill.isChildSkill()) {
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
player.sendMessage(LocaleLoader.getString("Effects.Level", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
} else {
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName + " " + LocaleLoader.getString("Skills.Child")));
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain.Child")));
player.sendMessage(LocaleLoader.getString("Effects.Child", skillValue));
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Skills.Parents")));
Set<PrimarySkillType> parents = FamilyTree.getParents(skill);
for (PrimarySkillType parent : parents) {
player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)));
}
}
*/
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
@@ -132,24 +226,25 @@ public abstract class SkillCommand implements TabExecutor {
return Math.min((int) skillValue, maxLevel) / rankChangeLevel;
}
protected String[] calculateAbilityDisplayValues(double chance, boolean isLucky) {
String[] displayValues = new String[2];
displayValues[0] = percent.format(Math.min(chance, 100.0D) / 100.0D);
displayValues[1] = isLucky ? percent.format(Math.min(chance * 1.3333D, 100.0D) / 100.0D) : null;
return displayValues;
}
protected String[] calculateAbilityDisplayValues(float skillValue, SecondaryAbility skillAbility, boolean isLucky) {
int maxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(skillAbility);
return calculateAbilityDisplayValues((AdvancedConfig.getInstance().getMaxChance(skillAbility) / maxBonusLevel) * Math.min(skillValue, maxBonusLevel), isLucky);
protected String[] getAbilityDisplayValues(SkillActivationType skillActivationType, Player player, SubSkillType subSkill) {
return RandomChanceUtil.calculateAbilityDisplayValues(skillActivationType, player, subSkill);
}
protected String[] calculateLengthDisplayValues(Player player, float skillValue) {
int maxLength = skill.getAbility().getMaxLength();
int length = 2 + (int) (skillValue / AdvancedConfig.getInstance().getAbilityLength());
int abilityLengthVar = AdvancedConfig.getInstance().getAbilityLength();
int abilityLengthCap = AdvancedConfig.getInstance().getAbilityLengthCap();
int length;
if(abilityLengthCap <= 0)
{
length = 2 + (int) (skillValue / abilityLengthVar);
}
else {
length = 2 + (int) (Math.min(abilityLengthCap, skillValue) / abilityLengthVar);
}
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
if (maxLength != 0) {
@@ -159,11 +254,53 @@ public abstract class SkillCommand implements TabExecutor {
return new String[] { String.valueOf(length), String.valueOf(enduranceLength) };
}
protected abstract void dataCalculations(Player player, float skillValue, boolean isLucky);
protected String getStatMessage(SubSkillType subSkillType, String... vars)
{
return getStatMessage(false, false, subSkillType, vars);
}
protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars)
{
String templateKey = isCustom ? "Ability.Generic.Template.Custom" : "Ability.Generic.Template";
String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription() : subSkillType.getLocaleKeyStatExtraDescription();
if(isCustom)
return LocaleLoader.getString(templateKey, LocaleLoader.getString(statDescriptionKey, vars));
else
{
String[] mergedList = addItemToFirstPositionOfArray(LocaleLoader.getString(statDescriptionKey), vars);
return LocaleLoader.getString(templateKey, mergedList);
}
}
public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) {
String[] newArray = new String[existingArray.length + 1];
newArray[0] = itemToAdd;
System.arraycopy(existingArray, 0, newArray, 1, existingArray.length);
return newArray;
}
protected abstract void dataCalculations(Player player, float skillValue);
protected abstract void permissionsCheck(Player player);
protected abstract List<String> effectsDisplay();
//protected abstract List<String> effectsDisplay();
protected abstract List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky);
protected abstract List<TextComponent> getTextComponents(Player player);
/**
* Checks if a player can use a skill
* @param player target player
* @param subSkillType target subskill
* @return true if the player has permission and has the skill unlocked
*/
protected boolean canUseSubskill(Player player, SubSkillType subSkillType)
{
return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType);
}
}

View File

@@ -1,15 +1,14 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.Arrays;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
public class SkillGuideCommand implements CommandExecutor {
private String header;
@@ -17,7 +16,7 @@ public class SkillGuideCommand implements CommandExecutor {
private String invalidPage = LocaleLoader.getString("Guides.Page.Invalid");
public SkillGuideCommand(SkillType skill) {
public SkillGuideCommand(PrimarySkillType skill) {
header = LocaleLoader.getString("Guides.Header", skill.getName());
guide = getGuide(skill);
}
@@ -86,7 +85,7 @@ public class SkillGuideCommand implements CommandExecutor {
return allStrings;
}
private ArrayList<String> getGuide(SkillType skill) {
private ArrayList<String> getGuide(PrimarySkillType skill) {
ArrayList<String> guide = new ArrayList<String>();
for (int i = 0; i < 10; i++) {

View File

@@ -1,120 +1,98 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.smelting.Smelting;
import com.gmail.nossr50.skills.smelting.Smelting.Tier;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
public class SmeltingCommand extends SkillCommand {
private String burnTimeModifier;
private String secondSmeltChance;
private String secondSmeltChanceLucky;
private String fluxMiningChance;
private String fluxMiningChanceLucky;
private String str_secondSmeltChance;
private String str_secondSmeltChanceLucky;
private String str_fluxMiningChance;
private String str_fluxMiningChanceLucky;
private boolean canFuelEfficiency;
private boolean canSecondSmelt;
private boolean canFluxMine;
private boolean canVanillaXPBoost;
private boolean canUnderstandTheArt;
public SmeltingCommand() {
super(SkillType.SMELTING);
super(PrimarySkillType.SMELTING);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// FUEL EFFICIENCY
if (canFuelEfficiency) {
burnTimeModifier = decimal.format(1 + ((skillValue / Smelting.burnModifierMaxLevel) * Smelting.burnTimeMultiplier));
}
// SECOND SMELT
if (canSecondSmelt) {
String[] secondSmeltStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.SECOND_SMELT, isLucky);
secondSmeltChance = secondSmeltStrings[0];
secondSmeltChanceLucky = secondSmeltStrings[1];
burnTimeModifier = String.valueOf(UserManager.getPlayer(player).getSmeltingManager().getFuelEfficiencyMultiplier());
}
// FLUX MINING
if (canFluxMine) {
String[] fluxMiningStrings = calculateAbilityDisplayValues(Smelting.fluxMiningChance, isLucky);
fluxMiningChance = fluxMiningStrings[0];
fluxMiningChanceLucky = fluxMiningStrings[1];
/*if (canFluxMine) {
String[] fluxMiningStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_FLUX_MINING);
str_fluxMiningChance = fluxMiningStrings[0];
str_fluxMiningChanceLucky = fluxMiningStrings[1];
}*/
// SECOND SMELT
if (canSecondSmelt) {
String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_SECOND_SMELT);
str_secondSmeltChance = secondSmeltStrings[0];
str_secondSmeltChanceLucky = secondSmeltStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canFuelEfficiency = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FUEL_EFFICIENCY);
canSecondSmelt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SECOND_SMELT);
canFluxMine = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FLUX_MINING);
canVanillaXPBoost = Permissions.vanillaXpBoost(player, skill);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canFuelEfficiency) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Smelting.Effect.0"), LocaleLoader.getString("Smelting.Effect.1")));
}
if (canSecondSmelt) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Smelting.Effect.2"), LocaleLoader.getString("Smelting.Effect.3")));
}
if (canVanillaXPBoost) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Smelting.Effect.4"), LocaleLoader.getString("Smelting.Effect.5")));
}
if (canFluxMine) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Smelting.Effect.6"), LocaleLoader.getString("Smelting.Effect.7")));
}
return messages;
canFuelEfficiency = canUseSubskill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY);
canSecondSmelt = canUseSubskill(player, SubSkillType.SMELTING_SECOND_SMELT);
//canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING);
canUnderstandTheArt = Permissions.vanillaXpBoost(player, skill) && RankUtils.hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
/*if (canFluxMine) {
messages.add(getStatMessage(SubSkillType.SMELTING_FLUX_MINING, str_fluxMiningChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : ""));
//messages.add(LocaleLoader.getString("Smelting.Ability.FluxMining", str_fluxMiningChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : ""));
}*/
if (canFuelEfficiency) {
messages.add(LocaleLoader.getString("Smelting.Ability.FuelEfficiency", burnTimeModifier));
messages.add(getStatMessage(false, true, SubSkillType.SMELTING_FUEL_EFFICIENCY, burnTimeModifier));
}
if (canSecondSmelt) {
messages.add(LocaleLoader.getString("Smelting.Ability.SecondSmelt", secondSmeltChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", secondSmeltChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.SMELTING_SECOND_SMELT, str_secondSmeltChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_secondSmeltChanceLucky) : ""));
}
if (canVanillaXPBoost) {
int unlockLevel = AdvancedConfig.getInstance().getSmeltingRankLevel(Tier.ONE);
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Smelting.Ability.Locked.0", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Smelting.Ability.VanillaXPBoost", UserManager.getPlayer(player).getSmeltingManager().getVanillaXpMultiplier()));
}
}
if (canFluxMine) {
if (skillValue < Smelting.fluxMiningUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Smelting.Ability.Locked.1", Smelting.fluxMiningUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Smelting.Ability.FluxMining", fluxMiningChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", fluxMiningChanceLucky) : ""));
}
if (canUnderstandTheArt) {
messages.add(getStatMessage(false, true, SubSkillType.SMELTING_UNDERSTANDING_THE_ART,
String.valueOf(UserManager.getPlayer(player).getSmeltingManager().getVanillaXpMultiplier())));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SMELTING);
return textComponents;
}
}

View File

@@ -1,17 +1,21 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.swords.Swords;
import com.gmail.nossr50.util.Permissions;
public class SwordsCommand extends SkillCommand {
private String counterChance;
private String counterChanceLucky;
@@ -26,80 +30,91 @@ public class SwordsCommand extends SkillCommand {
private boolean canBleed;
public SwordsCommand() {
super(SkillType.SWORDS);
super(PrimarySkillType.SWORDS);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// SWORDS_COUNTER_ATTACK
if (canCounter) {
String[] counterStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_COUNTER_ATTACK);
counterChance = counterStrings[0];
counterChanceLucky = counterStrings[1];
}
// SWORDS_RUPTURE
if (canBleed) {
bleedLength = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
String[] bleedStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_RUPTURE);
bleedChance = bleedStrings[0];
bleedChanceLucky = bleedStrings[1];
}
// SERRATED STRIKES
if (canSerratedStrike) {
String[] serratedStrikesStrings = calculateLengthDisplayValues(player, skillValue);
serratedStrikesLength = serratedStrikesStrings[0];
serratedStrikesLengthEndurance = serratedStrikesStrings[1];
}
// BLEED
if (canBleed) {
bleedLength = (skillValue >= AdvancedConfig.getInstance().getMaxBonusLevel(SecondaryAbility.BLEED)) ? Swords.bleedMaxTicks : Swords.bleedBaseTicks;
String[] bleedStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.BLEED, isLucky);
bleedChance = bleedStrings[0];
bleedChanceLucky = bleedStrings[1];
}
// COUNTER
if (canCounter) {
String[] counterStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.COUNTER, isLucky);
counterChance = counterStrings[0];
counterChanceLucky = counterStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBleed = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BLEED);
canCounter = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.COUNTER);
canSerratedStrike = Permissions.serratedStrikes(player);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canCounter) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Swords.Effect.0"), LocaleLoader.getString("Swords.Effect.1", percent.format(1.0D / Swords.counterAttackModifier))));
}
if (canSerratedStrike) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Swords.Effect.2"), LocaleLoader.getString("Swords.Effect.3", percent.format(1.0D / Swords.serratedStrikesModifier))));
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Swords.Effect.4"), LocaleLoader.getString("Swords.Effect.5", Swords.serratedStrikesBleedTicks)));
}
if (canBleed) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Swords.Effect.6"), LocaleLoader.getString("Swords.Effect.7")));
}
return messages;
canBleed = canUseSubskill(player, SubSkillType.SWORDS_RUPTURE);
canCounter = canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK);
canSerratedStrike = RankUtils.hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
int ruptureTicks = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer();
double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs();
if (canCounter) {
messages.add(LocaleLoader.getString("Swords.Combat.Counter.Chance", counterChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.SWORDS_COUNTER_ATTACK, counterChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterChanceLucky) : ""));
}
if (canBleed) {
messages.add(LocaleLoader.getString("Swords.Combat.Bleed.Length", bleedLength));
messages.add(LocaleLoader.getString("Swords.Combat.Bleed.Note"));
messages.add(LocaleLoader.getString("Swords.Combat.Bleed.Chance", bleedChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", bleedChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.SWORDS_RUPTURE, bleedChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", bleedChanceLucky) : ""));
messages.add(getStatMessage(true, true, SubSkillType.SWORDS_RUPTURE,
String.valueOf(ruptureTicks),
String.valueOf(ruptureDamagePlayers),
String.valueOf(ruptureDamageMobs)));
messages.add(LocaleLoader.getString("Swords.Combat.Rupture.Note"));
}
if (canSerratedStrike) {
messages.add(LocaleLoader.getString("Swords.SS.Length", serratedStrikesLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
messages.add(getStatMessage(SubSkillType.SWORDS_SERRATED_STRIKES, serratedStrikesLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
}
if(canUseSubskill(player, SubSkillType.SWORDS_STAB))
{
messages.add(getStatMessage(SubSkillType.SWORDS_STAB,
String.valueOf(UserManager.getPlayer(player).getSwordsManager().getStabDamage())));
}
if(canUseSubskill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamage(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SWORDS);
return textComponents;
}
}

View File

@@ -1,18 +1,18 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.taming.Taming;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class TamingCommand extends SkillCommand {
private String goreChance;
@@ -29,13 +29,13 @@ public class TamingCommand extends SkillCommand {
private boolean canHolyHound;
public TamingCommand() {
super(SkillType.TAMING);
super(PrimarySkillType.TAMING);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
if (canGore) {
String[] goreStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GORE, isLucky);
String[] goreStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.TAMING_GORE);
goreChance = goreStrings[0];
goreChanceLucky = goreStrings[1];
}
@@ -43,129 +43,60 @@ public class TamingCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BEAST_LORE);
canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE);
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ENVIROMENTALLY_AWARE);
canFastFood = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FAST_FOOD);
canGore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GORE);
canSharpenedClaws = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHARPENED_CLAWS);
canShockProof = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHOCK_PROOF);
canThickFur = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.THICK_FUR);
canHolyHound = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HOLY_HOUND);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canBeastLore) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1")));
}
if (canGore) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.2"), LocaleLoader.getString("Taming.Effect.3")));
}
if (canSharpenedClaws) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.4"), LocaleLoader.getString("Taming.Effect.5")));
}
if (canEnvironmentallyAware) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.6"), LocaleLoader.getString("Taming.Effect.7")));
}
if (canThickFur) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.8"), LocaleLoader.getString("Taming.Effect.9")));
}
if (canShockProof) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.10"), LocaleLoader.getString("Taming.Effect.11")));
}
if (canFastFood) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.16"), LocaleLoader.getString("Taming.Effect.17")));
}
if (canHolyHound) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.18"), LocaleLoader.getString("Taming.Effect.19")));
}
if (canCallWild) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13")));
int costOcelot = Config.getInstance().getTamingCOTWCost(EntityType.OCELOT);
String itemOcelot = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT));
int costWolf = Config.getInstance().getTamingCOTWCost(EntityType.WOLF);
String itemWolf = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF));
int costHorse = Config.getInstance().getTamingCOTWCost(EntityType.HORSE);
String itemHorse = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE));
messages.add(LocaleLoader.getString("Taming.Effect.14", costOcelot, itemOcelot, costWolf, itemWolf, costHorse, itemHorse));
}
return messages;
canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
canFastFood = canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE);
canGore = canUseSubskill(player, SubSkillType.TAMING_GORE);
canSharpenedClaws = canUseSubskill(player, SubSkillType.TAMING_SHARPENED_CLAWS);
canShockProof = canUseSubskill(player, SubSkillType.TAMING_SHOCK_PROOF);
canThickFur = canUseSubskill(player, SubSkillType.TAMING_THICK_FUR);
canHolyHound = canUseSubskill(player, SubSkillType.TAMING_HOLY_HOUND);
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canFastFood) {
if (skillValue < Taming.fastFoodServiceUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.4", Taming.fastFoodServiceUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", percent.format(Taming.fastFoodServiceActivationChance / 100D))));
}
}
if (canEnvironmentallyAware) {
if (skillValue < Taming.environmentallyAwareUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.0", Taming.environmentallyAwareUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1")));
}
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1")));
}
if (canThickFur) {
if (skillValue < Taming.thickFurUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.1", Taming.thickFurUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", Taming.thickFurModifier)));
}
if (canFastFood) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", percent.format(Taming.fastFoodServiceActivationChance / 100D))));
}
if (canGore) {
messages.add(LocaleLoader.getString("Ability.Generic.Template",
LocaleLoader.getString("Taming.Combat.Chance.Gore"),
goreChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", goreChanceLucky) : ""));
}
if (canHolyHound) {
if (skillValue < Taming.holyHoundUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.5", Taming.holyHoundUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11")));
}
}
if (canShockProof) {
if (skillValue < Taming.shockProofUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.2", Taming.shockProofUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", Taming.shockProofModifier)));
}
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11")));
}
if (canSharpenedClaws) {
if (skillValue < Taming.sharpenedClawsUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.3", Taming.sharpenedClawsUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7", Taming.sharpenedClawsBonusDamage)));
}
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7", Taming.sharpenedClawsBonusDamage)));
}
if (canGore) {
messages.add(LocaleLoader.getString("Taming.Combat.Chance.Gore", goreChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", goreChanceLucky) : ""));
if (canShockProof) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", Taming.shockProofModifier)));
}
if (canThickFur) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", Taming.thickFurModifier)));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, this.skill);
return textComponents;
}
}

View File

@@ -1,16 +1,20 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.unarmed.Unarmed;
import com.gmail.nossr50.util.Permissions;
public class UnarmedCommand extends SkillCommand {
private String berserkLength;
private String berserkLengthEndurance;
@@ -29,11 +33,18 @@ public class UnarmedCommand extends SkillCommand {
private boolean canIronGrip;
public UnarmedCommand() {
super(SkillType.UNARMED);
super(PrimarySkillType.UNARMED);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// UNARMED_ARROW_DEFLECT
if (canDeflect) {
String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT);;
deflectChance = deflectStrings[0];
deflectChanceLucky = deflectStrings[1];
}
// BERSERK
if (canBerserk) {
String[] berserkStrings = calculateLengthDisplayValues(player, skillValue);
@@ -41,28 +52,21 @@ public class UnarmedCommand extends SkillCommand {
berserkLengthEndurance = berserkStrings[1];
}
// DISARM
// UNARMED_DISARM
if (canDisarm) {
String[] disarmStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DISARM, isLucky);
String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM);;
disarmChance = disarmStrings[0];
disarmChanceLucky = disarmStrings[1];
}
// DEFLECT
if (canDeflect) {
String[] deflectStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DEFLECT, isLucky);
deflectChance = deflectStrings[0];
deflectChanceLucky = deflectStrings[1];
}
// IRON ARM
if (canIronArm) {
ironArmBonus = Math.min(Unarmed.ironArmMinBonusDamage + ((int) skillValue / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
ironArmBonus = UserManager.getPlayer(player).getUnarmedManager().getIronArmDamage();
}
// IRON GRIP
if (canIronGrip) {
String[] ironGripStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.IRON_GRIP, isLucky);
String[] ironGripStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_IRON_GRIP);
ironGripChance = ironGripStrings[0];
ironGripChanceLucky = ironGripStrings[1];
}
@@ -70,66 +74,60 @@ public class UnarmedCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canBerserk = Permissions.berserk(player);
canIronArm = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.IRON_ARM);
canDeflect = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DEFLECT);
canDisarm = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DISARM);
canIronGrip = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.IRON_GRIP);
canBerserk = RankUtils.hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && Permissions.berserk(player);
canIronArm = canUseSubskill(player, SubSkillType.UNARMED_IRON_ARM_STYLE);
canDeflect = canUseSubskill(player, SubSkillType.UNARMED_ARROW_DEFLECT);
canDisarm = canUseSubskill(player, SubSkillType.UNARMED_DISARM);
canIronGrip = canUseSubskill(player, SubSkillType.UNARMED_IRON_GRIP);
// TODO: Apparently we forgot about block cracker?
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canBerserk) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.0"), LocaleLoader.getString("Unarmed.Effect.1")));
}
// TODO: Apparently we forgot about block cracker?
if (canDisarm) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.2"), LocaleLoader.getString("Unarmed.Effect.3")));
}
if (canIronArm) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.4"), LocaleLoader.getString("Unarmed.Effect.5")));
}
if (canDeflect) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.6"), LocaleLoader.getString("Unarmed.Effect.7")));
}
if (canIronGrip) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.8"), LocaleLoader.getString("Unarmed.Effect.9")));
}
return messages;
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canDeflect) {
messages.add(getStatMessage(SubSkillType.UNARMED_ARROW_DEFLECT, deflectChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.ArrowDeflect", deflectChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
}
if (canBerserk) {
messages.add(getStatMessage(SubSkillType.UNARMED_BERSERK, berserkLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
//messages.add(LocaleLoader.getString("Unarmed.Ability.Berserk.Length", berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
}
if (canDisarm) {
messages.add(getStatMessage(SubSkillType.UNARMED_DISARM, disarmChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.Disarm", disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
}
if (canIronArm) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus)));
}
if (canDeflect) {
messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.ArrowDeflect", deflectChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
}
if (canDisarm) {
messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.Disarm", disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
}
if (canIronGrip) {
messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.UNARMED_IRON_GRIP, ironGripChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
}
if (canBerserk) {
messages.add(LocaleLoader.getString("Unarmed.Ability.Berserk.Length", berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
if(canUseSubskill(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamage(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.UNARMED);
return textComponents;
}
}

View File

@@ -1,16 +1,18 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class WoodcuttingCommand extends SkillCommand {
private String treeFellerLength;
private String treeFellerLengthEndurance;
@@ -20,77 +22,74 @@ public class WoodcuttingCommand extends SkillCommand {
private boolean canTreeFell;
private boolean canLeafBlow;
private boolean canDoubleDrop;
private boolean canSplinter;
private boolean canBarkSurgeon;
private boolean canNaturesBounty;
public WoodcuttingCommand() {
super(SkillType.WOODCUTTING);
super(PrimarySkillType.WOODCUTTING);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
protected void dataCalculations(Player player, float skillValue) {
// DOUBLE DROPS
if (canDoubleDrop) {
setDoubleDropClassicChanceStrings(player);
}
// TREE FELLER
if (canTreeFell) {
String[] treeFellerStrings = calculateLengthDisplayValues(player, skillValue);
treeFellerLength = treeFellerStrings[0];
treeFellerLengthEndurance = treeFellerStrings[1];
}
}
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS, isLucky);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
private void setDoubleDropClassicChanceStrings(Player player) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER);;
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
@Override
protected void permissionsCheck(Player player) {
canTreeFell = Permissions.treeFeller(player);
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canLeafBlow = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.LEAF_BLOWER);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canTreeFell) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.0"), LocaleLoader.getString("Woodcutting.Effect.1")));
}
if (canLeafBlow) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.2"), LocaleLoader.getString("Woodcutting.Effect.3")));
}
if (canDoubleDrop) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.4"), LocaleLoader.getString("Woodcutting.Effect.5")));
}
return messages;
canTreeFell = RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(player);
canDoubleDrop = canUseSubskill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
canLeafBlow = canUseSubskill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON);
canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canLeafBlow) {
int leafBlowerUnlockLevel = AdvancedConfig.getInstance().getLeafBlowUnlockLevel();
if (skillValue < leafBlowerUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Woodcutting.Ability.Locked.0", leafBlowerUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Woodcutting.Ability.0"), LocaleLoader.getString("Woodcutting.Ability.1")));
}
}
if (canDoubleDrop) {
messages.add(LocaleLoader.getString("Woodcutting.Ability.Chance.DDrop", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
messages.add(getStatMessage(SubSkillType.WOODCUTTING_HARVEST_LUMBER, doubleDropChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
}
if (canLeafBlow) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Woodcutting.Ability.0"), LocaleLoader.getString("Woodcutting.Ability.1")));
}
if (canTreeFell) {
messages.add(LocaleLoader.getString("Woodcutting.Ability.Length", treeFellerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", treeFellerLengthEndurance) : ""));
messages.add(getStatMessage(SubSkillType.WOODCUTTING_TREE_FELLER, treeFellerLength)
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", treeFellerLengthEndurance) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.WOODCUTTING);
return textComponents;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,14 @@
package com.gmail.nossr50.config;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Set;
public abstract class AutoUpdateConfigLoader extends ConfigLoader {
public AutoUpdateConfigLoader(String relativePath, String fileName) {
super(relativePath, fileName);
@@ -24,7 +21,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
@Override
protected void loadFile() {
super.loadFile();
FileConfiguration internalConfig = YamlConfiguration.loadConfiguration(plugin.getResource(fileName));
FileConfiguration internalConfig = YamlConfiguration.loadConfiguration(plugin.getResourceAsReader(fileName));
Set<String> configKeys = config.getKeys(true);
Set<String> internalConfigKeys = internalConfig.getKeys(true);
@@ -44,8 +41,8 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
}
for (String key : oldKeys) {
plugin.debug("Removing unused key: " + key);
config.set(key, null);
plugin.debug("Detected potentially unused key: " + key);
//config.set(key, null);
}
for (String key : newKeys) {
@@ -69,7 +66,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
try {
// Read internal
BufferedReader reader = new BufferedReader(new InputStreamReader(plugin.getResource(fileName)));
HashMap<String, String> comments = new HashMap<String, String>();
LinkedHashMap<String, String> comments = new LinkedHashMap<String, String>();
String temp = "";
String line;
@@ -80,6 +77,15 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
else if (line.contains(":")) {
line = line.substring(0, line.indexOf(":") + 1);
if (!temp.isEmpty()) {
if(comments.containsKey(line)) {
int index = 0;
while(comments.containsKey(line + index)) {
index++;
}
line = line + index;
}
comments.put(line, temp);
temp = "";
}
@@ -87,9 +93,20 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
}
// Dump to the new one
HashMap<String, Integer> indexed = new HashMap<String, Integer>();
for (String key : comments.keySet()) {
if (output.contains(key)) {
output = output.substring(0, output.indexOf(key)) + comments.get(key) + output.substring(output.indexOf(key));
String actualkey = key.substring(0, key.indexOf(":") + 1);
int index = 0;
if(indexed.containsKey(actualkey)) {
index = indexed.get(actualkey);
}
boolean isAtTop = !output.contains("\n" + actualkey);
index = output.indexOf((isAtTop ? "" : "\n") + actualkey, index);
if (index >= 0) {
output = output.substring(0, index) + "\n" + comments.get(key) + output.substring(isAtTop ? index : index + 1);
indexed.put(actualkey, index + comments.get(key).length() + actualkey.length() + 1);
}
}
}

View File

@@ -1,20 +1,19 @@
package com.gmail.nossr50.config;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.TreeSpecies;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import com.gmail.nossr50.database.SQLDatabaseManager.PoolIdentifier;
import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class Config extends AutoUpdateConfigLoader {
private static Config instance;
@@ -32,6 +31,11 @@ public class Config extends AutoUpdateConfigLoader {
return instance;
}
@Override
protected void loadKeys() {
}
@Override
protected boolean validateKeys() {
// Validate all the settings!
@@ -58,7 +62,7 @@ public class Config extends AutoUpdateConfigLoader {
}
/* Scoreboards */
if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) {
/*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) {
reason.add("Scoreboard.Types.Rank.Display_Time should be greater than 0, or -1!");
}
@@ -96,7 +100,7 @@ public class Config extends AutoUpdateConfigLoader {
if (!(getInspectUseChat() || getInspectUseBoard())) {
reason.add("Either Board or Print in Scoreboard.Types.Inspect must be true!");
}
}*/
/* Database Purging */
if (getPurgeInterval() < -1) {
@@ -178,8 +182,8 @@ public class Config extends AutoUpdateConfigLoader {
reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!");
}
if (getDetonatorItem() == null) {
reason.add("Skills.Mining.Detonator_Item is invalid!");
if (getFishingLureModifier() < 0) {
reason.add("Abilities.Fishing.Lure_Modifier should be at least 0!");
}
if (getRepairAnvilMaterial() == null) {
@@ -233,14 +237,18 @@ public class Config extends AutoUpdateConfigLoader {
return noErrorsInConfig(reason);
}
@Override
protected void loadKeys() {}
/*
* GENERAL SETTINGS
*/
public boolean isAprilFoolsAllowed() { return config.getBoolean("General.AprilFoolsEvent", true); }
/* General Settings */
public boolean getIsMetricsEnabled() { return config.getBoolean("Metrics.bstats", true); }
//Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
public boolean getIsRetroMode() { return config.getBoolean("General.RetroMode.Enabled", true); }
public String getLocale() { return config.getString("General.Locale", "en_us"); }
public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
public boolean getShowProfileLoadedMessage() { return config.getBoolean("General.Show_Profile_Loaded", true); }
@@ -265,6 +273,8 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); }
public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); }
public boolean getMobHealthbarEnabled() { return config.getBoolean("Mob_Healthbar.Enabled", true); }
/* Mob Healthbar */
public MobHealthbarType getMobHealthbarDefault() {
try {
@@ -278,8 +288,10 @@ public class Config extends AutoUpdateConfigLoader {
public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); }
/* Scoreboards */
public boolean getScoreboardsEnabled() { return config.getBoolean("Scoreboard.UseScoreboards", true); }
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); }
public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); }
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); }
@@ -329,6 +341,7 @@ public class Config extends AutoUpdateConfigLoader {
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
public int getMySQLMaxConnections(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); }
public int getMySQLMaxPoolSize(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); }
public boolean getMySQLSSL() { return config.getBoolean("MySQL.Server.SSL", true); }
private String getStringIncludingInts(String key) {
String str = config.getString(key);
@@ -344,16 +357,16 @@ public class Config extends AutoUpdateConfigLoader {
}
/* Hardcore Mode */
public boolean getHardcoreStatLossEnabled(SkillType skillType) { return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(skillType.toString()), false); }
public void setHardcoreStatLossEnabled(SkillType skillType, boolean enabled) { config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(skillType.toString()), enabled); }
public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); }
public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); }
public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); }
public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); }
public int getHardcoreDeathStatPenaltyLevelThreshold() { return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); }
public boolean getHardcoreVampirismEnabled(SkillType skillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), false); }
public void setHardcoreVampirismEnabled(SkillType skillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), enabled); }
public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); }
public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); }
public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); }
public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); }
@@ -372,23 +385,29 @@ public class Config extends AutoUpdateConfigLoader {
public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); }
public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); }
public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); }
public boolean getChimaeraUseBedSpawn() { return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); }
public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); }
public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); }
public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); }
public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); }
public boolean getFluxPickaxeSoundEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); }
/* Particles */
public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); }
public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); }
public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
public boolean getFluxEffectEnabled() { return config.getBoolean("Particles.Flux", true); }
public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); }
public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); }
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); }
public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); }
// public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); }
/* PARTY SETTINGS */
public boolean getPartyFriendlyFire() { return config.getBoolean("Party.FriendlyFire", false);}
public int getPartyMaxSize() {return config.getInt("Party.MaxSize", -1); }
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
@@ -424,12 +443,14 @@ public class Config extends AutoUpdateConfigLoader {
*/
/* General Settings */
public boolean getUrlLinksEnabled() { return config.getBoolean("Commands.Skills.URL_Links"); }
public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); }
public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); }
public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
public boolean getAbilitiesGateEnabled() { return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); }
public int getCooldown(AbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
public int getMaxLength(AbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
public int getCooldown(SuperAbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
public int getMaxLength(SuperAbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
/* Durability Settings */
public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 1); }
@@ -440,16 +461,18 @@ public class Config extends AutoUpdateConfigLoader {
/*
* SKILL SETTINGS
*/
public boolean getDoubleDropsEnabled(SkillType skill, Material material) { return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Bonus_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
public boolean getDoubleDropsDisabled(SkillType skill) {
public boolean getDoubleDropsDisabled(PrimarySkillType skill) {
String skillName = StringUtils.getCapitalized(skill.toString());
ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName);
ConfigurationSection section = config.getConfigurationSection("Bonus_Drops." + skillName);
if (section == null)
return false;
Set<String> keys = section.getKeys(false);
boolean disabled = true;
for (String key : keys) {
if (config.getBoolean("Double_Drops." + skillName + "." + key)) {
if (config.getBoolean("Bonus_Drops." + skillName + "." + key)) {
disabled = false;
break;
}
@@ -458,6 +481,9 @@ public class Config extends AutoUpdateConfigLoader {
return disabled;
}
/* Axes */
public int getAxesGate() { return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); }
/* Acrobatics */
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
public int getXPAfterTeleportCooldown() { return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); }
@@ -471,10 +497,14 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); }
public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); }
public double getFishingLureModifier() { return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); }
/* Mining */
public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); }
/* Excavation */
public int getExcavationGate() { return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); }
/* Repair */
public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); }
public boolean getRepairAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); }
@@ -492,6 +522,11 @@ public class Config extends AutoUpdateConfigLoader {
/* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
public boolean getUnarmedItemPickupDisabled() { return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); }
public boolean getUnarmedItemsAsUnarmed() { return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); }
public int getUnarmedGate() { return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); }
/* Swords */
public int getSwordsGate() { return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); }
/* Taming */
public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); }
@@ -502,12 +537,11 @@ public class Config extends AutoUpdateConfigLoader {
public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); }
/* Woodcutting */
public boolean getWoodcuttingDoubleDropsEnabled(TreeSpecies species) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); }
public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { return config.getBoolean("Bonus_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); }
public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); }
public int getWoodcuttingGate() { return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); }
/* AFK Leveling */
public boolean getAcrobaticsPreventAFK() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
public int getAcrobaticsAFKMaxTries() { return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); }
public boolean getHerbalismPreventAFK() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
/* Level Caps */
@@ -516,12 +550,21 @@ public class Config extends AutoUpdateConfigLoader {
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
public int getLevelCap(SkillType skill) {
public int getLevelCap(PrimarySkillType skill) {
int cap = config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Level_Cap");
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
/*public int isSuperAbilityUnlocked(PrimarySkillType skill) {
return config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Ability_Activation_Level_Gate");
}*/
public boolean getTruncateSkills() { return config.getBoolean("General.TruncateSkills", false); }
/* PVP & PVE Settings */
public boolean getPVPEnabled(SkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); }
public boolean getPVEEnabled(SkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); }
public boolean getPVPEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); }
public boolean getPVEEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); }
//public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); }
}

View File

@@ -1,12 +1,11 @@
package com.gmail.nossr50.config;
import java.io.File;
import java.util.List;
import com.gmail.nossr50.mcMMO;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import com.gmail.nossr50.mcMMO;
import java.io.File;
import java.util.List;
public abstract class ConfigLoader {
protected static final mcMMO plugin = mcMMO.p;

View File

@@ -0,0 +1,59 @@
package com.gmail.nossr50.config;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.util.StringUtils;
public class CoreSkillsConfig extends AutoUpdateConfigLoader {
private static CoreSkillsConfig instance;
public CoreSkillsConfig()
{
super("coreskills.yml");
validate();
}
@Override
protected void loadKeys() {
}
public static CoreSkillsConfig getInstance()
{
if(instance == null)
return new CoreSkillsConfig();
return instance;
}
@Override
protected boolean validateKeys() {
return true;
}
/*
* Skill Settings
*/
/**
* Whether or not a skill is enabled
* Defaults true
* @param abstractSubSkill SubSkill definition to check
* @return true if subskill is enabled
*/
public boolean isSkillEnabled(AbstractSubSkill abstractSubSkill)
{
return config.getBoolean(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString())+"."+ abstractSubSkill.getConfigKeyName()+".Enabled", true);
}
/**
* Whether or not this primary skill is enabled
* @param primarySkillType target primary skill
* @return true if enabled
*/
public boolean isPrimarySkillEnabled(PrimarySkillType primarySkillType)
{
return config.getBoolean(StringUtils.getCapitalized(primarySkillType.toString())+".Enabled", true);
}
}

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