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

Compare commits

...

401 Commits

Author SHA1 Message Date
nossr50
16451550b5 Updating other locale files. 2012-03-03 23:45:39 -08:00
nossr50
c2dc28c2bd Fixing Mining 2012-03-03 23:44:40 -08:00
GJ
c48ac9f596 Mining guide done.
We probably need to clean all these up a bit more later...
2012-03-04 02:41:14 -05:00
nossr50
dfba78a4cb Tweaked changelog 2012-03-03 21:42:28 -08:00
nossr50
a9eed7c31c Replaced unwritten guides with coming soon msg. 2012-03-03 21:36:58 -08:00
nossr50
a9a7719096 Another linebreak for Acrobatics. 2012-03-03 15:24:54 -08:00
nossr50
5038fbadb0 Acrobatics done. 2012-03-03 15:21:39 -08:00
nossr50
a85ca2c984 All thats left is to fill in the locale with information 2012-03-03 13:29:39 -08:00
nossr50
e6e7f10a05 Inform players when they type /skillname that there is a guide 2012-03-03 13:05:52 -08:00
nossr50
212f6ee773 Now you don't need to specify a page number. 2012-03-03 13:04:12 -08:00
nossr50
53d38cc54c Changed some wording for Excavation ? 2012-03-03 13:02:11 -08:00
nossr50
a53c8d5c64 Completed Excavation ? 2012-03-03 12:58:16 -08:00
nossr50
94a02c9a2e Manual merging commence... Merge branch 'master' of github.com:mcMMO-Dev/mcMMO
Conflicts:
	src/main/resources/locale/locale_en_us.properties
2012-03-03 12:45:57 -08:00
nossr50
07699fa651 Excavation ? WIP 2012-03-03 12:43:50 -08:00
GJ
0aaf02f208 LOCALE ALL THE THINGS! 2012-03-03 14:48:40 -05:00
GJ
0dd9bc1cda Cleaned out more traces of old event system. 2012-03-03 14:13:33 -05:00
nossr50
ccfce843be Updated changelog. for loops > while loops 2012-03-03 10:39:18 -08:00
GJ
cb3bc755a6 Remove MySpawn info from locale files. 2012-03-03 13:35:01 -05:00
GJ
719081a77e Removed some unneeded imports. 2012-03-03 13:30:08 -05:00
nossr50
d1c4efa30d Finalized page system. Moved grabbing pages to Page.java. 2012-03-03 10:24:47 -08:00
nossr50
12fbaa4361 Wip of Skill Help pages, code is ugly but it works. 2012-03-03 09:54:16 -08:00
nossr50
abcd586daa Merge pull request #190 from bm01/master
Taming prevent damage fix
2012-03-03 07:08:16 -08:00
bm01
2f0a3eaadd Taming prevent damage fix 2012-03-03 15:15:30 +01:00
GJ
1814d52680 Starting work on skill help pages. (Excavation) 2012-03-03 01:22:52 -05:00
nossr50
d3ed6bb139 break; break; break; 2012-03-02 17:34:15 -08:00
GJ
8eaa58040e Fixed ShakeMob ability not working. 2012-03-02 20:04:15 -05:00
nossr50
04e2a212d1 Silly git 2012-03-02 16:55:54 -08:00
nossr50
fe7ca65f22 dealDamage() will now send fake EntityDamageEvent which mcMMO will ignore 2012-03-02 16:53:35 -08:00
nossr50
89ab87b6dd Fixed Greater Impact not dealing damage, nerf'd Axes critical chance. 2012-03-02 16:46:38 -08:00
nossr50
e933fbe1bd Removing debug message 2012-03-02 16:36:31 -08:00
nossr50
cb9a9282dd Moving the FakeEntityDamageByEntity event to the top of the listener 2012-03-02 16:34:35 -08:00
nossr50
14f1a91eeb Fixed PVE experience gains not leveling up skills 2012-03-02 16:24:28 -08:00
nossr50
1756031eda Changed pom ver # to 1.3.02 removed ocelots from Taming xp gain 2012-03-02 15:58:40 -08:00
nossr50
bccb321ce1 Fixing isInvincible() thanks bm01! 2012-03-02 15:52:33 -08:00
nossr50
920f091a85 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-03-02 15:39:14 -08:00
nossr50
c1103a52f0 Too many exploits, need to finalize this as a bugfix 1.3.02 2012-03-02 15:38:50 -08:00
nossr50
4f128ebbef Merge pull request #189 from bm01/master
Impact fix
2012-03-02 15:22:19 -08:00
bm01
3f5b2bdcee Impact fix 2012-03-02 23:22:41 +01:00
nossr50
288e82fbc3 Setup locale for Axe Splintering message 2012-03-02 12:39:18 -08:00
nossr50
feb073d159 Damage from failed Tree Feller is now random (but never kills) 2012-03-02 12:35:12 -08:00
nossr50
505df87014 Finalized durability stuff in tree feller. XP nerf only for jungle now. 2012-03-02 12:31:53 -08:00
nossr50
f6221c1c34 More tweaks to durability stuff in tree feller 2012-03-02 12:19:57 -08:00
nossr50
0a97c1dc62 Updating Tree Feller to use .getMaxDurability() API calls 2012-03-02 11:31:30 -08:00
nossr50
05cea84dcc Can only seem to make the axe splinter some of the time.. 2012-03-02 11:22:29 -08:00
nossr50
1ac544511c Added updateInventory() to Tree Feller 2012-03-02 11:07:20 -08:00
nossr50
292f14bf87 Updated changelog about tree feller 2012-03-02 11:02:55 -08:00
nossr50
ef17ea6231 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-03-02 11:02:05 -08:00
nossr50
75c49497ac Nerf tree feller XP. You need durability to use tree feller now. 2012-03-02 11:01:09 -08:00
GJ
f9b9dddbc8 Updates to Taming 2012-03-02 13:55:53 -05:00
GJ
5a8b9fc344 Changes to Blast Mining method calls. 2012-03-02 13:55:53 -05:00
nossr50
e9dae0d633 Changelog update 2012-03-02 10:30:10 -08:00
nossr50
1c866a52e5 Reworking our invincibility checks to accomodate for vanilla mc behaviour 2012-03-02 10:18:23 -08:00
nossr50
2f5edb6329 Removing redundancy 2012-03-02 09:40:04 -08:00
nossr50
30e5410906 Adding break; to switch in onEntityDamage 2012-03-02 09:37:55 -08:00
nossr50
4f2a0b8260 Updating onEntityDamageByEntity event listener 2012-03-02 09:35:52 -08:00
GJ
882a457484 Listen to EntityDamageByEntity subevents 2012-03-02 12:19:53 -05:00
GJ
ed5531d44b Cleanup EntityListener.java 2012-03-02 12:13:35 -05:00
GJ
b2989a8bab Added Ocelots to Taming XP tables. 2012-03-02 10:43:08 -05:00
GJ
c032a27d63 Changed Ignition to add fire ticks rather than replace them. (Thanks
bm01!)
2012-03-02 10:11:54 -05:00
GJ
353ceefd4e Changed POM to use latest build. 2012-03-02 10:04:20 -05:00
nossr50
9a7ea3b6d0 Fixed bug where Tree Feller had no cooldown whatsoever. GJJJJ!!!! 2012-03-01 15:52:21 -08:00
nossr50
6a79d9f244 Minor changelog tweak, don't bother promoting this one. 2012-03-01 14:26:40 -08:00
nossr50
2151fbb6c0 Finishing touches on BM 2012-03-01 14:15:16 -08:00
nossr50
3945a681a3 ENUM all the things! 2012-03-01 14:10:50 -08:00
nossr50
592382a5d3 When in doubt use a for loop 2012-03-01 14:09:06 -08:00
GJ
72bfe63ebf Minor tweak to Blast Mining. 2012-03-01 17:04:45 -05:00
nossr50
6d883821a8 Fix for Blast Mining XP (hopefully) 2012-03-01 14:02:23 -08:00
GJ
415786d67e XP gain for Blast Mining. 2012-03-01 16:50:54 -05:00
nossr50
d8aa3a5f14 Updated locale 2012-03-01 13:02:54 -08:00
nossr50
f5fc941916 Cooldowns for Blast Mining are now fully functional (BUILD IS SAFE AGAIN) 2012-03-01 13:01:41 -08:00
GJ
8254a8ab0f Updates to Blast Mining. 2012-03-01 15:33:03 -05:00
nossr50
fadbaf429d Beginning work on cooldowns for BlastMining (DO NOT USE THIS BUILD) 2012-03-01 12:20:35 -08:00
nossr50
a80507078d Taming locale updates 2012-03-01 11:42:44 -08:00
GJ
d13549ff6a Updates to Blast Mining. 2012-03-01 14:37:34 -05:00
nossr50
0f89a9e1e8 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-03-01 10:08:37 -08:00
nossr50
c8f2521670 Updated /mcmmo to be more useful and up to date 2012-03-01 10:08:13 -08:00
GJ
32135d5647 Removed Milking/Shearing from Taming - too easy to abuse 2012-03-01 12:24:30 -05:00
nossr50
dc5b37d560 Fix for dropping AIR 2012-03-01 08:34:56 -08:00
nossr50
e873902e1b Fixing another disarm bug (thanks bm01) 2012-03-01 08:03:29 -08:00
nossr50
fe21aa0aa9 Updating plugin.yml description nodes 2012-03-01 07:32:13 -08:00
GJ
19842ebc35 Update POM to use 1.1-R6 Bukkit 2012-03-01 10:15:12 -05:00
nossr50
ee1e128c5a Changed to dealDamage() 2012-03-01 06:48:59 -08:00
nossr50
d099bc562b Fixed Disarm not working ever 2012-02-29 16:27:58 -08:00
nossr50
69dfd5645a Fixing my fix of Unarmed command display 2012-02-29 16:16:38 -08:00
nossr50
5db7225bc4 Fixing skill messages, fixing unarmed command display 2012-02-29 16:13:15 -08:00
nossr50
80374333b6 Abilities send messages to nearby players when they wear off. 2012-02-29 16:04:31 -08:00
nossr50
885ec70d28 Updated locale 2012-02-29 15:45:09 -08:00
nossr50
8d00468412 Axes gains bonus DMG every 50 levels like Unarmed now. 2012-02-29 15:40:16 -08:00
nossr50
5d9ac614c2 That was too OP. Disarm is 1.5x the rate of 1.2.12 now. 2012-02-29 15:24:03 -08:00
nossr50
0f8a418efd More work on Impact. Tweaked Unarmed's disarm chance to be 2x better. 2012-02-29 15:22:03 -08:00
nossr50
ed2e9a993d Removing whitespace 2012-02-29 13:54:43 -08:00
nossr50
f689f048b2 Updated changelog again 2012-02-29 13:19:22 -08:00
nossr50
906bc01b91 Inspect now checks if player exists in Database 2012-02-29 13:02:24 -08:00
nossr50
4641e4701c Updating usage statistic to work with R5 2012-02-29 12:41:03 -08:00
nossr50
88e40080fb Making Inspect work on offline players 2012-02-29 12:33:33 -08:00
nossr50
e0fa23359f Removed /mcstats usage from console (use inspect instead) 2012-02-29 12:15:23 -08:00
nossr50
4ab71bcf36 Fixed inspect not working from console 2012-02-29 12:07:47 -08:00
nossr50
652a27eb38 Starting work on Impact subskill for Axes 2012-02-29 11:56:15 -08:00
nossr50
d56fe82bfd Updating changelog 2012-02-29 09:29:23 -08:00
nossr50
6c20df7839 Finished changes to Whois -> Inspect 2012-02-29 09:25:48 -08:00
nossr50
423eb97e0f Reverting casting in onEntityDeath 2012-02-29 09:23:04 -08:00
nossr50
0b43dd2747 Replacing Whois command with Inspect command 2012-02-29 09:20:58 -08:00
nossr50
f2fccd4a64 Add casting to onEntityDeath 2012-02-29 09:11:45 -08:00
GJ
a7292c3a2c Fixed typo in config.yml 2012-02-29 11:25:15 -05:00
GJ
0c1072f7cf Changes due to updates to EntityType returned by certain Entity events. 2012-02-29 11:03:24 -05:00
GJ
cea80f98e8 Updates for config files. 2012-02-29 10:45:55 -05:00
GJ
985e69c529 Fixes for Treasures config & Chimera Wing. 2012-02-29 09:59:25 -05:00
nossr50
a2b3e6fa83 Fixed treasures config NPE 2012-02-28 21:00:28 -08:00
GJ
ee986970fe Moving treasures to their own config file.
BUILD IS BROKEN, DO NOT USE.
2012-02-28 23:28:36 -05:00
nossr50
345fa122c5 Added info about the change to getDistance() to changelog 2012-02-28 19:50:18 -08:00
NuclearW
fae5693db8 Merge pull request #187 from bm01/replace-getdistance
Replacement of m.getDistance()
2012-02-28 19:45:16 -08:00
bm01
093f368545 Replaced m.getDistance() 2012-02-29 03:26:19 +01:00
nossr50
a41fc22899 Added MySpawn removal info to changelog 2012-02-28 16:52:47 -08:00
nossr50
5f51f7f9b0 Further removing MySpawn stuff 2012-02-28 15:19:43 -08:00
nossr50
de2a0403d2 Remove MySpawn from DB if exists 2012-02-28 15:15:03 -08:00
GJ
e2d13034a8 Kill it with fire, part 1 - MySpawn 2012-02-28 18:01:35 -05:00
GJ
e55006f662 Fixed the fact that myspawn would clear if you broke ANY bed (not just
your own) - Addresses MCCORE-50
2012-02-28 17:06:13 -05:00
GJ
64b46a88c9 Breaking a bed now clears your spawn, just as if you had used the
/clearmyspawn command.
2012-02-28 16:52:16 -05:00
nossr50
69b7c3077f Tweaked mcremove 2012-02-28 12:53:27 -08:00
nossr50
f158858262 Updated changelog. 2012-02-28 12:36:55 -08:00
nossr50
7aa7de75a2 Made mcremove work for FlatFile (sort of). 2012-02-28 12:33:57 -08:00
nossr50
6cc22a3b63 mcremove command is now fully functional for MySQL 2012-02-28 12:16:23 -08:00
nossr50
649ce1c147 Forgot to commit this, file renamed. 2012-02-28 11:19:12 -08:00
nossr50
1281843d45 Removing redundancy in most commands 2012-02-28 11:17:54 -08:00
nossr50
e31aea3492 Beginning work on mcremove 2012-02-28 11:05:48 -08:00
GJ
26e3403ff4 Fixed Call of The Wild & RIGHT_CLICK_AIR tool activation not working.
Apparently we can't use ignoreCancelled=true on PlayerInteractEvent...
2012-02-28 09:27:14 -05:00
GJ
e5922bf3e7 Fixed my brakes. >.< 2012-02-28 00:18:55 -05:00
GJ
2b9baaf0ea Possible fix for not registering right click air events. 2012-02-27 23:38:33 -05:00
GJ
8ad4e20cab Fixed leaving out a logical check for new skill processing. (Oops.) 2012-02-27 20:40:25 -05:00
GJ
1511c5737b Fixed missing return calls in ToolType.java 2012-02-27 17:37:43 -05:00
GJ
57bf414d59 OPTIMIZE ALL THE SKILLS!
Adds some cool enum features & cleans up Skills.java - may possibly
break some message displays for Axes & Woodcutting.
2012-02-27 17:28:47 -05:00
nossr50
16a0a3364a NPE fix for Bleed Simulation (hopefully) 2012-02-27 07:56:12 -08:00
nossr50
d09512373b Added an isConnected() method 2012-02-27 05:27:59 -08:00
nossr50
dfd1e311d1 Updated changelog 2012-02-27 05:23:56 -08:00
nossr50
26c9ba0c3b Major optimization to how MySQL connection is handled. 2012-02-27 05:20:55 -08:00
nossr50
d7d1d0b58d Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-27 03:53:46 -08:00
nossr50
a0ab16eaa7 Minor tweaks to BleedSimulate() 2012-02-27 03:53:15 -08:00
GJ
cae4b47538 Updates to Unarmed 2012-02-26 14:38:55 -05:00
GJ
dd445dbac5 Updates to Combat - Breaks R4 Compatability. 2012-02-26 14:38:03 -05:00
nossr50
4b26732f51 Removed redundancy 2012-02-26 04:15:50 -08:00
nossr50
bf38fc9819 Merge pull request #184 from bm01/master
Optimization in combatChecks()
2012-02-26 04:07:58 -08:00
bm01
aff6b0925f Optimization in Combat.java 2012-02-26 13:06:47 +01:00
GJ
a7f259ea3c Moved wolf damage checks to Taming.java 2012-02-26 02:38:07 -05:00
GJ
3a1ee58339 Added custom values for mob combat multipliers. 2012-02-26 01:53:54 -05:00
GJ
6b0c46b634 Minor updates/optimizations to PlayerListener 2012-02-26 00:05:32 -05:00
GJ
6b36a030f6 Added back updateInventory() methods.
Even though I updated old inventory methods it still needs these to
reflect the amounts removed...
2012-02-25 21:42:03 -05:00
nossr50
df92c43578 Tweaked changelog 2012-02-25 04:41:53 -08:00
nossr50
f481741bb5 This should make us fully NoCheat compatible. 2012-02-25 04:27:09 -08:00
nossr50
77b0dd725c Fixing unwanted block data changes 2012-02-25 04:07:07 -08:00
nossr50
f850c0ead6 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-25 03:51:49 -08:00
nossr50
7ad9b2ed58 Gutting out the old Party HUD. Lets make a new one. 2012-02-25 03:51:22 -08:00
GJ
695d76dcf4 ENUM ALL THE THINGS! 2012-02-25 02:49:53 -05:00
GJ
19ea6707fe Updated locale files to reflect increases to Blast Mining ore drops. 2012-02-25 00:26:10 -05:00
GJ
649bccb0d0 Added /addlevels command (Implements MCCORE-23) 2012-02-24 21:05:01 -05:00
GJ
73f1c08366 Blast Mining optimization 2012-02-24 18:25:24 -05:00
GJ
b98120192a Removed useless removal checks. 2012-02-24 12:14:35 -05:00
GJ
1cd7181d26 Minor tweaks & fixes. Changed Tree Feller to use custom item drop method
so we fire the event like we're supposed to.
2012-02-24 11:21:07 -05:00
nossr50
fb35e7dd5d Updating changelog. Fixing Herbalism command display. 2012-02-24 07:54:17 -08:00
nossr50
1c4275ce37 Misc formatting. Clarifying something in changelog. 2012-02-24 07:19:55 -08:00
nossr50
3ff9a28fa7 Fixed exploit in Tree Feller 2012-02-24 04:52:30 -08:00
nossr50
04f13ab090 Fixed Tree Feller dropping too many saplings 2012-02-24 03:41:43 -08:00
nossr50
e42b9db159 Fixed bug with Swords command display 2012-02-24 03:37:41 -08:00
nossr50
deb3a3bd48 Fixed bug with Leaf Blower & Tree Feller permission nodes 2012-02-24 03:03:19 -08:00
nossr50
6708947332 Tree Feller is faster. Added limit to tree feller.
Added Jungle Tree to Woodcutting XP Tables.
Renamed Pine to Oak. Modified default Woodcutting XP Tables.
2012-02-24 01:46:34 -08:00
GJ
1f0fcb119d Removed outdated inventory methods 2012-02-24 01:02:23 -05:00
GJ
bdb74d4719 Optimize even more things. 2012-02-23 23:04:41 -05:00
GJ
19ab8b89f5 More optimizing. 2012-02-23 22:26:20 -05:00
GJ
10fa9e5465 Optimize more things. 2012-02-23 21:44:44 -05:00
GJ
1fe259eb7a Archery optimizations. 2012-02-23 21:13:06 -05:00
GJ
cd56dc7f98 Updated changelog 2012-02-23 19:42:22 -05:00
GJ
8cf9601af4 More Repair optimizations. 2012-02-23 19:39:06 -05:00
GJ
b39c02154a Fix Leaf Blower not respecting Shears. (MCCORE-44) 2012-02-23 18:49:56 -05:00
GJ
a2e41f31ed Repair optimizations. LOTS of repair optimizations. 2012-02-23 18:32:32 -05:00
nossr50
5d8b049a45 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-23 10:24:15 -08:00
nossr50
336adf9530 Changed Unarmed to start with a damage bonus 2012-02-23 10:23:04 -08:00
GJ
708cfc23b6 Locale stuff for Blast Mining 2012-02-23 13:09:41 -05:00
NuclearW
06b2a89646 Move to external task
Only remove if we have it to remove
Only add if not already in memory
Don't load something we would immediately unload on removeUser
2012-02-23 11:48:48 -05:00
GJ
b782225dde Removed old Unarmed stuff from locale files. 2012-02-23 11:36:12 -05:00
nossr50
85640f88b2 Stop crying 2012-02-23 08:30:56 -08:00
nossr50
a372ca34e6 Changed how we remove PlayerProfiles to reduce lag 2012-02-23 08:27:36 -08:00
GJ
4acc0b63fd Try that again... 2012-02-23 09:07:51 -05:00
GJ
edf6f7560b Forced POM to update & stop build failures (I hope). 2012-02-23 09:06:00 -05:00
nossr50
66e0cc33bf Change ignition to use Maths 2012-02-23 06:03:49 -08:00
nossr50
498e3eb35c Dat 'y' 2012-02-23 05:44:55 -08:00
nossr50
2aa7e37e13 Reworked Unarmed to be easier to level 2012-02-23 05:38:50 -08:00
GJ
09c5b8727a Events no longer implement Serializable. 2012-02-23 08:31:07 -05:00
GJ
02a67e330a Removed deprecated CreatureType use. 2012-02-23 08:29:34 -05:00
nossr50
37364d6c86 More tweaks to Tree Feller 2012-02-23 01:59:00 -08:00
nossr50
86166a58e1 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-23 01:57:31 -08:00
nossr50
935e494705 Merge pull request #183 from bm01/master
Removed redundant if statement in WoodCutting.java
2012-02-23 01:57:16 -08:00
bm01
94387045e4 Removed redundant if statement 2012-02-23 10:34:34 +01:00
nossr50
20ae2dbeea Updated the changelog again 2012-02-23 00:15:40 -08:00
nossr50
d1b522b534 Green Thumb consumes seeds again
Fixes MCCORE-36
2012-02-23 00:13:55 -08:00
nossr50
89802e23e2 Abilities damage tools again.
Closes MCCORE-30
2012-02-23 00:10:22 -08:00
nossr50
cb4b5d1c71 Tree Feller damages the tool (again) 2012-02-22 23:42:03 -08:00
GJ
472bfa51da Fixed my fix (because Bukkit is stupid & durability counts up). 2012-02-23 02:26:44 -05:00
nossr50
162dbaed0f Removed unused methods from m.java 2012-02-22 23:17:05 -08:00
GJ
6f9fc26ab5 Changed tool ability damage to use built in Bukkit methods. 2012-02-23 02:12:24 -05:00
GJ
b199568ec3 Removed debug messages. 2012-02-23 00:50:45 -05:00
GJ
ff258e0cbf Update changelog. 2012-02-23 00:43:18 -05:00
nossr50
68dd18067e Shutting up an IDE warning. 2012-02-22 21:12:37 -08:00
nossr50
799e11c36c Added temp debug messages about mob spawn removal 2012-02-22 21:00:12 -08:00
nossr50
f274d47c81 Made Tree Feller much less aggressive. 2012-02-22 20:53:20 -08:00
nossr50
ca3b7f2172 Tree Feller now rewards xp based on the type of tree. 2012-02-22 20:25:03 -08:00
nossr50
22c9fca915 Reworked Tree Feller to take down entire tree. 2012-02-22 20:23:42 -08:00
nossr50
e4d312a11f Combat ignores events where entity is dead now. 2012-02-22 18:43:09 -08:00
nossr50
a3f0de1c84 Moved Taming stuff into Taming.java 2012-02-22 18:39:22 -08:00
NuclearW
4826056bbe Cleanup
Monitor is where events that don't need data before other plugins or to cancel go
Ignore cancelled events to respect other protection plugins saying "no"
We need to see if other events are depricated in the future
2012-02-22 19:51:06 -05:00
GJ
6f2f99dda0 Fix for IndexOutOfBounds issue (MCCORE-40) 2012-02-22 17:04:10 -05:00
GJ
d06ec5e452 Get Taming XP for milking cows. 2012-02-22 15:12:01 -05:00
GJ
94cb118a7e Should probably use getMaxHealth() instead of hardcoding... (Addresses
MCCORE-39)
2012-02-22 12:19:22 -05:00
GJ
bebc70634b Fixed Wolves having over max health due to Fast Food Service (Fixes
MCCORE-39)
2012-02-22 12:18:21 -05:00
nossr50
186c9189ca Updated changelog again 2012-02-22 08:35:13 -08:00
nossr50
324b69cba1 Fixed a memory leak I didn't even know about. 2012-02-22 08:32:29 -08:00
nossr50
802af464cd Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-22 08:30:21 -08:00
nossr50
0c8b46acee Change mobspawn track list to use entity id 2012-02-22 08:29:51 -08:00
GJ
182219f00d Added permissions node for Blast Mining - Addresses MCCORE-38 2012-02-22 10:59:39 -05:00
GJ
828f5ad173 Renamed StatsCommand.java to McstatsCommand.java to reflect change to
command name.
2012-02-22 10:27:16 -05:00
nossr50
95da5a4535 Updated changelog to include info about mcstats 2012-02-22 07:03:35 -08:00
nossr50
324bcd9b91 Fix for NPE with mcstats 2012-02-22 07:00:59 -08:00
GJ
98ed75e4e0 Cleaned up some command issues. Renamed /stats to /mcstats for less
plugin conflicts
2012-02-22 09:52:58 -05:00
GJ
3d5bb334f6 Removed all the old Alchemy/Enchanting/Sorcery stuff from the code. 2012-02-22 09:32:08 -05:00
NuclearW
c74f43a1ad Change Changelog to + = ! - system
Cleanup some unneded SuppressWarnings
Monitor is where events that we don't cancel go, also we ignore cancelled events
2012-02-22 06:19:18 -05:00
nossr50
f5451b7d59 Updated 2012-02-21 21:27:38 -08:00
nossr50
3dbaf061ed Added checks on world change for mcgod 2012-02-21 21:25:39 -08:00
nossr50
19ac0e6ba6 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-21 11:23:37 -08:00
nossr50
a509b0e9d3 Removed Master/Apprentice chat spam, and more..
Began modifying party command, still a WIP and probably not working
properly. Modified locale for Taming messages to trim them shorter.
2012-02-21 11:22:31 -08:00
GJ
5c63e9779e Added unlock levels for repairing Iron/Gold/Stone. Added configurable
ranks for Arcane Forging.
2012-02-21 14:19:11 -05:00
GJ
9ef9ffd16f Fishing now uses custom drops. ("Attack of the Giant Config File") 2012-02-21 13:11:06 -05:00
nossr50
93e223b2cc Fix for Taming not leveling up. 2012-02-21 08:54:06 -08:00
GJ
c4a0ae64aa Fixed Excavation not awarding XP unless you found a treasure. 2012-02-21 08:20:08 -05:00
NuclearW
933a7ffc69 4 != 5 2012-02-21 03:17:14 -05:00
GJ
b0253f9913 More fishing stuff. FISHING WILL BE BROKEN TEMPORARILY IN THIS BUILD. 2012-02-21 02:53:34 -05:00
GJ
7eb1d43201 Making fishing drops customizable (WIP) 2012-02-21 02:19:59 -05:00
NuclearW
1f843bc3a2 Validation 2012-02-21 01:31:52 -05:00
GJ
c17bc7d332 Derp. Added that to the changelog twice. 2012-02-21 01:07:37 -05:00
GJ
c308121c47 Added XP for Animal Taming 2012-02-21 01:01:27 -05:00
NuclearW
d0d9868b5f Change priority of sheep shearing
Cleanup
2012-02-21 00:35:09 -05:00
GJ
8f3dce4ee9 Started working on customizing Fishing drops 2012-02-21 00:26:16 -05:00
nossr50
de0a6dd3ee Something odd in PlayerProfile..commenting it out 2012-02-20 17:04:17 -08:00
nossr50
5d06341612 Modified locale to reflect Taming XP gain changes 2012-02-20 16:46:57 -08:00
nossr50
470b29c229 Forgot to change this to pull from the config file 2012-02-20 16:34:55 -08:00
nossr50
c915bb8312 Added Shearing to Taming XP 2012-02-20 16:29:03 -08:00
nossr50
f8869c177f Forgot to put this in the changelog 2012-02-20 15:56:11 -08:00
nossr50
c0a7b276b4 Made many changes to Bleeding. Capped max Bleed ticks at 10. 2012-02-20 15:54:30 -08:00
nossr50
fa35fd9e45 Added Fast Food Service to Taming (Healing) 2012-02-20 15:41:00 -08:00
nossr50
3f8077d615 Ch-ch-ch-CHANGES! (Updated changelog) 2012-02-20 15:07:44 -08:00
nossr50
3b9e85e976 NetherBrick is also not 'Mining' enough for Mining 2012-02-20 15:06:16 -08:00
nossr50
b024b45e02 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-20 14:59:12 -08:00
nossr50
a3cf3401bb Stone Brick isn't 'Mining' enough for Mining
Fixes MCCORE-32
2012-02-20 14:58:24 -08:00
GJ
bc12e0d100 Even more old stuff. (MCCORE-1) 2012-02-20 17:56:50 -05:00
GJ
96be29ef63 Removed more old stuff relating to Excavation drops Addresses MCCORE-1 2012-02-20 17:54:42 -05:00
nossr50
0f2029a32d Reorganized the changelog for 1.3.00-dev 2012-02-20 14:43:12 -08:00
nossr50
aa14c1bc1f Renamed Food+ to Farmer's Diet 2012-02-20 14:38:38 -08:00
nossr50
d052af9207 Completely removed HP Regen settings 2012-02-20 14:18:25 -08:00
NuclearW
ad2ed37d0a Change how we do custom drops
Beginnings of fishing drops
2012-02-20 17:10:37 -05:00
GJ
1943ce884a Updated changelog, removed unused import 2012-02-20 14:07:48 -05:00
GJ
b23fa36543 Allow for configuration of custom Excavation drops (WIP) - Addresses
MCCORE-1
2012-02-20 13:58:22 -05:00
GJ
887f8f3e0c Fixed backwards logic in ShakeMob. 2012-02-20 10:25:10 -05:00
GJ
227b554488 Finished removing unused properties from the config file. 2012-02-19 23:25:48 -05:00
nossr50
20064f36ef Removed the HP Regen setting from config since it's useless. 2012-02-19 20:22:17 -08:00
NuclearW
decdddb9ec Reorganized config.yml and cleaned up
Unfortunately, nobody will see our nice super-pretty config.yml copied out properly just yet
Fortunately, maven filtering dark magic lets us stick in when it was copied out.
2012-02-19 18:53:21 -05:00
NuclearW
1b0fac78ae Move version up
y u move down?
2012-02-19 18:29:57 -05:00
NuclearW
d864a2391e Fix levelcaps causing infinite loop
Resolves MCCORE-28
2012-02-19 14:53:07 -05:00
NuclearW
b08aead536 Changed Tree Feller to not rely on external ArrayList
Given Bukkit's behavior of events, it would have never been possible for more than one player's data to occupy the shared arraylist... Still looked ugly, though.
Also helps toward concurrent events, should they ever come.
Also moved from a static boolean flag to a per-use flag
Also removed unused static variable "w"
2012-02-19 00:54:56 -05:00
nossr50
cca04468de Rebalanced Herbalism hunger bonuses. 2012-02-18 12:51:07 -08:00
GJ
e997c32c6c Remove TNT from BlastMining list onBlockBreak (when not broken by Flint
& Steel)
2012-02-18 11:23:03 -05:00
GJ
a1d5eaa846 Added help menu text for Herbalism hunger bonuses (MCCORE-5) 2012-02-17 19:31:10 -05:00
GJ
4e9333e823 Added option to disable Herbalism hunger bonuses 2012-02-17 17:21:54 -05:00
GJ
b75e7470ae Fixed using || where I should have used && 2012-02-17 14:40:57 -05:00
GJ
484cbccc1b Added Herbalism items to the fastQueue. 2012-02-17 00:02:26 -05:00
NuclearW
5d4d4d3498 Queue still needed
Added in beginnings for fastqueue
2012-02-16 23:37:14 -05:00
GJ
82e34a5b02 Reverted to old method of block tracking - appears to be working again. 2012-02-16 16:56:19 -05:00
GJ
a9b1ebb063 Reenabled BlockListener queue - fixes Herbalism but breaks regular
blocks it would seeem.
2012-02-16 12:55:03 -05:00
GJ
c942feb868 Fixed Tree Feller not playing nice with NoCheat 2012-02-16 12:15:05 -05:00
GJ
7003311b7e Updated changelog. 2012-02-15 18:31:10 -05:00
NuclearW
2549e23fd2 Change p and a chat logging
To be more consistent
2012-02-15 17:31:17 -05:00
NuclearW
40af51fc05 Re-added event calling
Re-added other dealDamage methods
Added FakeEntityDamageByEntityEvent for us to filter our own mess out, this was the issue with Skull Splitter and Serrated Strikes earlier (a loop)
Moved FakeBlockBreakEvent to be with other events
Added configuration option to control event calling
Learned how to changelog
Broke those cuffs
2012-02-15 16:57:48 -05:00
GJ
06d3d8a18f Added hunger bonuses to Herbalism. (Still need to add cake). 2012-02-15 16:27:12 -05:00
NuclearW
992e6bce86 Ignore Cancelled Events
Using new addition to Bukkit event system, should provide some speed increase.
2012-02-15 16:17:29 -05:00
GJ
6e59087f6d Back to development on Blast Mining. 2012-02-14 19:01:33 -05:00
nossr50
e94473b21b Back to active development 2012-02-14 15:32:17 -08:00
nossr50
8da49ba796 Updating changelog 2012-02-14 15:24:12 -08:00
nossr50
bc8f073f3f Fixed mcability not respecting permissions. 2012-02-14 15:21:34 -08:00
nossr50
9589924235 Made Green Terra use Green Thumb for wheat planting. 2012-02-14 14:58:24 -08:00
nossr50
fed21a7cb9 Updated changelog, tweaked Green Thumb if statement. 2012-02-14 14:51:12 -08:00
nossr50
a97783ed86 Removed debug message. 2012-02-14 14:49:06 -08:00
nossr50
7982e33823 Fixed my fix of Green Terra not planting wheat. 2012-02-14 14:47:11 -08:00
nossr50
7cf549ba88 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-14 14:43:53 -08:00
nossr50
0386d52e7c Fixed Green Thumb not planting wheat.
Fixes #133
2012-02-14 14:42:49 -08:00
GJ
e7b763c8ea Added config values for Dirt & Smooth Brick to Green Terra.
Config values are useless when not implemented.
2012-02-14 17:42:12 -05:00
nossr50
c805b17929 Fixed Green Thumb going off when Green Terra is in use. 2012-02-14 14:37:10 -08:00
nossr50
877bf7905b Fix for Green Terra not planting wheat. 2012-02-14 14:27:05 -08:00
nossr50
c45b03b1d8 Yet another commit just for the changelog 2012-02-14 12:51:52 -08:00
nossr50
f4d84dbd52 I dun goof'd the changelog, fixing. 2012-02-14 12:46:14 -08:00
nossr50
28d73a33ab Fixed addxp() taking xprate/skill modifiers into account. 2012-02-14 12:42:20 -08:00
nossr50
9c9247b9c1 Modified changelog 2012-02-14 12:11:51 -08:00
nossr50
50684e9ca0 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-14 12:10:37 -08:00
nossr50
b5e4bebd75 Fixed the negative XP bug on levelup.
Fixes #134
2012-02-14 12:09:02 -08:00
GJ
b9de8e6d13 Updated POM to use Bukkit 1.1-R5 2012-02-14 14:19:19 -05:00
nossr50
939344816e Tweaks to SkullSplitter/SerratedStrikes 2012-02-14 10:33:49 -08:00
GJ
441015d6a5 Updated changelog. 2012-02-14 12:16:49 -05:00
GJ
841832846f Fixed typos in POM & Config.yml 2012-02-14 09:33:52 -05:00
GJ
eb0bf07d2c Updated .gitignore to ignore .jar files 2012-02-14 09:30:54 -05:00
nossr50
fc622dcde2 Forgot to update the changelog. 2012-02-13 19:14:49 -08:00
nossr50
e77be3350f Removed CallEvent from dealDamage(), we don't need it. Fixes #170 2012-02-13 19:09:14 -08:00
nossr50
b4637a825e Updated POM 2012-02-13 18:56:33 -08:00
nossr50
a2fc694c8d Fixed the fix of mmoedit/mcgod working without permissions. 2012-02-13 18:45:34 -08:00
nossr50
06c0b4cc11 Modified changelog a bit. 2012-02-13 17:51:38 -08:00
GJ
ea2ae0b5c3 Confusing changelog fixed. 2012-02-13 17:27:25 -05:00
nossr50
1bf9cfa422 It's probably important to mention this. 2012-02-13 09:43:25 -08:00
nossr50
3d699e612a Changed listener to Highest, reverting some stuff that doesn't work. 2012-02-13 09:31:11 -08:00
nossr50
a202d6168b Forgot to push the new file. 2012-02-13 08:20:33 -08:00
nossr50
786a5f9325 Modified mcMMO's onEntityDamage to have better compatibility. 2012-02-13 08:06:46 -08:00
nossr50
1910b76b13 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2012-02-13 07:31:54 -08:00
GJ
bda72f28ed Fixed fishing skill not working. 2012-02-13 10:26:51 -05:00
nossr50
27e60ef85b Modified onEntityDamage to MONITOR for plugin compatability. 2012-02-13 07:19:31 -08:00
NuclearW
58dc45d344 Change to permissions
Should help #164
2012-02-12 21:15:04 -05:00
GJ
082dcebf9b Updated config.yml to include new mining items.
Not sure how this got missed before now...
2012-02-11 20:31:23 -05:00
NuclearW
a652fcd026 Optional stats tracking
I still don't like stats tracking.
2012-02-11 16:11:04 -05:00
Grant
717c2d2869 Merge pull request #156 from nossr50/master
Added support for Hidendra's Plugin Metrics.
2012-02-11 12:52:11 -08:00
nossr50
3124712cfb Formatted a little nicer 2012-02-11 12:39:41 -08:00
nossr50
081b5f6728 Git you so silly 2012-02-11 12:14:05 -08:00
nossr50
71c14ab07b Added Hidendra's Plugin Metrics to mcMMO. 2012-02-11 12:12:50 -08:00
Grant
900d58a6f4 Merge pull request #154 from nossr50/master
Preparing for 1.2.11 bugfix, made mcmmo save data when shutting down.
2012-02-11 10:29:31 -08:00
nossr50
70756c2a2e Preparing for a bugfix release. Also made sure mcMMO saves info on
shutdown.
2012-02-11 10:21:36 -08:00
Grant
5b40f2e2e9 Merge pull request #152 from nossr50/master
Made xprate give more feedback when used via console
2012-02-11 06:24:04 -08:00
nossr50
3d60c057ea Made xprate give more feedback when used via console 2012-02-11 06:17:57 -08:00
GJ
105b8b5a91 Fixes to several commands & console usage. Fixes Issue #150 2012-02-11 09:01:46 -05:00
NuclearW
9278ca4d27 Watch ourselves for negative xp gain.
Hopefully we'll get more info on the bug if we can't solve it by next release from anyone running a dev build.

Will help on the hunt of issue #98
2012-02-11 00:11:08 -05:00
NuclearW
d97e97ae5f Add McMMOPlayerXpGainEvent
Rename playername to playerName
2012-02-11 00:02:48 -05:00
NuclearW
5cbee8a4ab Make players logging out take damage from bleeding.
Done as per suggestion by nossr50
Closes #131
2012-02-10 23:29:19 -05:00
Grant
fe9db6c9ad Merge pull request #149 from nossr50/master
Possible fix for negative XP bug.
2012-02-10 16:32:24 -08:00
nossr50
a4845abc45 Possible fix for negative XP bug. 2012-02-10 11:58:58 -08:00
Grant
470b29eeca Merge pull request #148 from nossr50/master
Fixed the instant refresh bug. Fixed blockListener monitoring skills.
2012-02-10 09:59:11 -08:00
nossr50
f87f7f6feb Fixed the instant refresh bug. Fixed blockListener checking skills. 2012-02-10 09:44:17 -08:00
TheYeti
5e8a8aac53 Fix adding in to much copypasta 2012-02-10 03:07:43 -08:00
TheYeti
2672e218f4 Just updating the licensing documentation 2012-02-10 03:05:09 -08:00
Grant
02a728bdea Merge pull request #144 from nossr50/master
Fixed a major problem with my changes to PlayerProfile, however the refresh bug still exists.
2012-02-09 18:14:24 -08:00
nossr50
3a812612de Fixed a major problem where the hashmap wasn't initialized on
PlayerProfile creation. However there is still a big bug with abilities
instantly wearing off and refreshing.
2012-02-09 15:28:05 -08:00
Grant
4fdbce24d7 Merge pull request #143 from nossr50/master
Shrinking PlayerProfile, fixed a small bug as well.
2012-02-09 11:16:14 -08:00
GJ
52458041f0 Removed ColoredConsoleSender. No more CB Dependency! 2012-02-09 14:12:36 -05:00
nossr50
4a1e5a0dcc Silly commits 2012-02-09 11:12:16 -08:00
nossr50
f6c7ac6d98 Merge branch 'master' of github.com:TheYeti/mcMMO 2012-02-09 11:11:35 -08:00
nossr50
76675422ea Shrinking PlayerProfile one step at a time, also fixed a bug. 2012-02-09 11:10:39 -08:00
GJ
7dee6db362 Changed CraftItem to Item in Fishing, one step closer to being free of
CB dependency.
2012-02-09 14:04:48 -05:00
Grant
e8030c59f1 Merge pull request #142 from nossr50/master
Updated README, removed unused code.
2012-02-09 10:11:38 -08:00
nossr50
4b642d4953 Removed some old Sorcery code that won't ever be used 2012-02-09 10:08:04 -08:00
nossr50
346b7862af Changed the README to be up to date 2012-02-09 10:03:41 -08:00
NuclearW
3ec661cc02 Merge pull request #141 from nossr50/master
Added LGPL to Fishing.java
2012-02-09 10:01:58 -08:00
nossr50
d7f066b07e Added LGPL to Fishing.java 2012-02-09 10:00:01 -08:00
Grant
e54500fa90 Merge pull request #140 from nossr50/master 2012-02-09 09:49:12 -08:00
nossr50
a2c83425f2 Fixed even more of GJ's mistakes :P 2012-02-09 09:47:17 -08:00
NuclearW
41ce19b835 Merge pull request #139 from nossr50/master
Fixed some problems with Herbalism code, also optimized GT checks.
2012-02-09 09:36:59 -08:00
nossr50
9c11a6ffb0 Fixed some problems with Herbalism code, also optimized GT checks. 2012-02-09 09:33:20 -08:00
NuclearW
e36cd8109d Configure all the save timer 2012-02-09 11:26:57 -05:00
Grant
ee83e93269 Merge pull request #138 from nossr50/master
Optimizing how mcMMO saves player information
2012-02-09 07:06:37 -08:00
nossr50
0b4692e303 Hopefully the remaining tabs are now spaces... eclipse is being odd. 2012-02-09 03:42:08 -08:00
nossr50
e99b5a4abf Changed tab to 4 spaces. 2012-02-09 03:31:44 -08:00
nossr50
a419c4d4fe Forgot to commit this file. 2012-02-09 03:16:55 -08:00
nossr50
ca80a7d463 Optimized how mcMMO saves player information. 2012-02-09 03:11:18 -08:00
GJ
716e6296e5 Updates to Swords & Axes skills, optimizations. 2012-02-09 00:58:05 -05:00
NuclearW
6382bec05a Allow lookup of player's stats from console
Quick change to test new Jenkins+GitPOST
2012-02-08 23:17:01 -05:00
GJ
20248212ae Added MagmaCube to Combat XP table. 2012-02-08 10:11:55 -05:00
GJ
86e373b493 Various fixes for Blast Mining. 2012-02-07 15:28:41 -05:00
NuclearW
b4b0bbd081 Make Smooth Brick to Mossy Brick and Dirt to Grass for green thumb configurable
Closes issue #120
2012-02-07 11:43:07 -05:00
GJ
17bacbf9d6 Fixed BlastMining not checking if blocks had been placed. 2012-02-07 02:41:11 -05:00
GJ
b869fb0ca5 Helps to include the new file... 2012-02-07 01:37:41 -05:00
GJ
c70a23dd5c Framework for Blast Mining 2012-02-07 01:36:57 -05:00
GJ
f9e7ae22f2 Removed unused variables & imports. 2012-02-06 16:30:50 -05:00
TheYeti
30fb2770a6 Pants 2012-02-06 11:26:41 -08:00
TheYeti
11e1dc7ec8 Okay, lets fix everything that depended on Permissions 2012-02-06 11:24:33 -08:00
TheYeti
5645c29dd8 Removal of legacy permission system support. SuperPerms only now. 2012-02-06 10:48:02 -08:00
GJ
44e954efeb Fixed typos in MOTD & /mcmmo
There was an extra slash in there...
2012-02-06 11:53:55 -05:00
gmcferrin
4ffb20f3bb Back to new development! 2012-02-06 00:50:22 -05:00
gmcferrin
716dd02b3f Updated changelog & pom for hotfix RB 2012-02-06 00:27:01 -05:00
gmcferrin
5e93a4c9d3 Updates to config.yml & changelog 2012-02-06 00:17:55 -05:00
gmcferrin
cbeb994b69 Fix bug with Leaf Blower. 2012-02-05 23:16:25 -05:00
gmcferrin
43e3dd7977 Fix NoCheat conflict. Updated changelog.
Closes #104
2012-02-05 15:24:44 -05:00
NuclearW
598c507849 Don't counter-attack non-LivingEntity
Closes #100
Closes #107
2012-02-05 15:07:35 -05:00
gmcferrin
0b30920edd Fix for Issue #103 2012-02-05 12:53:40 -05:00
gmcferrin
6cfd81faf9 Fixed typo in regards to repair materials. Added option to configure
Anvil block ID.
2012-02-05 12:38:06 -05:00
TheYeti
cc9a6aa9b9 Remove anniversary stuff 2012-02-04 22:57:43 -08:00
NuclearW
c8ff58bb6c Monitor and ignoreCancelledEvents onBlockPlace 2012-02-05 01:46:39 -05:00
NuclearW
dc77d9f434 Merge branch 'master' of https://github.com/TheYeti/mcMMO 2012-02-05 01:39:34 -05:00
NuclearW
7c87fc8316 New fun versioning in our plugin.yml 2012-02-05 01:38:18 -05:00
gmcferrin
0068a3f07a Fixed compile errors from last commit. 2012-02-04 10:45:37 -05:00
gmcferrin
bb70289cb3 More fixes for instaBreak, moving abilities to individual skill files. 2012-02-04 09:35:07 -05:00
gmcferrin
80abd0db91 Fixed issue with Silk Touch & Double/Triple drops while mining. 2012-02-04 08:49:03 -05:00
NuclearW
bbef731be5 Absolutely 2012-02-04 05:13:09 -05:00
gmcferrin
897f4d3694 Changed Super Breaker to use instaBreak. 2012-02-04 02:52:31 -05:00
gmcferrin
2c380f609e Fixed import issues from last commit. 2012-02-04 01:59:31 -05:00
gmcferrin
aa9fe544a2 Merge branch 'master' of https://gmcferrin@github.com/TheYeti/mcMMO.git 2012-02-04 01:51:56 -05:00
NuclearW
230435c29d Make directory
Remove double initialization
2012-02-04 01:51:10 -05:00
gmcferrin
4a2325f244 Moved more stuff into skill files. 2012-02-04 01:36:03 -05:00
gmcferrin
d920702389 Fixed typo. As usual. 2012-02-04 00:26:29 -05:00
gmcferrin
16d56a45f2 Merge branch 'master' of https://gmcferrin@github.com/TheYeti/mcMMO.git 2012-02-04 00:22:33 -05:00
gmcferrin
3e62697567 Started moving stuff from mcBlockListener into their respective skill
files.
2012-02-04 00:22:10 -05:00
NuclearW
219372212e Lets maven our next major release! 2012-02-04 00:06:01 -05:00
TheYeti
3d401ac4cb Lets get started on our next major release! 2012-02-03 20:28:13 -08:00
NuclearW
20adf4674a Let the development continue
Update yml, pom, and changelog for 1.2.10-dev
2012-02-03 21:45:00 -05:00
108 changed files with 8633 additions and 6959 deletions

5
.gitignore vendored
View File

@@ -33,4 +33,7 @@
.idea/
# Project Stuff
/src/main/resources/mcMMO
/src/main/resources/mcMMO
# Other Libraries
*.jar

View File

@@ -1,5 +1,128 @@
Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Key:
+ Addition
= Fix
! Change
- Removal
Version 1.3.02
+ Added in game guides for Mining, Excavation, and Acrobatics. Simply type /skillname ? to access them
! Changed Tree Feller to hand out 1/4 of normal XP for each JUNGLE LOG block it fells
! Changed Tree Feller to only fell trees if you have enough durability
! Changed Tree Feller to cause injury if your axe splinters from a failed Tree Feller attempt
! Changed invincibility checks in EntityDamage listeners to accommodate for vanilla MC behaviour
! Changed Ignition to add fire ticks rather than replacing them.
! Changed Axes critical to have a max critical rate of 37.5% down from 75%
= Fixed bug where Taming defensive checks got called twice
= Fixed Shake not working correctly
= Fixed bug with Axes command displaying wrong Greater Impact bonus damage
= Fixed bug where Impact didn't apply bonus damage
= Fixed Impact proccing multiple times in a row
= Fixed bug where PVE skills didn't level
Version 1.3.01
= Fixed bug where Tree Feller had no cooldown
= Fixed bug with activating Skull Splitter after using Tree Feller
Version 1.3.00
+ Added ability to customize drops for Excavation skill (treasures.yml)
+ Added ability to customize drops for Fishing skill (treasures.yml)
+ Added messages to nearby players when your abilities wear off
+ Added jungle trees to Woodcutting XP tables
+ Added player notification for when they stop Bleeding
+ Added configuration option to control mcMMO reporting damage events
+ Added hunger regain bonuses to Herbalism skill
+ Added Blast Mining subskills to Mining
+ Added Fast Food Service subskill to Taming
+ Added size limit to Tree Feller in config as Tree Feller Threshold
+ Added /inspect (works on offline players)
+ Added /addlevels commands
+ Added /mcremove command which lets you remove users from MySQL or FlatFile
+ Added config values for XP multipliers for different hostile mobs
+ Added 'mcmmo.commands.inspect' permission node for the new /inspect command
+ Added Impact & Greater Impact subskills to Axes
+ Re-added mcMMO reporting damage events
= Fixed bug with updating MySQL tables to include fishing on servers using custom table prefixes
= Fixed bug where Disarm didn't work at all ever
= Fixed bug where Swords command showed Bleed Length twice instead of Bleed Chance
= Fixed bug where Tree Feller wasn't checking for Tree Feller permission
= Fixed bug where Leaf Blower required Tree Feller permissions rather than Woodcutting permissions
= Fixed Leaf Blower preventing the use of shears to collect leaves
= Fixed Green Thumb & Green Terra not consuming or requiring seeds to replant Wheat
= Fixed Super Breaker & Giga Drill Breaker failing to damage tools
= Fixed Tree Feller not giving proper XP for different kinds of trees
= Fixed Skill Abilities conflicting with NoCheat
= Fixed memory leak with mob spawner tracking
= Fixed /mcability not respecting permissions
= Prettied up new config files
= Various skill function optimizations
! Changed how mcMMO calculates distance between two points (optimizations)
! Changed how mcMMO handles MySQL connections (optimizations)
! Changed the description /mcmmo provides to be more up to date and relevant
! Changed mcMMO user information to be stored for 2 minutes after log out to reduce lag on rejoins
! Changed Food+ to be named Farmer's Diet in Herbalism
! Changed default values of Woodcutting XP tables
! Changed 'Pine' to be renamed 'Oak' in Woodcutting XP tables
! Changed the name of Unarmed Apprentice/Mastery to Iron Arm Style
! Changed Axes to gain bonus damage every 50 skill levels
! Changed Unarmed to start with a +3 DMG (1 Heart = 2 DMG) bonus from Iron Arm Style to make leveling it more viable
! Changed Unarmed to gain bonus damage every 50 skill levels
! Changed Unarmed to gain more bonus damage total than before
! Changed Unarmed to have a max disarm chance of 33.3% rather than 25%
! Changed Tree Feller to take down entire trees
! Changed mob spawn tracking to use Unique Entity ID instead of Entity Object
! Changed stats command name to mcstats for better plugin compatibility
! Changed god mode to turn off if player enters world where he does not have mcgod permission
! Changed Taming to also gain XP from animal taming
! Changed Swords Bleeding effect to never kill
! Changed Bleeding to never go beyond 10 ticks
! Changed to use Bukkit's built-in ignoreCancelledEvents system
! Changed chat logging for /p & /a
! Changed Tree Feller to use per-use ArrayList
- Removed /mcstats console functionality
- Removed /whois command (replaced with /inspect which has similar functionality)
- Removed Master/Apprentice chat notifications to reduce spam
- Removed MySpawn system (You can still use Chimaera Wings) due to being outdated and unwanted
- Removed duplicate settings in config.yml
- Removed unused settings from config.yml (HP Regen)
- Removed Nether Brick from Mining XP Tables
- Removed Stone Brick from Mining XP Tables
Version 1.2.12
- Fixed issue that caused terrible MySQL performance and negative XP on levelup (Issue #134)
- Fixed addxp command taking xprate and skill modifiers into account
- Added anonymous usage statistics (you can opt out in plugins/PluginMetrics/config.yml)
- Modified onEntityDamage priority to have better compatibility with other plugins (Factions, WorldGuard, etc...)
- Fixed /mcgod & /mmoedit permissions defaulting to true
- Fixed Fishing not working or handing out XP
- Fixed error with Skull Splitter / Serrated Strikes that caused server instability and log spam
- Fixed config.yml not having values for End Stone & other new mining blocks
- Fixed Green Thumb/Green Terra not correctly planting wheat (Issue #133)
Version 1.2.11
- Removed legacy Permission & PEX dependency. (PEX still works fine with mcMMO)
- Made Smooth Brick to Mossy Brick and Dirt to Grass for green thumb configurable (Issue #120)
- Added MagmaCube to XP tables
- Made optimizations to Skull Splitter/Serrated Strikes
- Made it so players take damage if they try to log out with Serrated Strikes stacked onto them (Issue #131)
- Changed mcMMO to save data periodically to optimize performance with FlatFile & MySQL (Issue #138)
- Added a configurable save interval for the new save system
- Fixed a bug with the odds calculations for Serrated Strikes
- Fixed several commands not working from console (mmoedit, etc..) (Issue #150)
- Added a success message when executing xprate from console
Version 1.2.10
- Fixed issue with receiving Woodcutting XP for all blocks broken (Issue #103)
- Fixed issue with Spout images & sounds not working (Issue #93)
- Fixed typo with repairing Leather Armor & Bows
- Fixed issue with Silk Touch & Double/Triple drops not working properly
- Fixed conflict with NoCheat plugin & Super Breaker/Giga Drill Breaker/Berserk/Leaf Blower (Issue #104)
- Fixed counter-attacking non-LivingEntity (Issue #100 & Issue #107)
- Fixed various bugs with Leaf Blower
- Added Monitor & ignoreCancelledEvents to onBlockPlace
- Made Anvil ID configurable
Version 1.2.09
- Fixed issue with Repair Mastery (Issue #47)

346
LICENSE Normal file
View File

@@ -0,0 +1,346 @@
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”.
“Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission,
other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work
“based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily
liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy.
Propagation includes copying, distribution (with or without modification), making available to the public, and in some
countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction
with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and
prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no
warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this
License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any
non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or,
in the case of interfaces specified for a particular programming language, one that is widely used among developers
working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in
the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to
enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is
available to the public in source code form. A “Major Component”, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a
compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and
(for an executable work) run the object code and to modify the work, including scripts to control those activities.
However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs
which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding
Source includes interface definition files associated with source files for the work, and the source code for shared
libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data
communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the
Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided
the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program.
The output from running a covered work is covered by this License only if the output, given its content, constitutes a
covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license
otherwise remains in force. You may convey covered works to others for the sole purpose of having them make
modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do not control copyright. Those thus making or running
the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that
prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not
allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling
obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or
restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the
extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you
disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users,
your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating
that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices
of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for
a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source
code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under
section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all
its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way,
but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has
interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of
the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or
distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the
access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied
by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied
by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for
that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all
the software in the product that is covered by this License, on a durable physical medium customarily used for software
interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2)
access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source.
This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an
offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent
access to the Corresponding Source in the same way through the same place at no further charge. You need not require
recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a
network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports
equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it
is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library,
need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used
for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In
determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a
particular product received by a particular user, “normally used” refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way in which the particular user actually uses, or
expects or is expected to use, the product. A product is a consumer product regardless of whether the product has
substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of
the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information
required to install and execute modified versions of a covered work in that User Product from a modified version of its
Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code
is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the
conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to
the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding
Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not
apply if neither you nor any third party retains the ability to install modified object code on the User Product (for
example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support
service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product
in which it has been modified or installed. Access to a network may be denied when the modification itself materially
and adversely affects the operation of the network or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format
that is publicly documented (and with an implementation available to the public in source code form), and must require
no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its
conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were
included in this License, to the extent that they are valid under applicable law. If additional permissions apply only
to part of the Program, that part may be used separately under those permissions, but the entire Program remains
governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or
from any part of it. (Additional permissions may be written to require their own removal in certain cases when you
modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have
or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by
the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the
Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be
marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified
versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual
assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the
Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with
a term that is a further restriction, you may remove that term. If a license document contains a further restriction but
permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of
that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a
statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as
exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to
propagate or modify it is void, and will automatically terminate your rights under this License (including any patent
licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated
(a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and
(b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days
after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you
of the violation by some reasonable means, this is the first time you have received notice of violation of this License
(for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or
rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not
qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a
covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not
require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered
work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run,
modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third
parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or
subdividing an organization, or merging organizations. If propagation of a covered work results from an entity
transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work
the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with
reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For
example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License,
and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent
claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program
is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already
acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or
selling its contributor version, but do not include claims that would be infringed only as a consequence of further
modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent
sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential
patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its
contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to
enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To
“grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against
the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not
available for anyone to copy, free of charge and under the terms of this License, through a publicly available network
server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available,
or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a
manner consistent with the requirements of this License, to extend the patent license to downstream recipients.
“Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in
a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in
that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring
conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing
them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is
automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of,
or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You
may not convey a covered work if you are a party to an arrangement with a third party that is in the business of
distributing software, under which you make payment to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a
discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from
those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered
work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to
infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this
License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to
satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence
you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further
conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License
would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work
licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the
resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special
requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply
to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to
time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the
GNU General Public License “or any later version” applies to it, you have the option of following the terms and
conditions either of that numbered version or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of the GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used,
that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the
Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed
on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING
THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO
MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to
their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil
liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program
in return for a fee.

View File

@@ -16,10 +16,7 @@ Hearing that people enjoy mcMMO and seeing the daily youtube videos about my mod
=== Compiling
Required Libraries:
* CraftBukkit
* Spout API
* Permissions
* PermissionsEx
Required to Run:
* Bukkit

49
pom.xml
View File

@@ -2,12 +2,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>1.2.09</version>
<version>1.3.02</version>
<name>mcMMO</name>
<url>https://github.com/TheYeti/mcMMO</url>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/TheYeti/mcMMO/issues</url>
<url>http://issues.mcmmo.org</url>
<system>JIRA</system>
</issueManagement>
<build>
<finalName>mcMMO</finalName>
@@ -23,7 +23,7 @@
</resource>
<resource>
<targetPath>resources</targetPath>
<filtering>true</filtering>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources/xpbar/</directory>
<includes>
<include>xpbar*.png</include>
@@ -31,7 +31,7 @@
</resource>
<resource>
<targetPath>resources</targetPath>
<filtering>true</filtering>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources/healthbar/</directory>
<includes>
<include>health*.png</include>
@@ -39,7 +39,7 @@
</resource>
<resource>
<targetPath>resources</targetPath>
<filtering>true</filtering>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources/skillicon/</directory>
<includes>
<include>*.png</include>
@@ -47,7 +47,7 @@
</resource>
<resource>
<targetPath>resources</targetPath>
<filtering>true</filtering>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources/sound/</directory>
<includes>
<include>*.wav</include>
@@ -95,10 +95,20 @@
</build>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>spout-repo</id>
<url>http://nexus.getspout.org/content/groups/public/</url>
</repository>
@@ -107,28 +117,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.1-R4-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.1-R3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nijikokun.bukkit</groupId>
<artifactId>Permissions</artifactId>
<version>3.1.6</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ru.tehkode.permissions</groupId>
<artifactId>bukkit</artifactId>
<version>1.18</version>
<version>LATEST</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

View File

@@ -1,32 +1,33 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.plugin.Plugin;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.events.FakeEntityDamageByEntityEvent;
import com.gmail.nossr50.events.FakeEntityDamageEvent;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.skills.Acrobatics;
@@ -39,412 +40,396 @@ import com.gmail.nossr50.skills.Unarmed;
public class Combat
{
public static void combatChecks(EntityDamageEvent event, mcMMO pluginx)
public static void combatChecks(EntityDamageByEntityEvent event, mcMMO pluginx)
{
if(event.isCancelled() || event.getDamage() == 0)
if(event.getDamage() == 0 || event.getEntity().isDead())
return;
if(event instanceof EntityDamageByEntityEvent)
{
/*
* OFFENSIVE CHECKS FOR PLAYERS VERSUS ENTITIES
*/
if(((EntityDamageByEntityEvent) event).getDamager() instanceof Player)
{
//Declare Things
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent) event;
Player attacker = (Player)((EntityDamageByEntityEvent) event).getDamager();
PlayerProfile PPa = Users.getProfile(attacker);
//Damage modifiers
if(mcPermissions.getInstance().unarmed(attacker) && attacker.getItemInHand().getTypeId() == 0) //Unarmed
Unarmed.unarmedBonus(attacker, eventb);
if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker) && Users.getProfile(attacker).getSkillLevel(SkillType.AXES) >= 500)
event.setDamage(event.getDamage()+4);
//If there are any abilities to activate
combatAbilityChecks(attacker, PPa, pluginx);
//Check for offensive procs
if(!(((EntityDamageByEntityEvent) event).getDamager() instanceof Arrow))
{
if(mcPermissions.getInstance().axes(attacker))
Axes.axeCriticalCheck(attacker, eventb, pluginx); //Axe Criticals
if(!pluginx.misc.bleedTracker.contains((LivingEntity) event.getEntity())) //Swords Bleed
Swords.bleedCheck(attacker, (LivingEntity)event.getEntity(), pluginx);
if(event.getEntity() instanceof Player && mcPermissions.getInstance().unarmed(attacker))
{
Player defender = (Player)event.getEntity();
Unarmed.disarmProcCheck(attacker, defender);
}
//Modify the event damage if Attacker is Berserk
if(PPa.getBerserkMode())
event.setDamage(event.getDamage() + (event.getDamage() / 2));
//Handle Ability Interactions
if(PPa.getSkullSplitterMode() && m.isAxes(attacker.getItemInHand()))
Axes.applyAoeDamage(attacker, eventb, pluginx);
if(PPa.getSerratedStrikesMode() && m.isSwords(attacker.getItemInHand()))
Swords.applySerratedStrikes(attacker, eventb, pluginx);
//Experience
if(event.getEntity() instanceof Player)
{
Player defender = (Player)event.getEntity();
PlayerProfile PPd = Users.getProfile(defender);
if(attacker != null && defender != null && LoadProperties.pvpxp)
{
if(System.currentTimeMillis() >= (PPd.getRespawnATS()*1000) + 5000
&& ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis()
&& defender.getHealth() >= 1)
{
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob
int hpLeft = defender.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
xpinc = hpLeft;
else
xpinc = event.getDamage();
int xp = (int) (xpinc * 2 * LoadProperties.pvpxprewardmodifier);
if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker))
PPa.addXP(SkillType.AXES, xp*10, attacker);
if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker))
PPa.addXP(SkillType.SWORDS, xp*10, attacker);
if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker))
PPa.addXP(SkillType.UNARMED, xp*10, attacker);
}
}
}
if(!pluginx.misc.mobSpawnerList.contains(event.getEntity()))
{
int xp = getXp(event.getEntity(), event);
//Declare Things
Entity damager = event.getDamager();
LivingEntity target = (LivingEntity) event.getEntity();
int damage = event.getDamage();
if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker))
PPa.addXP(SkillType.SWORDS, xp*10, attacker);
else if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker))
PPa.addXP(SkillType.AXES, xp*10, attacker);
else if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker))
PPa.addXP(SkillType.UNARMED, xp*10, attacker);
}
Skills.XpCheckAll(attacker);
if(event.getEntity() instanceof Wolf)
{
Wolf theWolf = (Wolf)event.getEntity();
if(attacker.getItemInHand().getTypeId() == 352 && mcPermissions.getInstance().taming(attacker))
{
event.setCancelled(true);
if(theWolf.isTamed())
{
attacker.sendMessage(mcLocale.getString("Combat.BeastLore")+" "+
mcLocale.getString("Combat.BeastLoreOwner", new Object[] {Taming.getOwnerName(theWolf)})+" "+
mcLocale.getString("Combat.BeastLoreHealthWolfTamed", new Object[] {theWolf.getHealth()}));
}
else
{
attacker.sendMessage(mcLocale.getString("Combat.BeastLore")+" "+
mcLocale.getString("Combat.BeastLoreHealthWolf", new Object[] {theWolf.getHealth()}));
}
}
}
/*
* PLAYER VERSUS ENTITIES
*/
if(damager instanceof Player)
{
Player attacker = (Player) event.getDamager();
ItemStack itemInHand = attacker.getItemInHand();
PlayerProfile PPa = Users.getProfile(attacker);
//If there are any abilities to activate
combatAbilityChecks(attacker, PPa);
//Damage modifiers and proc checks
if(m.isSwords(itemInHand) && mcPermissions.getInstance().swords(attacker))
{
if(!pluginx.misc.bleedTracker.contains(target)) //Bleed
Swords.bleedCheck(attacker, target, pluginx);
if (PPa.getSerratedStrikesMode())
Swords.applySerratedStrikes(attacker, event, pluginx);
if(target instanceof Player)
PvPExperienceGain(attacker, PPa, (Player) target, damage, SkillType.SWORDS);
else if(!pluginx.misc.mobSpawnerList.contains(target.getEntityId()))
PvEExperienceGain(attacker, PPa, target, damage, SkillType.SWORDS);
}
else if(m.isAxes(itemInHand) && mcPermissions.getInstance().axes(attacker))
{
Axes.axesBonus(attacker, event);
Axes.axeCriticalCheck(attacker, event, pluginx); //Critical hit
//Impact
Axes.impact(attacker, target, event);
if (PPa.getSkullSplitterMode())
Axes.applyAoeDamage(attacker, event, pluginx);
if(target instanceof Player)
PvPExperienceGain(attacker, PPa, (Player) target, event.getDamage(), SkillType.AXES);
else if(!pluginx.misc.mobSpawnerList.contains(target.getEntityId()))
PvEExperienceGain(attacker, PPa, target, event.getDamage(), SkillType.AXES);
}
else if(itemInHand.getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) //Unarmed
{
Unarmed.unarmedBonus(attacker, event);
if(PPa.getBerserkMode())
event.setDamage(event.getDamage() + (event.getDamage() / 2));
if(target instanceof Player)
Unarmed.disarmProcCheck(attacker, (Player) target); //Disarm
if(target instanceof Player)
PvPExperienceGain(attacker, PPa, (Player) target, event.getDamage(), SkillType.UNARMED);
else if(!pluginx.misc.mobSpawnerList.contains(target.getEntityId()))
PvEExperienceGain(attacker, PPa, target, event.getDamage(), SkillType.UNARMED);
}
//Player use bone on wolf.
else if(target instanceof Wolf)
{
Wolf wolf = (Wolf) target;
if(itemInHand.getTypeId() == 352 && mcPermissions.getInstance().taming(attacker))
{
event.setCancelled(true);
if(wolf.isTamed())
attacker.sendMessage(mcLocale.getString("Combat.BeastLore")+" "+
mcLocale.getString("Combat.BeastLoreOwner", new Object[] {Taming.getOwnerName(wolf)})+" "+
mcLocale.getString("Combat.BeastLoreHealthWolfTamed", new Object[] {wolf.getHealth()}));
else
attacker.sendMessage(mcLocale.getString("Combat.BeastLore")+" "+
mcLocale.getString("Combat.BeastLoreHealthWolf", new Object[] {wolf.getHealth()}));
}
}
}
/*
* TAMING (WOLVES VERSUS ENTITIES)
*/
else if(damager instanceof Wolf)
{
Wolf wolf = (Wolf) damager;
if (wolf.isTamed() && (wolf.getOwner() instanceof Player))
{
Player master = (Player) wolf.getOwner();
PlayerProfile PPo = Users.getProfile(master);
if(mcPermissions.getInstance().taming(master))
{
//Fast Food Service
Taming.fastFoodService(PPo, wolf, event);
//Sharpened Claws
Taming.sharpenedClaws(PPo, event);
//Gore
Taming.gore(PPo, event, master, pluginx);
//Reward XP
Taming.rewardXp(event, pluginx, master);
}
}
}
/*
* OFFENSIVE CHECKS FOR WOLVES VERSUS ENTITIES
*/
if(event instanceof EntityDamageByEntityEvent && ((EntityDamageByEntityEvent) event).getDamager() instanceof Wolf)
{
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent) event;
Wolf theWolf = (Wolf) eventb.getDamager();
if(theWolf.isTamed() && Taming.ownerOnline(theWolf, pluginx))
{
if(Taming.getOwner(theWolf, pluginx) == null)
return;
Player master = Taming.getOwner(theWolf, pluginx);
PlayerProfile PPo = Users.getProfile(master);
if(mcPermissions.getInstance().taming(master))
{
//Sharpened Claws
if(PPo.getSkillLevel(SkillType.TAMING) >= 750)
{
event.setDamage(event.getDamage() + 2);
}
//Gore
if(Math.random() * 1000 <= PPo.getSkillLevel(SkillType.TAMING))
{
event.setDamage(event.getDamage() * 2);
if(event.getEntity() instanceof Player)
{
Player target = (Player)event.getEntity();
target.sendMessage(mcLocale.getString("Combat.StruckByGore")); //$NON-NLS-1$
Users.getProfile(target).setBleedTicks(2);
}
else
pluginx.misc.addToBleedQue((LivingEntity) event.getEntity());
master.sendMessage(mcLocale.getString("Combat.Gore")); //$NON-NLS-1$
}
if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity()))
{
int xp = getXp(event.getEntity(), event);
Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master);
if(event.getEntity() instanceof Player)
{
xp = (event.getDamage() * 2);
Users.getProfile(master).addXP(SkillType.TAMING, (int)((xp*10)*1.5), master);
}
Skills.XpCheckSkill(SkillType.TAMING, master);
}
}
}
}
//Another offensive check for Archery
if(event instanceof EntityDamageByEntityEvent && event.getCause() == DamageCause.PROJECTILE && ((EntityDamageByEntityEvent) event).getDamager() instanceof Arrow)
else if(damager instanceof Arrow)
archeryCheck((EntityDamageByEntityEvent)event, pluginx);
/*
* DEFENSIVE CHECKS
*/
if(event instanceof EntityDamageByEntityEvent && event.getEntity() instanceof Player)
if(target instanceof Player)
{
Swords.counterAttackChecks((EntityDamageByEntityEvent)event);
Acrobatics.dodgeChecks((EntityDamageByEntityEvent)event);
Swords.counterAttackChecks(event);
Acrobatics.dodgeChecks(event);
}
/*
/*
* DEFENSIVE CHECKS FOR WOLVES
*/
if(event.getEntity() instanceof Wolf)
{
Wolf theWolf = (Wolf) event.getEntity();
if(theWolf.isTamed() && Taming.ownerOnline(theWolf, pluginx))
{
if(Taming.getOwner(theWolf, pluginx) == null)
return;
Player master = Taming.getOwner(theWolf, pluginx);
PlayerProfile PPo = Users.getProfile(master);
if(mcPermissions.getInstance().taming(master))
{
//Shock-Proof
if((event.getCause() == DamageCause.ENTITY_EXPLOSION || event.getCause() == DamageCause.BLOCK_EXPLOSION) && PPo.getSkillLevel(SkillType.TAMING) >= 500)
{
event.setDamage(2);
}
//Thick Fur
if(PPo.getSkillLevel(SkillType.TAMING) >= 250)
event.setDamage(event.getDamage() / 2);
}
}
}
//else if(target instanceof Wolf)
//{
// Wolf wolf = (Wolf) target;
// if(wolf.isTamed() && (wolf.getOwner() instanceof Player))
// Taming.preventDamage(event, pluginx);
//}
}
public static void combatAbilityChecks(Player attacker, PlayerProfile PPa, Plugin pluginx)
public static void combatAbilityChecks(Player attacker, PlayerProfile PPa)
{
//Check to see if any abilities need to be activated
if(PPa.getAxePreparationMode())
Axes.skullSplitterCheck(attacker);
Skills.abilityCheck(attacker, SkillType.AXES);
if(PPa.getSwordsPreparationMode())
Swords.serratedStrikesActivationCheck(attacker);
Skills.abilityCheck(attacker, SkillType.SWORDS);
if(PPa.getFistsPreparationMode())
Unarmed.berserkActivationCheck(attacker);
Skills.abilityCheck(attacker, SkillType.UNARMED);
}
public static void archeryCheck(EntityDamageByEntityEvent event, mcMMO pluginx)
{
Arrow arrow = (Arrow)event.getDamager();
Entity y = arrow.getShooter();
Entity x = event.getEntity();
if(x instanceof Player)
{
Player defender = (Player)x;
PlayerProfile PPd = Users.getProfile(defender);
if(PPd == null)
Users.addUser(defender);
if(mcPermissions.getInstance().unarmed(defender) && defender.getItemInHand().getTypeId() == 0)
{
if(defender != null && PPd.getSkillLevel(SkillType.UNARMED) >= 1000)
{
if(Math.random() * 1000 <= 500)
{
event.setCancelled(true);
defender.sendMessage(mcLocale.getString("Combat.ArrowDeflect")); //$NON-NLS-1$
return;
}
} else if(defender != null && Math.random() * 1000 <= (PPd.getSkillLevel(SkillType.UNARMED) / 2))
{
event.setCancelled(true);
defender.sendMessage(mcLocale.getString("Combat.ArrowDeflect")); //$NON-NLS-1$
return;
}
}
}
/*
* If attacker is player
*/
if(y instanceof Player)
{
Player attacker = (Player)y;
PlayerProfile PPa = Users.getProfile(attacker);
if(mcPermissions.getInstance().archery(attacker))
{
Archery.trackArrows(pluginx, x, event, attacker);
/*
* IGNITION
*/
Archery.ignitionCheck(x, event, attacker);
/*
* Defender is Monster
*/
if(!pluginx.misc.mobSpawnerList.contains(x))
{
int xp = getXp(event.getEntity(), event);
PPa.addXP(SkillType.ARCHERY, xp*10, attacker);
}
/*
* Attacker is Player
*/
if(x instanceof Player){
Player defender = (Player)x;
PlayerProfile PPd = Users.getProfile(defender);
/*
* Stuff for the daze proc
*/
if(PPa.inParty() && PPd.inParty())
{
if(Party.getInstance().inSameParty(defender, attacker))
{
event.setCancelled(true);
return;
}
}
/*
* PVP XP
*/
if(LoadProperties.pvpxp && !Party.getInstance().inSameParty(attacker, defender)
&& ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis() && !attacker.getName().equals(defender.getName()))
{
int xp = (int) ((event.getDamage() * 2) * 10);
PPa.addXP(SkillType.ARCHERY, xp, attacker);
}
/*
* DAZE PROC
*/
Archery.dazeCheck(defender, attacker);
}
}
Skills.XpCheckSkill(SkillType.ARCHERY, attacker);
}
}
/**
* Attempt to damage target for value dmg with reason CUSTOM
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
*/
public static void dealDamage(LivingEntity target, int dmg){
dealDamage(target, dmg, EntityDamageEvent.DamageCause.CUSTOM);
}
/**
* Attempt to damage target for value dmg with reason cause
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
* @param cause DamageCause to pass to damage event
*/
public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
EntityDamageEvent ede = new EntityDamageEvent(target, cause, dmg);
Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
}
/**
* Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
* @param attacker Player to pass to event as damager
*/
public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
EntityDamageEvent ede = new EntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg);
Bukkit.getPluginManager().callEvent(ede);
target.damage(ede.getDamage());
}
public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world)
{
if(!event.getEntity().getWorld().getPVP())
return false;
//If it made it this far, pvp is enabled
return true;
}
public static int getXp(Entity entity, EntityDamageEvent event)
{
int xp = 0;
if(entity instanceof LivingEntity)
{
LivingEntity le = (LivingEntity)entity;
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the entity
int hpLeft = le.getHealth(), xpinc = 0;
Entity y = arrow.getShooter();
Entity x = event.getEntity();
if(x instanceof Player)
{
Player defender = (Player)x;
PlayerProfile PPd = Users.getProfile(defender);
if(PPd == null)
Users.addUser(defender);
if(mcPermissions.getInstance().unarmed(defender) && defender.getItemInHand().getTypeId() == 0)
{
if(defender != null && PPd.getSkillLevel(SkillType.UNARMED) >= 1000)
{
if(Math.random() * 1000 <= 500)
{
event.setCancelled(true);
defender.sendMessage(mcLocale.getString("Combat.ArrowDeflect")); //$NON-NLS-1$
return;
}
} else if(defender != null && Math.random() * 1000 <= (PPd.getSkillLevel(SkillType.UNARMED) / 2))
{
event.setCancelled(true);
defender.sendMessage(mcLocale.getString("Combat.ArrowDeflect")); //$NON-NLS-1$
return;
}
}
}
/*
* If attacker is player
*/
if(y instanceof Player)
{
Player attacker = (Player)y;
PlayerProfile PPa = Users.getProfile(attacker);
int damage = event.getDamage();
if(mcPermissions.getInstance().archery(attacker) && damage > 0)
{
Archery.trackArrows(pluginx, x, PPa);
if(hpLeft < event.getDamage())
/*
* IGNITION
*/
Archery.ignitionCheck(x, attacker);
/*
* Defender is Monster
*/
if(!pluginx.misc.mobSpawnerList.contains(x.getEntityId()))
{
int xp = getXp(x, damage);
PPa.addXP(SkillType.ARCHERY, xp*10, attacker);
}
/*
* Attacker is Player
*/
if(x instanceof Player){
Player defender = (Player)x;
PlayerProfile PPd = Users.getProfile(defender);
/*
* Stuff for the daze proc
*/
if(PPa.inParty() && PPd.inParty())
{
if(Party.getInstance().inSameParty(defender, attacker))
{
event.setCancelled(true);
return;
}
}
/*
* PVP XP
*/
if(LoadProperties.pvpxp && ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis() && !attacker.getName().equals(defender.getName()))
{
int xp = (int) ((damage * 2) * 10);
PPa.addXP(SkillType.ARCHERY, xp, attacker);
}
/*
* DAZE PROC
*/
Archery.dazeCheck(defender, attacker);
}
}
Skills.XpCheckSkill(SkillType.ARCHERY, attacker);
}
}
/**
* Attempt to damage target for value dmg with reason CUSTOM
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
*/
public static void dealDamage(LivingEntity target, int dmg){
dealDamage(target, dmg, EntityDamageEvent.DamageCause.CUSTOM);
}
/**
* Attempt to damage target for value dmg with reason cause
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
* @param cause DamageCause to pass to damage event
*/
public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
if(LoadProperties.eventCallback) {
EntityDamageEvent ede = (EntityDamageEvent) new FakeEntityDamageEvent(target, cause, dmg);
Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
} else {
target.damage(dmg);
}
}
/**
* Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
* @param attacker Player to pass to event as damager
*/
public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
if(LoadProperties.eventCallback) {
EntityDamageEvent ede = (EntityDamageByEntityEvent) new FakeEntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg);
Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
} else {
target.damage(dmg);
}
}
private static void PvPExperienceGain(Player attacker, PlayerProfile PPa, Player defender, int damage, SkillType skillType)
{
if (!LoadProperties.pvpxp)
return;
PlayerProfile PPd = Users.getProfile(defender);
if(System.currentTimeMillis() >= (PPd.getRespawnATS()*1000) + 5000
&& ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis()
&& defender.getHealth() >= 1)
{
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob
int hpLeft = defender.getHealth(), xpinc = 0;
if(hpLeft < damage)
{
if(hpLeft > 0)
xpinc = hpLeft;
else
xpinc = event.getDamage();
xpinc = 0;
} else
xpinc = damage;
int xp = (int) (xpinc * 2 * LoadProperties.pvpxprewardmodifier);
PPa.addXP(skillType, xp*10, attacker);
Skills.XpCheckSkill(skillType, attacker);
}
}
private static void PvEExperienceGain(Player attacker, PlayerProfile PPa, LivingEntity target, int damage, SkillType skillType)
{
int xp = getXp(target, damage);
PPa.addXP(skillType, xp*10, attacker);
Skills.XpCheckSkill(skillType, attacker);
}
public static int getXp(Entity entity, int damage)
{
int xp = 0;
if(entity instanceof LivingEntity)
{
LivingEntity le = (LivingEntity) entity;
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the entity
int hpLeft = le.getHealth();
int xpinc = 0;
if(hpLeft < damage)
{
if(hpLeft > 0)
xpinc = hpLeft;
else
xpinc = 0;
}
else
xpinc = damage;
if(entity instanceof Animals)
xp = (int) (xpinc * LoadProperties.animalXP);
else
{
xp = (int) (xpinc * 1);
} else
{
if(entity instanceof Enderman)
xp = (xpinc * 2);
else if(entity instanceof Creeper)
xp = (xpinc * 4);
else if(entity instanceof Silverfish)
xp = (xpinc * 3);
else if(entity instanceof CaveSpider)
xp = (xpinc * 3);
else if(entity instanceof Spider)
xp = (xpinc * 3);
else if(entity instanceof Skeleton)
xp = (xpinc * 2);
else if(entity instanceof Zombie)
xp = (xpinc * 2);
else if(entity instanceof PigZombie)
xp = (xpinc * 3);
else if(entity instanceof Slime)
xp = (xpinc * 2);
else if(entity instanceof Ghast)
xp = (xpinc * 3);
else if(entity instanceof Blaze)
xp = (xpinc * 3);
else if(entity instanceof EnderDragon)
xp = (xpinc * 8);
EntityType type = entity.getType();
switch(type){
case BLAZE:
xp = (int) (xpinc * LoadProperties.blazeXP);
break;
case CAVE_SPIDER:
xp = (int) (xpinc * LoadProperties.cavespiderXP);
break;
case CREEPER:
xp = (int) (xpinc * LoadProperties.creeperXP);
break;
case ENDER_DRAGON:
xp = (int) (xpinc * LoadProperties.enderdragonXP);
break;
case ENDERMAN:
xp = (int) (xpinc * LoadProperties.endermanXP);
break;
case GHAST:
xp = (int) (xpinc * LoadProperties.ghastXP);
break;
case MAGMA_CUBE:
xp = (int) (xpinc * LoadProperties.magmacubeXP);
break;
case PIG_ZOMBIE:
xp = (int) (xpinc * LoadProperties.pigzombieXP);
break;
case SILVERFISH:
xp = (int) (xpinc * LoadProperties.silverfishXP);
break;
case SKELETON:
xp = (int) (xpinc * LoadProperties.skeletonXP);
break;
case SLIME:
xp = (int) (xpinc * LoadProperties.slimeXP);
break;
case SPIDER:
xp = (int) (xpinc * LoadProperties.spiderXP);
break;
case ZOMBIE:
xp = (int) (xpinc * LoadProperties.zombieXP);
break;
}
}
}
return xp;
}
}
}

View File

@@ -29,11 +29,36 @@ import com.gmail.nossr50.config.LoadProperties;
public class Database {
private mcMMO plugin;
private String connectionString;
private String connectionString = "jdbc:mysql://" + LoadProperties.MySQLserverName + ":" + LoadProperties.MySQLport + "/" + LoadProperties.MySQLdbName + "?user=" + LoadProperties.MySQLuserName + "&password=" + LoadProperties.MySQLdbPass;
private boolean isConnected = false;
private Connection conn = null;
public void connect()
{
try
{
System.out.println("[mcMMO] Attempting connection to MySQL...");
conn = DriverManager.getConnection(connectionString);
isConnected = true;
System.out.println("[mcMMO] Connection to MySQL established!");
} catch (SQLException ex)
{
isConnected = false;
ex.printStackTrace();
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}
}
public boolean isConnected()
{
return isConnected;
}
public Database(mcMMO instance) {
connect(); //Connect to MySQL
this.plugin = instance;
this.connectionString = "jdbc:mysql://" + LoadProperties.MySQLserverName + ":" + LoadProperties.MySQLport + "/" + LoadProperties.MySQLdbName + "?user=" + LoadProperties.MySQLuserName + "&password=" + LoadProperties.MySQLdbPass;
// Load the driver instance
try {
Class.forName("com.mysql.jdbc.Driver");
@@ -47,6 +72,7 @@ public class Database {
System.out.println("VendorError: " + e.getErrorCode());
}
}
//Create the DB structure
public void createStructure() {
Write("CREATE TABLE IF NOT EXISTS `" + LoadProperties.MySQLtablePrefix + "huds` (`user_id` int(10) unsigned NOT NULL,"
@@ -70,6 +96,7 @@ public class Database {
+ "`swords` int(32) unsigned NOT NULL DEFAULT '0',"
+ "`axes` int(32) unsigned NOT NULL DEFAULT '0',"
+ "`acrobatics` int(32) unsigned NOT NULL DEFAULT '0',"
+ "`blast_mining` int(32) unsigned NOT NULL DEFAULT '0',"
+ "PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
Write("CREATE TABLE IF NOT EXISTS `" + LoadProperties.MySQLtablePrefix + "skills` (`user_id` int(10) unsigned NOT NULL,"
+ "`taming` int(10) unsigned NOT NULL DEFAULT '0',"
@@ -97,27 +124,22 @@ public class Database {
+ "`axes` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0',"
+ "PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
Write("CREATE TABLE IF NOT EXISTS `" + LoadProperties.MySQLtablePrefix + "spawn` (`user_id` int(10) NOT NULL,"
+ "`x` int(64) NOT NULL DEFAULT '0',"
+ "`y` int(64) NOT NULL DEFAULT '0',"
+ "`z` int(64) NOT NULL DEFAULT '0',"
+ "`world` varchar(50) NOT NULL DEFAULT '',"
+ "PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
Write("DROP TABLE IF EXISTS `"+LoadProperties.MySQLtablePrefix+"skills2`");
Write("DROP TABLE IF EXISTS `"+LoadProperties.MySQLtablePrefix+"experience2`");
Write("DROP TABLE IF EXISTS `"+LoadProperties.MySQLtablePrefix+"spawn`");
checkDatabaseStructure();
checkDatabaseStructureForBlastMining();
}
public void checkDatabaseStructure()
{
String sql = "SELECT * FROM `mcmmo_experience` ORDER BY `"+LoadProperties.MySQLtablePrefix+"experience`.`fishing` ASC LIMIT 0 , 30";
String sql = "SELECT * FROM `"+LoadProperties.MySQLtablePrefix+"experience` ORDER BY `"+LoadProperties.MySQLtablePrefix+"experience`.`fishing` ASC LIMIT 0 , 30";
ResultSet rs = null;
HashMap<Integer, ArrayList<String>> Rows = new HashMap<Integer, ArrayList<String>>();
try {
Connection conn = DriverManager.getConnection(connectionString);
PreparedStatement stmt = conn.prepareStatement(sql);
if (stmt.executeQuery() != null) {
stmt.executeQuery();
@@ -130,28 +152,64 @@ public class Database {
Rows.put(rs.getRow(), Col);
}
}
conn.close();
} catch (SQLException ex) {
System.out.println("Updating mcMMO MySQL tables...");
System.out.println("Updating mcMMO MySQL tables for Fishing...");
Write("ALTER TABLE `"+LoadProperties.MySQLtablePrefix + "skills` ADD `fishing` int(10) NOT NULL DEFAULT '0' ;");
Write("ALTER TABLE `"+LoadProperties.MySQLtablePrefix + "experience` ADD `fishing` int(10) NOT NULL DEFAULT '0' ;");
}
}
public void checkDatabaseStructureForBlastMining()
{
String sql = "SELECT * FROM `"+LoadProperties.MySQLtablePrefix+"cooldowns` ORDER BY `"+LoadProperties.MySQLtablePrefix+"cooldowns`.`blast_mining` ASC LIMIT 0 , 30";
ResultSet rs = null;
HashMap<Integer, ArrayList<String>> Rows = new HashMap<Integer, ArrayList<String>>();
try {
PreparedStatement stmt = conn.prepareStatement(sql);
if (stmt.executeQuery() != null) {
stmt.executeQuery();
rs = stmt.getResultSet();
while (rs.next()) {
ArrayList<String> Col = new ArrayList<String>();
for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
Col.add(rs.getString(i));
}
Rows.put(rs.getRow(), Col);
}
}
} catch (SQLException ex) {
System.out.println("Updating mcMMO MySQL tables for Blast Mining...");
Write("ALTER TABLE `"+LoadProperties.MySQLtablePrefix + "cooldowns` ADD `blast_mining` int(32) NOT NULL DEFAULT '0' ;");
}
}
// write query
public boolean Write(String sql) {
try {
Connection conn = DriverManager.getConnection(connectionString);
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.executeUpdate();
conn.close();
return true;
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
return false;
}
if(conn != null)
{
try {
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.executeUpdate();
return true;
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
return false;
}
} else
{
isConnected = false;
connect(); //Attempt to reconnect
if(isConnected = true)
{
Write(sql); //Try the same operation again now that we are connected
} else {
System.out.println("[mcMMO] Unable to connect to MySQL! Make sure the SQL server is online!");
}
}
return false;
}
// Get Int
@@ -159,26 +217,35 @@ public class Database {
public Integer GetInt(String sql) {
ResultSet rs = null;
Integer result = 0;
try {
Connection conn = DriverManager.getConnection(connectionString);
PreparedStatement stmt = conn.prepareStatement(sql);
stmt = conn.prepareStatement(sql);
if (stmt.executeQuery() != null) {
stmt.executeQuery();
rs = stmt.getResultSet();
if (rs.next()) {
result = rs.getInt(1);
} else {
result = 0;
}
}
conn.close();
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
if(conn != null)
{
try {
PreparedStatement stmt = conn.prepareStatement(sql);
stmt = conn.prepareStatement(sql);
if (stmt.executeQuery() != null) {
stmt.executeQuery();
rs = stmt.getResultSet();
if (rs.next()) {
result = rs.getInt(1);
} else {
result = 0;
}
}
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}
} else {
isConnected = false;
connect(); //Attempt to reconnect
if(isConnected = true)
{
GetInt(sql); //Try the same operation again now that we are connected
} else {
System.out.println("[mcMMO] Unable to connect to MySQL! Make sure the SQL server is online!");
}
}
return result;
}
@@ -186,25 +253,35 @@ public class Database {
public HashMap<Integer, ArrayList<String>> Read(String sql) {
ResultSet rs = null;
HashMap<Integer, ArrayList<String>> Rows = new HashMap<Integer, ArrayList<String>>();
try {
Connection conn = DriverManager.getConnection(connectionString);
PreparedStatement stmt = conn.prepareStatement(sql);
if (stmt.executeQuery() != null) {
stmt.executeQuery();
rs = stmt.getResultSet();
while (rs.next()) {
ArrayList<String> Col = new ArrayList<String>();
for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
Col.add(rs.getString(i));
}
Rows.put(rs.getRow(), Col);
}
}
conn.close();
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
if(conn != null)
{
try {
PreparedStatement stmt = conn.prepareStatement(sql);
if (stmt.executeQuery() != null) {
stmt.executeQuery();
rs = stmt.getResultSet();
while (rs.next()) {
ArrayList<String> Col = new ArrayList<String>();
for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
Col.add(rs.getString(i));
}
Rows.put(rs.getRow(), Col);
}
}
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}
} else {
isConnected = false;
connect(); //Attempt to reconnect
if(isConnected = true)
{
Read(sql); //Attempt the same operation again now that we are connected
} else {
System.out.println("[mcMMO] Unable to connect to MySQL! Make sure the SQL server is online!");
}
}
return Rows;
}

View File

@@ -16,16 +16,15 @@
*/
package com.gmail.nossr50;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.config.*;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.*;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
public class Item {
@@ -34,41 +33,24 @@ public class Item {
{
ItemStack inhand = player.getItemInHand();
if(LoadProperties.chimaeraWingEnable && inhand.getTypeId() == LoadProperties.chimaeraId)
{
chimaerawing(player, plugin);
}
}
@SuppressWarnings("deprecation")
public static void chimaerawing(Player player, Plugin plugin)
{
PlayerProfile PP = Users.getProfile(player);
ItemStack is = player.getItemInHand();
Block block = player.getLocation().getBlock();
if(mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == LoadProperties.chimaeraId)
int chimaeraID = LoadProperties.chimaeraId;
int itemsUsed = LoadProperties.feathersConsumedByChimaeraWing;
if(mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == chimaeraID)
{
if(Skills.cooldownOver(player, PP.getRecentlyHurt(), 60) && is.getAmount() >= LoadProperties.feathersConsumedByChimaeraWing)
if(Skills.cooldownOver(player, PP.getRecentlyHurt(), 60) && is.getAmount() >= itemsUsed)
{
Block derp = player.getLocation().getBlock();
int y = derp.getY();
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x != null && x.getTypeId() == LoadProperties.chimaeraId){
if(x.getAmount() >= LoadProperties.feathersConsumedByChimaeraWing + 1)
{
x.setAmount(x.getAmount() - LoadProperties.feathersConsumedByChimaeraWing);
player.getInventory().setContents(inventory);
player.updateInventory();
break;
} else {
x.setAmount(0);
x.setTypeId(0);
player.getInventory().setContents(inventory);
player.updateInventory();
break;
}
}
}
player.setItemInHand(new ItemStack(chimaeraID, is.getAmount() - itemsUsed));
while(y < 127)
{
y++;
@@ -82,23 +64,18 @@ public class Item {
}
}
}
if(PP.getMySpawn(player) != null)
{
Location mySpawn = PP.getMySpawn(player);
if(mySpawn != null){
player.teleport(mySpawn); //Do it twice to prevent weird stuff
player.teleport(mySpawn);
}
} else {
if(player.getBedSpawnLocation() != null && player.getBedSpawnLocation().getBlock().getType().equals(Material.BED_BLOCK))
player.teleport(player.getBedSpawnLocation());
else
player.teleport(player.getWorld().getSpawnLocation());
}
player.sendMessage(mcLocale.getString("Item.ChimaeraWingPass")); //$NON-NLS-1$
} else if (!Skills.cooldownOver(player, PP.getRecentlyHurt(), 60) && is.getAmount() >= 10)
{
player.sendMessage(mcLocale.getString("Item.InjuredWait", new Object[] {Skills.calculateTimeLeft(player, PP.getRecentlyHurt(), 60)})); //$NON-NLS-1$
} else if (is.getTypeId() == LoadProperties.chimaeraId && is.getAmount() <= 9){
player.sendMessage(mcLocale.getString("Item.NeedFeathers")); //$NON-NLS-1$
}
else if (!Skills.cooldownOver(player, PP.getRecentlyHurt(), 60) && is.getAmount() >= itemsUsed)
player.sendMessage(mcLocale.getString("Item.InjuredWait", new Object[] {Skills.calculateTimeLeft(player, PP.getRecentlyHurt(), 60)})); //$NON-NLS-1$
else if (is.getTypeId() == LoadProperties.chimaeraId && is.getAmount() <= itemsUsed)
player.sendMessage(mcLocale.getString("Item.NeedFeathers")); //$NON-NLS-1$
}
}
}

View File

@@ -53,8 +53,6 @@ public class Leaderboard
Tree Unarmed = new Tree();
Tree Taming = new Tree();
Tree Fishing = new Tree();
Tree Enchanting = new Tree();
Tree Alchemy = new Tree();
Tree PowerLevel = new Tree();
//Add Data To Trees
@@ -148,8 +146,6 @@ public class Leaderboard
leaderWrite(Acrobatics.inOrder(), SkillType.ACROBATICS); //$NON-NLS-1$
leaderWrite(Taming.inOrder(), SkillType.TAMING); //$NON-NLS-1$
leaderWrite(Fishing.inOrder(), SkillType.FISHING); //$NON-NLS-1$
leaderWrite(Alchemy.inOrder(), SkillType.ALCHEMY); //$NON-NLS-1$
leaderWrite(Enchanting.inOrder(), SkillType.ENCHANTING); //$NON-NLS-1$
leaderWrite(PowerLevel.inOrder(), SkillType.ALL); //$NON-NLS-1$
}
public static void leaderWrite(PlayerStat[] ps, SkillType skillType)

View File

@@ -0,0 +1,569 @@
/*
* Copyright 2011 Tyler Blair. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and contributors and should not be interpreted as representing official policies,
* either expressed or implied, of anybody else.
*/
package com.gmail.nossr50;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
public class Metrics {
/**
* The current revision number
*/
private final static int REVISION = 5;
/**
* The base url of the metrics domain
*/
private static final String BASE_URL = "http://metrics.griefcraft.com";
/**
* The url used to report a server's status
*/
private static final String REPORT_URL = "/report/%s";
/**
* The file where guid and opt out is stored in
*/
private static final String CONFIG_FILE = "plugins/PluginMetrics/config.yml";
/**
* The separator to use for custom data. This MUST NOT change unless you are hosting your own
* version of metrics and want to change it.
*/
private static final String CUSTOM_DATA_SEPARATOR = "~~";
/**
* Interval of time to ping (in minutes)
*/
private final static int PING_INTERVAL = 10;
/**
* A map of all of the graphs for each plugin
*/
private Map<Plugin, Set<Graph>> graphs = Collections.synchronizedMap(new HashMap<Plugin, Set<Graph>>());
/**
* A convenient map of the default Graph objects (used by addCustomData mainly)
*/
private Map<Plugin, Graph> defaultGraphs = Collections.synchronizedMap(new HashMap<Plugin, Graph>());
/**
* The plugin configuration file
*/
private final YamlConfiguration configuration;
/**
* Unique server id
*/
private String guid;
public Metrics() throws IOException {
// load the config
File file = new File(CONFIG_FILE);
configuration = YamlConfiguration.loadConfiguration(file);
// add some defaults
configuration.addDefault("opt-out", false);
configuration.addDefault("guid", UUID.randomUUID().toString());
// Do we need to create the file?
if (configuration.get("guid", null) == null) {
configuration.options().header("http://metrics.griefcraft.com").copyDefaults(true);
configuration.save(file);
}
// Load the guid then
guid = configuration.getString("guid");
}
/**
* Construct and create a Graph that can be used to separate specific plotters to their own graphs
* on the metrics website. Plotters can be added to the graph object returned.
*
* @param plugin
* @param type
* @param name
* @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given
*/
public Graph createGraph(Plugin plugin, Graph.Type type, String name) {
if (plugin == null || type == null || name == null) {
throw new IllegalArgumentException("All arguments must not be null");
}
// Construct the graph object
Graph graph = new Graph(type, name);
// Get the graphs for the plugin
Set<Graph> graphs = getOrCreateGraphs(plugin);
// Now we can add our graph
graphs.add(graph);
// and return back
return graph;
}
/**
* Adds a custom data plotter for a given plugin
*
* @param plugin
* @param plotter
*/
public void addCustomData(Plugin plugin, Plotter plotter) {
// The default graph for the plugin
Graph graph = getOrCreateDefaultGraph(plugin);
// Add the plotter to the graph o/
graph.addPlotter(plotter);
// Ensure the default graph is included in the submitted graphs
getOrCreateGraphs(plugin).add(graph);
}
/**
* Begin measuring a plugin
*
* @param plugin
*/
public void beginMeasuringPlugin(final Plugin plugin) {
// Did we opt out?
if (configuration.getBoolean("opt-out", false)) {
return;
}
// Begin hitting the server with glorious data
plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() {
private boolean firstPost = true;
public void run() {
try {
// We use the inverse of firstPost because if it is the first time we are posting,
// it is not a interval ping, so it evaluates to FALSE
// Each time thereafter it will evaluate to TRUE, i.e PING!
postPlugin(plugin, !firstPost);
// After the first post we set firstPost to false
// Each post thereafter will be a ping
firstPost = false;
} catch (IOException e) {
System.out.println("[Metrics] " + e.getMessage());
}
}
}, 0, PING_INTERVAL * 1200);
}
/**
* Generic method that posts a plugin to the metrics website
*
* @param plugin
*/
private void postPlugin(Plugin plugin, boolean isPing) throws IOException {
// The plugin's description file containg all of the plugin data such as name, version, author, etc
PluginDescriptionFile description = plugin.getDescription();
// The author string, created with description.getAuthors()
// Authors are separated by a comma
String authors = "";
// Add each author to the string
for (String author : description.getAuthors()) {
authors += author + ", ";
}
// If there were any authors at all, we need to remove the last 2 characters
// the last 2 characters are the last comma and space
if (!authors.isEmpty()) {
authors = authors.substring(0, authors.length() - 2);
}
// Construct the post data
String data = encode("guid") + '=' + encode(guid)
+ encodeDataPair("authors", authors)
+ encodeDataPair("version", description.getVersion())
+ encodeDataPair("server", Bukkit.getVersion())
+ encodeDataPair("players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length))
+ encodeDataPair("revision", String.valueOf(REVISION));
// If we're pinging, append it
if (isPing) {
data += encodeDataPair("ping", "true");
}
// Add any custom data available for the plugin
Set<Graph> graphs = getOrCreateGraphs(plugin);
// Acquire a lock on the graphs, which lets us make the assumption we also lock everything
// inside of the graph (e.g plotters)
synchronized(graphs) {
Iterator<Graph> iter = graphs.iterator();
while (iter.hasNext()) {
Graph graph = iter.next();
// Because we have a lock on the graphs set already, it is reasonable to assume
// that our lock transcends down to the individual plotters in the graphs also.
// Because our methods are private, no one but us can reasonably access this list
// without reflection so this is a safe assumption without adding more code.
for (Plotter plotter : graph.getPlotters()) {
// The key name to send to the metrics server
// The format is C-GRAPHNAME-PLOTTERNAME where separator - is defined at the top
// Legacy (R4) submitters use the format Custom%s, or CustomPLOTTERNAME
String key = String.format("C%s%s%s%s", CUSTOM_DATA_SEPARATOR, graph.getName(), CUSTOM_DATA_SEPARATOR, plotter.getColumnName());
// The value to send, which for the foreseeable future is just the string
// value of plotter.getValue()
String value = Integer.toString(plotter.getValue());
// Add it to the http post data :)
data += encodeDataPair(key, value);
}
}
}
// Create the url
URL url = new URL(BASE_URL + String.format(REPORT_URL, plugin.getDescription().getName()));
// Connect to the website
URLConnection connection;
// Mineshafter creates a socks proxy, so we can safely bypass it
// It does not reroute POST requests so we need to go around it
if (isMineshafterPresent()) {
connection = url.openConnection(Proxy.NO_PROXY);
} else {
connection = url.openConnection();
}
connection.setDoOutput(true);
// Write the data
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
writer.write(data);
writer.flush();
// Now read the response
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String response = reader.readLine();
// close resources
writer.close();
reader.close();
if (response.startsWith("ERR")) {
throw new IOException(response); //Throw the exception
} else {
// Is this the first update this hour?
if (response.contains("OK This is your first update this hour")) {
synchronized (graphs) {
Iterator<Graph> iter = graphs.iterator();
while (iter.hasNext()) {
Graph graph = iter.next();
for (Plotter plotter : graph.getPlotters()) {
plotter.reset();
}
}
}
}
}
//if (response.startsWith("OK")) - We should get "OK" followed by an optional description if everything goes right
}
/**
* Get or create the Set of graphs for a specific plugin
*
* @param plugin
* @return
*/
private Set<Graph> getOrCreateGraphs(Plugin plugin) {
Set<Graph> theGraphs = graphs.get(plugin);
// Create the Set if it does not already exist
if (theGraphs == null) {
theGraphs = Collections.synchronizedSet(new HashSet<Graph>());
graphs.put(plugin, theGraphs);
}
return theGraphs;
}
/**
* Get the default graph for a plugin and if it does not exist, create one
*
* @param plugin
* @return
*/
private Graph getOrCreateDefaultGraph(Plugin plugin) {
Graph graph = defaultGraphs.get(plugin);
// Not yet created :(
if (graph == null) {
graph = new Graph(Graph.Type.Line, "Default");
defaultGraphs.put(plugin, graph);
}
return graph;
}
/**
* Check if mineshafter is present. If it is, we need to bypass it to send POST requests
*
* @return
*/
private boolean isMineshafterPresent() {
try {
Class.forName("mineshafter.MineServer");
return true;
} catch (Exception e) {
return false;
}
}
/**
* Encode a key/value data pair to be used in a HTTP post request. This INCLUDES a & so the first
* key/value pair MUST be included manually, e.g:
* <p>
* String httpData = encode("guid") + "=" + encode("1234") + encodeDataPair("authors") + "..";
* </p>
*
* @param key
* @param value
* @return
*/
private static String encodeDataPair(String key, String value) throws UnsupportedEncodingException {
return "&" + encode(key) + "=" + encode(value);
}
/**
* Encode text as UTF-8
*
* @param text
* @return
*/
private static String encode(String text) throws UnsupportedEncodingException {
return URLEncoder.encode(text, "UTF-8");
}
/**
* Represents a custom graph on the website
*/
public static class Graph {
/**
* The graph's type that will be visible on the website
*/
public static enum Type {
/**
* A simple line graph which also includes a scrollable timeline viewer to view
* as little or as much of the data as possible.
*/
Line,
/**
* An area graph. This is the same as a line graph except the area under the curve is shaded
*/
Area,
/**
* A column graph, which is a graph where the data is represented by columns on the vertical axis,
* i.e they go up and down.
*/
Column,
/**
* A pie graph. The graph is generated by taking the data for the last hour and summing it
* together. Then the percentage for each plotter is calculated via round( (plot / total) * 100, 2 )
*/
Pie
}
/**
* What the graph should be plotted as
*/
private final Type type;
/**
* The graph's name, alphanumeric and spaces only :)
* If it does not comply to the above when submitted, it is rejected
*/
private final String name;
/**
* The set of plotters that are contained within this graph
*/
private final Set<Plotter> plotters = new LinkedHashSet<Plotter>();
private Graph(Type type, String name) {
this.type = type;
this.name = name;
}
/**
* Gets the graph's name
*
* @return
*/
public String getName() {
return name;
}
/**
* Add a plotter to the graph, which will be used to plot entries
*
* @param plotter
*/
public void addPlotter(Plotter plotter) {
plotters.add(plotter);
}
/**
* Remove a plotter from the graph
*
* @param plotter
*/
public void removePlotter(Plotter plotter) {
plotters.remove(plotter);
}
/**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph
* @return
*/
public Set<Plotter> getPlotters() {
return Collections.unmodifiableSet(plotters);
}
@Override
public int hashCode() {
return (type.hashCode() * 17) ^ name.hashCode();
}
@Override
public boolean equals(Object object) {
if (!(object instanceof Graph)) {
return false;
}
Graph graph = (Graph) object;
return graph.type == type && graph.name.equals(name);
}
}
/**
* Interface used to collect custom data for a plugin
*/
public static abstract class Plotter {
/**
* The plot's name
*/
private final String name;
/**
* Construct a plotter with the default plot name
*/
public Plotter() {
this("Default");
}
/**
* Construct a plotter with a specific plot name
*
* @param name
*/
public Plotter(String name) {
this.name = name;
}
/**
* Get the current value for the plotted point
*
* @return
*/
public abstract int getValue();
/**
* Get the column name for the plotted point
*
* @return the plotted point's column name
*/
public String getColumnName() {
return name;
}
/**
* Called after the website graphs have been updated
*/
public void reset() {
}
@Override
public int hashCode() {
return getColumnName().hashCode() + getValue();
}
@Override
public boolean equals(Object object) {
if (!(object instanceof Plotter)) {
return false;
}
Plotter plotter = (Plotter) object;
return plotter.name.equals(name) && plotter.getValue() == getValue();
}
}
}

View File

@@ -70,7 +70,8 @@ public class Users {
public static void addUser(Player player)
{
players.put(player, new PlayerProfile(player));
if(!players.containsKey(player))
players.put(player, new PlayerProfile(player.getName()));
}
public static void clearUsers()
{
@@ -82,26 +83,43 @@ public class Users {
public static void removeUser(Player player)
{
PlayerProfile PP = Users.getProfile(player);
if(PP != null)
//Only remove PlayerProfile if user is offline and we have it in memory
if(!player.isOnline() && players.containsKey(player))
{
PP.save();
if(players.containsKey(player))
players.remove(player);
players.get(player).save();
players.remove(player);
}
}
public static void removeUserByName(String playerName)
{
Player target = null;
for(Player player : players.keySet())
{
PlayerProfile PP = players.get(player);
if(PP.getPlayerName().equals(playerName))
{
target = player;
}
}
players.remove(target);
}
public static PlayerProfile getProfile(Player player){
if(players.get(player) != null)
return players.get(player);
else
{
players.put(player, new PlayerProfile(player));
players.put(player, new PlayerProfile(player.getName()));
return players.get(player);
}
}
public static PlayerProfile getOfflineProfile(String playerName){
return new PlayerProfile(playerName, false);
}
public static Users getInstance() {
if (instance == null) {
instance = new Users();

View File

@@ -0,0 +1,81 @@
package com.gmail.nossr50.commands.general;
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.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
public class AddlevelsCommand implements CommandExecutor{
private final mcMMO plugin;
public AddlevelsCommand(mcMMO instance) {
this.plugin = instance;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (player != null && !mcPermissions.getInstance().mmoedit(player)) {
sender.sendMessage("This command requires permissions.");
return true;
}
if (!(sender instanceof Player)) {
if (args.length < 2) {
System.out.println("Usage is /addlevels playername skillname levels");
return true;
} else if (args.length == 3) {
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
int levels = Integer.valueOf(args[2]);
Users.getProfile(plugin.getServer().getPlayer(args[0])).addLevels(Skills.getSkillType(args[1]), levels);
System.out.println(args[1] + " has been modified for " + plugin.getServer().getPlayer(args[0]).getName() + ".");
}
} else {
System.out.println("Usage is /addlevels playername skillname levels");
}
return true;
}
PlayerProfile PP = Users.getProfile(player);
if (!mcPermissions.getInstance().mmoedit(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (args.length < 2) {
player.sendMessage(ChatColor.RED + "Usage is /addlevels playername skillname levels");
return true;
}
if (args.length == 3) {
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
int levels = Integer.valueOf(args[2]);
Users.getProfile(plugin.getServer().getPlayer(args[0])).addLevels(Skills.getSkillType(args[1]), levels);
player.sendMessage(ChatColor.RED + args[1] + " has been modified.");
}
} else if (args.length == 2) {
if (m.isInt(args[1]) && Skills.isSkill(args[0])) {
int levels = Integer.valueOf(args[1]);
PP.addLevels(Skills.getSkillType(args[0]), levels);
player.sendMessage(ChatColor.RED + args[0] + " has been modified.");
}
} else {
player.sendMessage(ChatColor.RED + "Usage is /addlevels playername skillname newvalue");
}
return true;
}
}

View File

@@ -10,7 +10,6 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
@@ -23,16 +22,16 @@ public class AddxpCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!mcPermissions.permissionsEnabled) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (player != null && !mcPermissions.getInstance().mmoedit(player)) {
sender.sendMessage("This command requires permissions.");
return true;
}
if (!LoadProperties.addxpEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
if (args.length < 2) {
// No console aliasing yet
@@ -42,7 +41,7 @@ public class AddxpCommand implements CommandExecutor {
} else if (args.length == 3) {
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
int newvalue = Integer.valueOf(args[2]);
Users.getProfile(plugin.getServer().getPlayer(args[0])).addXP(Skills.getSkillType(args[1]), newvalue, plugin.getServer().getPlayer(args[0]));
Users.getProfile(plugin.getServer().getPlayer(args[0])).addXPOverrideNoBonus(Skills.getSkillType(args[1]), newvalue);
plugin.getServer().getPlayer(args[0]).sendMessage(ChatColor.GREEN + "Experience granted!");
System.out.println(args[1] + " has been modified for " + plugin.getServer().getPlayer(args[0]).getName() + ".");
Skills.XpCheckAll(plugin.getServer().getPlayer(args[0]));
@@ -55,8 +54,6 @@ public class AddxpCommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
if (!mcPermissions.getInstance().mmoedit(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;

View File

@@ -1,46 +0,0 @@
package com.gmail.nossr50.commands.general;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
public class ClearmyspawnCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.clearmyspawnEnable || !LoadProperties.enableMySpawn) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
return true;
}
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
if (!mcPermissions.getInstance().mySpawn(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
double x = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getX();
double y = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getY();
double z = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getZ();
String worldname = Bukkit.getServer().getWorlds().get(0).getName();
PP.setMySpawn(x, y, z, worldname);
player.sendMessage(mcLocale.getString("mcPlayerListener.MyspawnCleared"));
return true;
}
}

View File

@@ -0,0 +1,128 @@
package com.gmail.nossr50.commands.general;
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.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
public class InspectCommand implements CommandExecutor {
private final mcMMO plugin;
public InspectCommand(mcMMO instance) {
this.plugin = instance;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (sender instanceof Player && !mcPermissions.getInstance().inspect(player)) {
sender.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (args.length < 1) {
sender.sendMessage(ChatColor.RED + "Proper usage is /whois <playername>");
return true;
}
// if split[1] is an online player
if (plugin.getServer().getPlayer(args[0]) != null)
{
Player target = plugin.getServer().getPlayer(args[0]);
PlayerProfile PPt = Users.getProfile(target);
//If they are not an Op they have to be close
if(sender instanceof Player && !player.isOp() && !m.isNear(player.getLocation(), target.getLocation(), 5))
{
sender.sendMessage("You are too far away to inspect that player!");
}
sender.sendMessage(ChatColor.GREEN + "mcMMO Stats for " + ChatColor.YELLOW + target.getName());
sender.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-");
if (mcPermissions.getInstance().excavation(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION)));
if (mcPermissions.getInstance().fishing(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PPt.getSkillLevel(SkillType.FISHING), PPt.getSkillXpLevel(SkillType.FISHING), PPt.getXpToLevel(SkillType.FISHING)));
if (mcPermissions.getInstance().herbalism(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM)));
if (mcPermissions.getInstance().mining(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.MiningSkill"), PPt.getSkillLevel(SkillType.MINING), PPt.getSkillXpLevel(SkillType.MINING), PPt.getXpToLevel(SkillType.MINING)));
if (mcPermissions.getInstance().woodcutting(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.WoodcuttingSkill"), PPt.getSkillLevel(SkillType.WOODCUTTING), PPt.getSkillXpLevel(SkillType.WOODCUTTING), PPt.getXpToLevel(SkillType.WOODCUTTING)));
sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-");
if (mcPermissions.getInstance().axes(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PPt.getSkillLevel(SkillType.AXES), PPt.getSkillXpLevel(SkillType.AXES), PPt.getXpToLevel(SkillType.AXES)));
if (mcPermissions.getInstance().archery(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ArcherySkill"), PPt.getSkillLevel(SkillType.ARCHERY), PPt.getSkillXpLevel(SkillType.ARCHERY), PPt.getXpToLevel(SkillType.ARCHERY)));
if (mcPermissions.getInstance().swords(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SwordsSkill"), PPt.getSkillLevel(SkillType.SWORDS), PPt.getSkillXpLevel(SkillType.SWORDS), PPt.getXpToLevel(SkillType.SWORDS)));
if (mcPermissions.getInstance().taming(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.TamingSkill"), PPt.getSkillLevel(SkillType.TAMING), PPt.getSkillXpLevel(SkillType.TAMING), PPt.getXpToLevel(SkillType.TAMING)));
if (mcPermissions.getInstance().unarmed(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.UnarmedSkill"), PPt.getSkillLevel(SkillType.UNARMED), PPt.getSkillXpLevel(SkillType.UNARMED), PPt.getXpToLevel(SkillType.UNARMED)));
sender.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-");
if (mcPermissions.getInstance().acrobatics(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS)));
if (mcPermissions.getInstance().repair(target))
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
sender.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel") + ChatColor.GREEN + (m.getPowerLevel(target)));
} else {
if(sender instanceof Player && !player.isOp())
{
sender.sendMessage("That player is offline, inspecting offline players is limited to Ops!");
return true;
}
PlayerProfile PPt = Users.getOfflineProfile(args[0]);
if(!PPt.isLoaded())
{
sender.sendMessage("Player does not exist in the database!");
return true;
}
System.out.println(PPt.isLoaded());
sender.sendMessage(ChatColor.GREEN + "mcMMO Stats for Offline Player " + ChatColor.YELLOW + args[0]);
sender.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-");
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PPt.getSkillLevel(SkillType.FISHING), PPt.getSkillXpLevel(SkillType.FISHING), PPt.getXpToLevel(SkillType.FISHING)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.MiningSkill"), PPt.getSkillLevel(SkillType.MINING), PPt.getSkillXpLevel(SkillType.MINING), PPt.getXpToLevel(SkillType.MINING)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.WoodcuttingSkill"), PPt.getSkillLevel(SkillType.WOODCUTTING), PPt.getSkillXpLevel(SkillType.WOODCUTTING), PPt.getXpToLevel(SkillType.WOODCUTTING)));
sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-");
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PPt.getSkillLevel(SkillType.AXES), PPt.getSkillXpLevel(SkillType.AXES), PPt.getXpToLevel(SkillType.AXES)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ArcherySkill"), PPt.getSkillLevel(SkillType.ARCHERY), PPt.getSkillXpLevel(SkillType.ARCHERY), PPt.getXpToLevel(SkillType.ARCHERY)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SwordsSkill"), PPt.getSkillLevel(SkillType.SWORDS), PPt.getSkillXpLevel(SkillType.SWORDS), PPt.getXpToLevel(SkillType.SWORDS)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.TamingSkill"), PPt.getSkillLevel(SkillType.TAMING), PPt.getSkillXpLevel(SkillType.TAMING), PPt.getXpToLevel(SkillType.TAMING)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.UnarmedSkill"), PPt.getSkillLevel(SkillType.UNARMED), PPt.getSkillXpLevel(SkillType.UNARMED), PPt.getXpToLevel(SkillType.UNARMED)));
sender.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-");
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS)));
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
}
return true;
}
}

View File

@@ -9,32 +9,31 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
public class StatsCommand implements CommandExecutor {
public class McstatsCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.statsEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
return true;
}
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
return true;
}
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
player.sendMessage(mcLocale.getString("mcPlayerListener.YourStats"));
if (mcPermissions.getEnabled())
player.sendMessage(mcLocale.getString("mcPlayerListener.NoSkillNote"));
player.sendMessage(mcLocale.getString("mcPlayerListener.NoSkillNote"));
ChatColor header = ChatColor.GOLD;
@@ -57,8 +56,6 @@ public class StatsCommand implements CommandExecutor {
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES)));
if (mcPermissions.getInstance().archery(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ArcherySkill"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY)));
// if(mcPermissions.getInstance().sorcery(player))
// player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SorcerySkill"), PP.getSkill("sorcery"), PP.getSkill("sorceryXP"), PP.getXpToLevel("excavation")));
if (mcPermissions.getInstance().swords(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SwordsSkill"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS)));
if (mcPermissions.getInstance().taming(player))
@@ -71,10 +68,6 @@ public class StatsCommand implements CommandExecutor {
player.sendMessage(header + "-=MISC SKILLS=-");
if (mcPermissions.getInstance().acrobatics(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS)));
// if(mcPermissions.getInstance().alchemy(player))
// player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AlchemySkill"), PP.getSkillLevel(SkillType.ALCHEMY), PP.getSkillXpLevel(SkillType.ALCHEMY), PP.getXpToLevel(SkillType.ALCHEMY)));
// if(mcPermissions.getInstance().enchanting(player))
// player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.EnchantingSkill"), PP.getSkillLevel(SkillType.ENCHANTING), PP.getSkillXpLevel(SkillType.ENCHANTING), PP.getXpToLevel(SkillType.ENCHANTING)));
if (mcPermissions.getInstance().repair(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR)));
}

View File

@@ -10,7 +10,6 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
@@ -24,16 +23,16 @@ public class MmoeditCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!mcPermissions.permissionsEnabled) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (player != null && !mcPermissions.getInstance().mmoedit(player)) {
sender.sendMessage("This command requires permissions.");
return true;
}
if (!LoadProperties.mmoeditEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
if (args.length < 2) {
System.out.println("Usage is /mmoedit playername skillname newvalue");
@@ -51,7 +50,6 @@ public class MmoeditCommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
if (!mcPermissions.getInstance().mmoedit(player)) {

View File

@@ -1,58 +0,0 @@
package com.gmail.nossr50.commands.general;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
public class MyspawnCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.myspawnEnable || !LoadProperties.enableMySpawn) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
return true;
}
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
if (!mcPermissions.getInstance().mySpawn(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (System.currentTimeMillis() < (PP.getMySpawnATS() * 1000) + 3600000) {
long x = (((PP.getMySpawnATS() * 1000) + 3600000) - System.currentTimeMillis());
int y = (int) (x / 60000);
int z = (int) ((x / 1000) - (y * 60));
player.sendMessage(mcLocale.getString("mcPlayerListener.MyspawnTimeNotice", new Object[] { y, z }));
return true;
}
PP.setMySpawnATS(System.currentTimeMillis());
if (PP.getMySpawn(player) != null) {
Location mySpawn = PP.getMySpawn(player);
if (mySpawn != null) {
// It's done twice because it acts oddly when you are in another world
player.teleport(mySpawn);
player.teleport(mySpawn);
}
} else {
player.sendMessage(mcLocale.getString("mcPlayerListener.MyspawnNotExist"));
}
return true;
}
}

View File

@@ -1,98 +0,0 @@
package com.gmail.nossr50.commands.general;
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.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
public class WhoisCommand implements CommandExecutor {
private final mcMMO plugin;
public WhoisCommand(mcMMO instance) {
this.plugin = instance;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.whoisEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
Player player = (Player) sender;
if (!mcPermissions.getInstance().whois(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (args.length < 1) {
player.sendMessage(ChatColor.RED + "Proper usage is /whois <playername>");
return true;
}
// if split[1] is a player
if (plugin.getServer().getPlayer(args[0]) != null) {
Player target = plugin.getServer().getPlayer(args[0]);
PlayerProfile PPt = Users.getProfile(target);
player.sendMessage(ChatColor.GREEN + "~~WHOIS RESULTS~~");
player.sendMessage(target.getName());
if (PPt.inParty())
player.sendMessage("Party: " + PPt.getParty());
player.sendMessage("Health: " + target.getHealth() + ChatColor.GRAY + " (20 is full health)");
player.sendMessage("OP: " + target.isOp());
player.sendMessage(ChatColor.GREEN + "mcMMO Stats for " + ChatColor.YELLOW + target.getName());
player.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-");
if (mcPermissions.getInstance().excavation(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION)));
if (mcPermissions.getInstance().fishing(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PPt.getSkillLevel(SkillType.FISHING), PPt.getSkillXpLevel(SkillType.FISHING), PPt.getXpToLevel(SkillType.FISHING)));
if (mcPermissions.getInstance().herbalism(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM)));
if (mcPermissions.getInstance().mining(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.MiningSkill"), PPt.getSkillLevel(SkillType.MINING), PPt.getSkillXpLevel(SkillType.MINING), PPt.getXpToLevel(SkillType.MINING)));
if (mcPermissions.getInstance().woodcutting(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.WoodcuttingSkill"), PPt.getSkillLevel(SkillType.WOODCUTTING), PPt.getSkillXpLevel(SkillType.WOODCUTTING), PPt.getXpToLevel(SkillType.WOODCUTTING)));
player.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-");
if (mcPermissions.getInstance().axes(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PPt.getSkillLevel(SkillType.AXES), PPt.getSkillXpLevel(SkillType.AXES), PPt.getXpToLevel(SkillType.AXES)));
if (mcPermissions.getInstance().archery(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ArcherySkill"), PPt.getSkillLevel(SkillType.ARCHERY), PPt.getSkillXpLevel(SkillType.ARCHERY), PPt.getXpToLevel(SkillType.ARCHERY)));
// if(mcPermissions.getInstance().sorcery(target))
// player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SorcerySkill"), PPt.getSkill("sorcery"), PPt.getSkill("sorceryXP"), PPt.getXpToLevel("excavation")));
if (mcPermissions.getInstance().swords(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SwordsSkill"), PPt.getSkillLevel(SkillType.SWORDS), PPt.getSkillXpLevel(SkillType.SWORDS), PPt.getXpToLevel(SkillType.SWORDS)));
if (mcPermissions.getInstance().taming(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.TamingSkill"), PPt.getSkillLevel(SkillType.TAMING), PPt.getSkillXpLevel(SkillType.TAMING), PPt.getXpToLevel(SkillType.TAMING)));
if (mcPermissions.getInstance().unarmed(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.UnarmedSkill"), PPt.getSkillLevel(SkillType.UNARMED), PPt.getSkillXpLevel(SkillType.UNARMED), PPt.getXpToLevel(SkillType.UNARMED)));
player.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-");
if (mcPermissions.getInstance().acrobatics(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS)));
// if(mcPermissions.getInstance().alchemy(target))
// player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AlchemySkill"), PPt.getSkillLevel(SkillType.ALCHEMY), PPt.getSkillXpLevel(SkillType.ALCHEMY), PPt.getXpToLevel(SkillType.ALCHEMY)));
// if(mcPermissions.getInstance().enchanting(target))
// player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.EnchantingSkill"), PPt.getSkillLevel(SkillType.ENCHANTING), PPt.getSkillXpLevel(SkillType.ENCHANTING), PPt.getXpToLevel(SkillType.ENCHANTING)));
if (mcPermissions.getInstance().repair(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
player.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel") + ChatColor.GREEN + (m.getPowerLevel(target)));
}
return true;
}
}

View File

@@ -19,16 +19,12 @@ public class XprateCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.xprateEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
if(args.length <= 0)
{
System.out.println(mcLocale.getString("Commands.xprate.proper", new Object[] {"/xprate"}));
System.out.println(mcLocale.getString("Commands.xprate.proper2", new Object[] {"/xprate"}));
System.out.println(mcLocale.getString("Commands.xprate.proper", new Object[] {"xprate"}));
System.out.println(mcLocale.getString("Commands.xprate.proper2", new Object[] {"xprate"}));
}
if(args.length == 1 && args[0].equalsIgnoreCase("reset"))
@@ -67,6 +63,8 @@ public class XprateCommand implements CommandExecutor {
x.sendMessage(ChatColor.GOLD+"XP EVENT FOR mcMMO HAS STARTED!");
x.sendMessage(ChatColor.GOLD+"mcMMO XP RATE IS NOW "+LoadProperties.xpGainMultiplier+"x!!");
}
System.out.println("The XP RATE was modified to "+LoadProperties.xpGainMultiplier);
}
return true;
@@ -81,8 +79,8 @@ public class XprateCommand implements CommandExecutor {
}
if(args.length <= 0)
{
player.sendMessage(mcLocale.getString("Commands.xprate.proper", new Object[] {"/xprate"}));
player.sendMessage(mcLocale.getString("Commands.xprate.proper2", new Object[] {"/xprate"}));
player.sendMessage(mcLocale.getString("Commands.xprate.proper", new Object[] {"xprate"}));
player.sendMessage(mcLocale.getString("Commands.xprate.proper2", new Object[] {"xprate"}));
}
if(args.length == 1 && args[0].equalsIgnoreCase("reset"))
{

View File

@@ -1,5 +1,6 @@
package com.gmail.nossr50.commands.mc;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@@ -7,20 +8,19 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
public class McabilityCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!mcPermissions.permissionsEnabled) {
sender.sendMessage("This command requires permissions.");
return true;
}
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (!LoadProperties.mcabilityEnable) {
sender.sendMessage("This command is not enabled.");
if (player != null && !mcPermissions.getInstance().mcAbility(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
@@ -29,7 +29,6 @@ public class McabilityCommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
if (PP.getAbilityUse()) {

View File

@@ -7,16 +7,11 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.locale.mcLocale;
public class MccCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.mccEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
@@ -42,22 +37,17 @@ public class MccCommand implements CommandExecutor {
player.sendMessage("/ptp " + mcLocale.getString("m.mccPartyTeleport"));
}
player.sendMessage(mcLocale.getString("m.mccOtherCommands"));
player.sendMessage("/stats " + ChatColor.RED + " " + mcLocale.getString("m.mccStats"));
player.sendMessage("/mcstats " + ChatColor.RED + " " + mcLocale.getString("m.mccStats"));
player.sendMessage("/mctop <skillname> <page> " + ChatColor.RED + mcLocale.getString("m.mccLeaderboards"));
if (mcPermissions.getInstance().mySpawn(player)) {
player.sendMessage("/myspawn " + ChatColor.RED + mcLocale.getString("m.mccMySpawn"));
player.sendMessage("/clearmyspawn " + ChatColor.RED + mcLocale.getString("m.mccClearMySpawn"));
}
if (mcPermissions.getInstance().mcAbility(player))
player.sendMessage("/mcability" + ChatColor.RED + " " + mcLocale.getString("m.mccToggleAbility"));
if (mcPermissions.getInstance().adminChat(player))
player.sendMessage("/a " + ChatColor.RED + mcLocale.getString("m.mccAdminToggle"));
if (mcPermissions.getInstance().whois(player))
player.sendMessage("/whois " + mcLocale.getString("m.mccWhois"));
if (mcPermissions.getInstance().inspect(player))
player.sendMessage("/inspect " + mcLocale.getString("m.mccInspect"));
if (mcPermissions.getInstance().mmoedit(player))
player.sendMessage("/mmoedit" + mcLocale.getString("m.mccMmoedit"));

View File

@@ -8,17 +8,12 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
public class McgodCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.mcgodEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
@@ -28,12 +23,12 @@ public class McgodCommand implements CommandExecutor {
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
if (mcPermissions.permissionsEnabled) {
if (!mcPermissions.getInstance().mcgod(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (!mcPermissions.getInstance().mcgod(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (mcPermissions.getInstance().mcgod(player)) {
if (PP.getGodMode()) {
player.sendMessage(mcLocale.getString("mcPlayerListener.GodModeDisabled"));
PP.toggleGodMode();

View File

@@ -1,31 +1,19 @@
package com.gmail.nossr50.commands.mc;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.player.SpoutPlayer;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.mcMMO;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class McmmoCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.mcmmoEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
@@ -34,8 +22,7 @@ public class McmmoCommand implements CommandExecutor {
Player player = (Player) sender;
player.sendMessage(ChatColor.RED + "-----[]" + ChatColor.GREEN + "mcMMO" + ChatColor.RED + "[]-----");
String description = mcLocale.getString("mcMMO.Description", new Object[] { "/mcc" });
String description = mcLocale.getString("mcMMO.Description", new Object[] { "mcc" });
String[] mcSplit = description.split(",");
for (String x : mcSplit) {
@@ -45,39 +32,12 @@ public class McmmoCommand implements CommandExecutor {
if (LoadProperties.spoutEnabled && player instanceof SpoutPlayer) {
SpoutPlayer sPlayer = (SpoutPlayer) player;
if (LoadProperties.donateMessage)
player.sendMessage(ChatColor.GREEN + "[mcMMO] Donate! Paypal theno1yeti@gmail.com");
sPlayer.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"theno1yeti@gmail.com");
} else {
if (LoadProperties.donateMessage)
player.sendMessage(ChatColor.GREEN + "If you like my work you can donate via Paypal: theno1yeti@gmail.com");
player.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"theno1yeti@gmail.com");
}
GregorianCalendar cakedayStart = new GregorianCalendar(2012, Calendar.FEBRUARY, 3);
GregorianCalendar cakedayEnd = new GregorianCalendar(2012, Calendar.FEBRUARY, 6);
GregorianCalendar day = new GregorianCalendar();
int cakeCheck = 0;
for (String cake : mcMMO.gotCake)
{
if (player.getName().equalsIgnoreCase(cake)) {
cakeCheck = 1;
}
}
if (cakeCheck == 0) {
if (getDateRange(day.getTime(), cakedayStart.getTime(), cakedayEnd.getTime()))
{
player.sendMessage(ChatColor.BLUE + "Happy 1 Year Anniversary! In honor of all of");
player.sendMessage(ChatColor.BLUE + "nossr50's work and all the devs, have some cake!");
}
mcMMO.gotCake.add(player.getName());
player.getInventory().addItem(new ItemStack(Material.CAKE_BLOCK, 1));
}
return true;
}
private boolean getDateRange(Date date, Date start, Date end)
{
return !(date.before(start) || date.after(end));
}
}

View File

@@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
@@ -22,10 +21,6 @@ public class McrefreshCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.mcrefreshEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
@@ -54,37 +49,16 @@ public class McrefreshCommand implements CommandExecutor {
PP.setFistsPreparationMode(false);
PP.setSwordsPreparationMode(false);
PP.setPickaxePreparationMode(false);
/*
* GREEN TERRA
*/
PP.setGreenTerraMode(false);
PP.setGreenTerraDeactivatedTimeStamp((long) 0);
/*
* GIGA DRILL BREAKER
*/
//RESET COOLDOWNS
PP.resetCooldowns();
PP.setGreenTerraMode(false);
PP.setGigaDrillBreakerMode(false);
PP.setGigaDrillBreakerDeactivatedTimeStamp((long) 0);
/*
* SERRATED STRIKE
*/
PP.setSerratedStrikesMode(false);
PP.setSerratedStrikesDeactivatedTimeStamp((long) 0);
/*
* SUPER BREAKER
*/
PP.setSuperBreakerMode(false);
PP.setSuperBreakerDeactivatedTimeStamp((long) 0);
/*
* TREE FELLER
*/
PP.setTreeFellerMode(false);
PP.setTreeFellerDeactivatedTimeStamp((long) 0);
/*
* BERSERK
*/
PP.setBerserkMode(false);
PP.setBerserkDeactivatedTimeStamp((long) 0);
player.sendMessage(mcLocale.getString("mcPlayerListener.AbilitiesRefreshed"));

View File

@@ -0,0 +1,109 @@
package com.gmail.nossr50.commands.mc;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.locale.mcLocale;
public class McremoveCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (player != null && !mcPermissions.getInstance().mcremove(player)) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if(args.length == 0)
{
sender.sendMessage("Correct usage is /mcremove [Player Name]");
return true;
}
String playerName = args[0]; //Player that we are going to remove
//If the server is using MySQL
if(LoadProperties.useMySQL)
{
int userId = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'");
//Remove user from tables
mcMMO.database.Write("DELETE FROM "
+LoadProperties.MySQLdbName+"."
+LoadProperties.MySQLtablePrefix+"users WHERE "
+LoadProperties.MySQLtablePrefix+"users.id="+userId);
mcMMO.database.Write("DELETE FROM "
+LoadProperties.MySQLdbName+"."
+LoadProperties.MySQLtablePrefix+"cooldowns WHERE "
+LoadProperties.MySQLtablePrefix+"cooldowns.user_id="+userId);
mcMMO.database.Write("DELETE FROM "
+LoadProperties.MySQLdbName+"."
+LoadProperties.MySQLtablePrefix+"huds WHERE "
+LoadProperties.MySQLtablePrefix+"huds.user_id="+userId);
mcMMO.database.Write("DELETE FROM "
+LoadProperties.MySQLdbName+"."
+LoadProperties.MySQLtablePrefix+"skills WHERE "
+LoadProperties.MySQLtablePrefix+"skills.user_id="+userId);
mcMMO.database.Write("DELETE FROM "
+LoadProperties.MySQLdbName+"."
+LoadProperties.MySQLtablePrefix+"experience WHERE "
+LoadProperties.MySQLtablePrefix+"experience.user_id="+userId);
sender.sendMessage("User "+playerName+" removed from MySQL DB!");
} else {
//FlatFile removal
//TODO: Properly remove users from FlatFile, it's going to be a huge bitch with how our FlatFile system works. Let's adopt SQLite support.
if(Bukkit.getServer().getPlayer(playerName) != null)
{
Player targetPlayer = Bukkit.getServer().getPlayer(playerName);
if(targetPlayer.isOnline())
{
Users.getProfile(targetPlayer).resetAllData();
sender.sendMessage("User "+playerName+" removed from FlatFile DB!");
} else {
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online.");
return true;
}
} else {
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online.");
return true;
}
}
//Force PlayerProfile stuff to update
if(Bukkit.getServer().getPlayer(playerName) != null)
{
Player targetPlayer = Bukkit.getServer().getPlayer(playerName);
if(targetPlayer.isOnline())
{
targetPlayer.kickPlayer("[mcMMO] Stats have been reset! Rejoin!");
Users.removeUserByName(playerName);
} else {
Users.removeUser(targetPlayer);
}
} else {
Users.removeUserByName(playerName);
}
sender.sendMessage("[mcMMO] mcremove operation completed.");
return true;
}
}

View File

@@ -20,10 +20,6 @@ import com.gmail.nossr50.skills.Skills;
public class MctopCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.mctopEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");

View File

@@ -44,10 +44,12 @@ public class ACommand implements CommandExecutor {
return true;
}
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (!mcPermissions.getInstance().adminChat(player) && !player.isOp()) {
if (player != null && !mcPermissions.getInstance().adminChat(player) && !player.isOp()) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
@@ -70,19 +72,23 @@ public class ACommand implements CommandExecutor {
return true;
}
if (PP.getPartyChatMode())
PP.togglePartyChat();
PP.toggleAdminChat();
if (PP.getAdminChatMode()) {
player.sendMessage(mcLocale.getString("mcPlayerListener.AdminChatOn"));
// player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.GREEN + "On");
} else {
player.sendMessage(mcLocale.getString("mcPlayerListener.AdminChatOff"));
// player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.RED + "Off");
if(player != null)
{
PlayerProfile PP = Users.getProfile(player);
if (PP.getPartyChatMode())
PP.togglePartyChat();
PP.toggleAdminChat();
if (PP.getAdminChatMode()) {
player.sendMessage(mcLocale.getString("mcPlayerListener.AdminChatOn"));
// player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.GREEN + "On");
} else {
player.sendMessage(mcLocale.getString("mcPlayerListener.AdminChatOff"));
// player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.RED + "Off");
}
}
return true;
}
}

View File

@@ -8,7 +8,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
@@ -16,10 +15,6 @@ import com.gmail.nossr50.party.Party;
public class AcceptCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.acceptEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");

View File

@@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
@@ -23,10 +22,6 @@ public class InviteCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.inviteEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");

View File

@@ -26,10 +26,6 @@ public class PCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.partyEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
// Console message?
if (!(sender instanceof Player)) {
@@ -72,7 +68,7 @@ public class PCommand implements CommandExecutor {
String name = (LoadProperties.pDisplayNames) ? player.getDisplayName() : player.getName();
String pPrefix = ChatColor.GREEN + "(" + ChatColor.WHITE + name + ChatColor.GREEN + ") ";
log.log(Level.INFO, "[P](" + PP.getParty() + ")" + "<" + name + "> " + pMessage);
log.log(Level.INFO, "[P](" + PP.getParty() + ")<" + name + "> " + pMessage);
for (Player herp : Bukkit.getServer().getOnlinePlayers()) {
if (Users.getProfile(herp).inParty()) {

View File

@@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
@@ -17,10 +16,6 @@ import com.gmail.nossr50.party.Party;
public class PartyCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.partyEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
@@ -73,6 +68,44 @@ public class PartyCommand implements CommandExecutor {
}
player.sendMessage(mcLocale.getString("mcPlayerListener.YouAreInParty", new Object[] { PP.getParty() }));
player.sendMessage(mcLocale.getString("mcPlayerListener.PartyMembers") + " (" + tempList + ChatColor.GREEN + ")");
//Master Apprentice Stuff
//Show the player all their bonuses when they type /party
/*
for(Player a : Party.getInstance().getPartyMembers(player))
{
if(Party.getInstance().isPartyLeader(a.getName(), PP.getParty()) && !a.getName().equals(player.getName()))
{
PlayerProfile LP = Users.getProfile(a);
for(SkillType type : SkillType.values())
{
//Skip this one
if(type == SkillType.ALL)
continue;
if(LP.getSkillLevel(type) > PP.getSkillLevel(type))
{
//Tell them what their skill bonus is for this skill
int leaderLevel = LP.getSkillLevel(type);
int difference = leaderLevel - PP.getSkillLevel(type);
double bonusModifier = (difference*0.75D)/100D;
double trueBonus = bonusModifier * 100;
player.sendMessage("You get "+trueBonus+"% more XP from "+type.toString());
//double percent = (trueBonus/100)*100;
} else
{
//Tell them they have no bonus.. or not
}
}
} else if(Party.getInstance().isPartyLeader(a.getName(), PP.getParty()) && a.getName().equals(player.getName()))
{
//Tell them they are providing bonuses
}
}
*/
return true;
} else if (args.length == 1) {
if (args[0].equals("q") && PP.inParty()) {

View File

@@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
@@ -22,10 +21,6 @@ public class PtpCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!LoadProperties.ptpEnable) {
sender.sendMessage("This command is not enabled.");
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console useage.");
@@ -59,4 +54,4 @@ public class PtpCommand implements CommandExecutor {
return true;
}
}
}

View File

@@ -10,11 +10,13 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class AcrobaticsCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
if (!(sender instanceof Player))
{
sender.sendMessage("This command does not support console useage.");
return true;
}
@@ -46,7 +48,9 @@ public class AcrobaticsCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.AcrobaticsRollChance", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.AcrobaticsGracefulRollChance", new Object[] { gracepercentage }));
player.sendMessage(mcLocale.getString("m.AcrobaticsDodgeChance", new Object[] { dodgepercentage }));
Page.grabGuidePageForSkill(SkillType.ACROBATICS, player, args);
return true;
}
}
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class ArcheryCommand implements CommandExecutor {
@Override
@@ -57,6 +58,8 @@ public class ArcheryCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.ArcheryDazeChance", new Object[] { percentagedaze }));
player.sendMessage(mcLocale.getString("m.ArcheryRetrieveChance", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.ArcheryIgnitionLength", new Object[] { (ignition / 20) }));
Page.grabGuidePageForSkill(SkillType.AXES, player, args);
return true;
}

View File

@@ -26,11 +26,17 @@ public class AxesCommand implements CommandExecutor {
float skillvalue = (float) PP.getSkillLevel(SkillType.AXES);
if (PP.getSkillLevel(SkillType.AXES) < 750)
percentage = String.valueOf((skillvalue / 1000) * 100);
percentage = String.valueOf((skillvalue / 2000) * 100);
else
percentage = "75";
percentage = "37.5";
int bonusDmg = Users.getProfile(player).getSkillLevel(SkillType.AXES)/50;
if(bonusDmg > 4)
bonusDmg = 4;
int ticks = 2;
short durDmg = 5;
durDmg+=Users.getProfile(player).getSkillLevel(SkillType.AXES)/30;
int x = PP.getSkillLevel(SkillType.AXES);
while (x >= 50) {
x -= 50;
@@ -47,15 +53,15 @@ public class AxesCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes1_0"), mcLocale.getString("m.EffectsAxes1_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes2_0"), mcLocale.getString("m.EffectsAxes2_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes3_0"), mcLocale.getString("m.EffectsAxes3_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes4_0"), mcLocale.getString("m.EffectsAxes4_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes5_0"), mcLocale.getString("m.EffectsAxes5_1") }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.AxesCritChance", new Object[] { percentage }));
if (PP.getSkillLevel(SkillType.AXES) < 500)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockAxes1") }));
else
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes1_0"), mcLocale.getString("m.AbilBonusAxes1_1") }));
player.sendMessage(mcLocale.getString("m.AxesSkullLength", new Object[] { ticks }));
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes1_0"), mcLocale.getString("m.AbilBonusAxes1_1", new Object[] {bonusDmg}) }));
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes2_0"), mcLocale.getString("m.AbilBonusAxes2_1", new Object[] {durDmg}) }));
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes3_0"), mcLocale.getString("m.AbilBonusAxes3_1", new Object[] {2}) }));
player.sendMessage(mcLocale.getString("m.AxesSkullLength", new Object[] { ticks }));
return true;
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class ExcavationCommand implements CommandExecutor {
@Override
@@ -29,6 +30,7 @@ public class ExcavationCommand implements CommandExecutor {
ticks++;
}
player.sendMessage("");
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.SkillExcavation") }));
player.sendMessage(mcLocale.getString("m.XPGain", new Object[] { mcLocale.getString("m.XPGainExcavation") }));
@@ -39,8 +41,10 @@ public class ExcavationCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsExcavation1_0"), mcLocale.getString("m.EffectsExcavation1_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsExcavation2_0"), mcLocale.getString("m.EffectsExcavation2_1") }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.ExcavationGreenTerraLength", new Object[] { ticks }));
player.sendMessage(mcLocale.getString("m.ExcavationGigaDrillBreakerLength", new Object[] { ticks }));
Page.grabGuidePageForSkill(SkillType.EXCAVATION, player, args);
return true;
}
}

View File

@@ -11,6 +11,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Fishing;
import com.gmail.nossr50.util.Page;
public class FishingCommand implements CommandExecutor {
@Override
@@ -41,6 +42,8 @@ public class FishingCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockFishing1") }));
else
player.sendMessage(mcLocale.getString("m.ShakeInfo", new Object[] { Fishing.getFishingLootTier(PP) }));
Page.grabGuidePageForSkill(SkillType.FISHING, player, args);
return true;
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class HerbalismCommand implements CommandExecutor {
@Override
@@ -29,6 +30,10 @@ public class HerbalismCommand implements CommandExecutor {
bonus++;
if (PP.getSkillLevel(SkillType.HERBALISM) >= 600)
bonus++;
if (PP.getSkillLevel(SkillType.HERBALISM) >= 800)
bonus++;
if (PP.getSkillLevel(SkillType.HERBALISM) >= 1000)
bonus++;
int ticks = 2;
int x = PP.getSkillLevel(SkillType.HERBALISM);
@@ -51,12 +56,16 @@ public class HerbalismCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsHerbalism1_0"), mcLocale.getString("m.EffectsHerbalism1_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsHerbalism2_0"), mcLocale.getString("m.EffectsHerbalism2_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsHerbalism3_0"), mcLocale.getString("m.EffectsHerbalism3_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsHerbalism4_0"), mcLocale.getString("m.EffectsHerbalism4_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsHerbalism5_0"), mcLocale.getString("m.EffectsHerbalism5_1") }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.HerbalismGreenTerraLength", new Object[] { ticks }));
player.sendMessage(mcLocale.getString("m.HerbalismGreenThumbChance", new Object[] { gpercentage }));
player.sendMessage(mcLocale.getString("m.HerbalismGreenThumbStage", new Object[] { bonus }));
player.sendMessage(mcLocale.getString("m.HerbalismFoodPlus", new Object[] { bonus } ));
player.sendMessage(mcLocale.getString("m.HerbalismDoubleDropChance", new Object[] { percentage }));
Page.grabGuidePageForSkill(SkillType.HERBALISM, player, args);
return true;
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class MiningCommand implements CommandExecutor {
@Override
@@ -30,6 +31,46 @@ public class MiningCommand implements CommandExecutor {
x -= 50;
ticks++;
}
int rank = 0;
int damage = 0;
int radius = 0;
if(PP.getSkillLevel(SkillType.MINING) >= 125 && PP.getSkillLevel(SkillType.MINING) < 250)
rank = 1;
if(PP.getSkillLevel(SkillType.MINING) >= 250 && PP.getSkillLevel(SkillType.MINING) < 375){
rank = 2;
radius = 1;
}
if(PP.getSkillLevel(SkillType.MINING) >= 375 && PP.getSkillLevel(SkillType.MINING) < 500){
rank = 3;
radius = 1;
}
if(PP.getSkillLevel(SkillType.MINING) >= 500 && PP.getSkillLevel(SkillType.MINING) < 625){
rank = 4;
damage = 25;
radius = 2;
}
if(PP.getSkillLevel(SkillType.MINING) >= 625 && PP.getSkillLevel(SkillType.MINING) < 750){
rank = 5;
damage = 25;
radius = 2;
}
if(PP.getSkillLevel(SkillType.MINING) >= 750 && PP.getSkillLevel(SkillType.MINING) < 875){
rank = 6;
damage = 50;
radius = 3;
}
if(PP.getSkillLevel(SkillType.MINING) >= 875 && PP.getSkillLevel(SkillType.MINING) < 1000){
rank = 7;
damage = 50;
radius = 3;
}
if(PP.getSkillLevel(SkillType.MINING) >= 1000){
rank = 8;
damage = 100;
radius = 4;
}
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.SkillMining") }));
player.sendMessage(mcLocale.getString("m.XPGain", new Object[] { mcLocale.getString("m.XPGainMining") }));
@@ -39,10 +80,53 @@ public class MiningCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.Effects") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsMining1_0"), mcLocale.getString("m.EffectsMining1_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsMining2_0"), mcLocale.getString("m.EffectsMining2_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsMining3_0"), mcLocale.getString("m.EffectsMining3_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsMining4_0"), mcLocale.getString("m.EffectsMining4_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsMining5_0"), mcLocale.getString("m.EffectsMining5_1") }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.MiningDoubleDropChance", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.MiningSuperBreakerLength", new Object[] { ticks }));
if (PP.getSkillLevel(SkillType.MINING) < 125)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining1") }));
else{
switch (rank){
case 1:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining1") }));
break;
case 2:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining2") }));
break;
case 3:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining3") }));
break;
case 4:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining4") }));
break;
case 5:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining5") }));
break;
case 6:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining6") }));
break;
case 7:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining7") }));
break;
case 8:
player.sendMessage(mcLocale.getString("m.MiningBlastMining", new Object[] { rank, mcLocale.getString("m.BlastMining8") }));
break;
}
}
if (PP.getSkillLevel(SkillType.MINING) < 250)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining2") }));
else
player.sendMessage(mcLocale.getString("m.MiningBiggerBombs", new Object[] { radius }));
if (PP.getSkillLevel(SkillType.MINING) < 500)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockMining3") }));
else
player.sendMessage(mcLocale.getString("m.MiningDemolitionsExpertDamageDecrease", new Object[] { damage }));
Page.grabGuidePageForSkill(SkillType.MINING, player, args);
return true;
}
}

View File

@@ -12,6 +12,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Repair;
import com.gmail.nossr50.util.Page;
public class RepairCommand implements CommandExecutor {
@Override
@@ -42,12 +43,12 @@ public class RepairCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.RepairRepairMastery", new Object[] { repairmastery }));
player.sendMessage(mcLocale.getString("m.RepairSuperRepairChance", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.ArcaneForgingRank", new Object[] { Repair.getArcaneForgingRank(PP) }));
player.sendMessage(mcLocale.getString("m.ArcaneEnchantKeepChance", new Object[] { Repair.getEnchantChance(Repair.getArcaneForgingRank(PP)) }));
player.sendMessage(mcLocale.getString("m.ArcaneEnchantDowngradeChance", new Object[] { Repair.getDowngradeChance(Repair.getArcaneForgingRank(PP)) }));
player.sendMessage(mcLocale.getString("m.ArcaneForgingMilestones"));
player.sendMessage(mcLocale.getString("m.ArcaneForgingMilestones2"));
player.sendMessage(mcLocale.getString("m.ArcaneForgingRank", new Object[] { Repair.getArcaneForgingRank(PP.getSkillLevel(SkillType.REPAIR)) }));
player.sendMessage(mcLocale.getString("m.ArcaneEnchantKeepChance", new Object[] { Repair.getEnchantChance(Repair.getArcaneForgingRank(PP.getSkillLevel(SkillType.REPAIR))) }));
player.sendMessage(mcLocale.getString("m.ArcaneEnchantDowngradeChance", new Object[] { Repair.getDowngradeChance(Repair.getArcaneForgingRank(PP.getSkillLevel(SkillType.REPAIR))) }));
Page.grabGuidePageForSkill(SkillType.REPAIR, player, args);
return true;
}
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class SwordsCommand implements CommandExecutor {
@Override
@@ -61,8 +62,10 @@ public class SwordsCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.SwordsCounterAttChance", new Object[] { counterattackpercentage }));
player.sendMessage(mcLocale.getString("m.SwordsBleedLength", new Object[] { bleedrank }));
player.sendMessage(mcLocale.getString("m.SwordsTickNote"));
player.sendMessage(mcLocale.getString("m.SwordsBleedLength", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.SwordsBleedChance", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.SwordsSSLength", new Object[] { ticks }));
Page.grabGuidePageForSkill(SkillType.SWORDS, player, args);
return true;
}

View File

@@ -11,6 +11,7 @@ import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class TamingCommand implements CommandExecutor {
@Override
@@ -40,6 +41,7 @@ public class TamingCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsTaming5_0"), mcLocale.getString("m.EffectsTaming5_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsTaming6_0"), mcLocale.getString("m.EffectsTaming6_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsTaming7_0"), mcLocale.getString("m.EffectsTaming7_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsTaming8_0"), mcLocale.getString("m.EffectsTaming8_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTaming7_2", new Object[] { LoadProperties.bonesConsumedByCOTW }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
@@ -62,8 +64,14 @@ public class TamingCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming4") }));
else
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusTaming4_0"), mcLocale.getString("m.AbilBonusTaming4_1") }));
if (PP.getSkillLevel(SkillType.TAMING) < 50)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockTaming5") }));
else
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusTaming5_0"), mcLocale.getString("m.AbilBonusTaming5_1") }));
player.sendMessage(mcLocale.getString("m.TamingGoreChance", new Object[] { percentage }));
Page.grabGuidePageForSkill(SkillType.TAMING, player, args);
return true;
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class UnarmedCommand implements CommandExecutor {
@Override
@@ -26,9 +27,9 @@ public class UnarmedCommand implements CommandExecutor {
float skillvalue = (float) PP.getSkillLevel(SkillType.UNARMED);
if (PP.getSkillLevel(SkillType.UNARMED) < 1000)
percentage = String.valueOf((skillvalue / 4000) * 100);
percentage = String.valueOf((skillvalue / 3000) * 100);
else
percentage = "25";
percentage = "33.3";
if (PP.getSkillLevel(SkillType.UNARMED) < 1000)
arrowpercentage = String.valueOf(((skillvalue / 1000) * 100) / 2);
@@ -41,6 +42,11 @@ public class UnarmedCommand implements CommandExecutor {
x -= 50;
ticks++;
}
int bonus = 3 + (PP.getSkillLevel(SkillType.UNARMED)/50);
if(bonus > 8)
bonus = 8;
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.SkillUnarmed") }));
player.sendMessage(mcLocale.getString("m.XPGain", new Object[] { mcLocale.getString("m.XPGainUnarmed") }));
@@ -52,22 +58,17 @@ public class UnarmedCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed1_0"), mcLocale.getString("m.EffectsUnarmed1_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed2_0"), mcLocale.getString("m.EffectsUnarmed2_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed3_0"), mcLocale.getString("m.EffectsUnarmed3_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed4_0"), mcLocale.getString("m.EffectsUnarmed4_1") }));
//player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed4_0"), mcLocale.getString("m.EffectsUnarmed4_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed5_0"), mcLocale.getString("m.EffectsUnarmed5_1") }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.UnarmedArrowDeflectChance", new Object[] { arrowpercentage }));
player.sendMessage(mcLocale.getString("m.UnarmedDisarmChance", new Object[] { percentage }));
if (PP.getSkillLevel(SkillType.UNARMED) < 250) {
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockUnarmed1") }));
} else if (PP.getSkillLevel(SkillType.UNARMED) >= 250 && PP.getSkillLevel(SkillType.UNARMED) < 500) {
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusUnarmed1_0"), mcLocale.getString("m.AbilBonusUnarmed1_1") }));
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockUnarmed2") }));
} else {
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusUnarmed2_0"), mcLocale.getString("m.AbilBonusUnarmed2_1") }));
}
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusUnarmed2_0"), mcLocale.getString("m.AbilBonusUnarmed2_1", new Object[] {bonus}) }));
player.sendMessage(mcLocale.getString("m.UnarmedBerserkLength", new Object[] { ticks }));
Page.grabGuidePageForSkill(SkillType.UNARMED, player, args);
return true;
}

View File

@@ -10,6 +10,7 @@ import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
public class WoodcuttingCommand implements CommandExecutor {
@Override
@@ -51,6 +52,8 @@ public class WoodcuttingCommand implements CommandExecutor {
player.sendMessage(mcLocale.getString("m.WoodCuttingDoubleDropChance", new Object[] { percentage }));
player.sendMessage(mcLocale.getString("m.WoodCuttingTreeFellerLength", new Object[] { ticks }));
Page.grabGuidePageForSkill(SkillType.WOODCUTTING, player, args);
return true;
}
}

View File

@@ -31,7 +31,7 @@ public class XplockCommand implements CommandExecutor {
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
if (args.length >= 1 && Skills.isSkill(args[0]) && mcPermissions.permission(player, "mcmmo.skills." + Skills.getSkillType(args[0]).toString().toLowerCase())) {
if (args.length >= 1 && Skills.isSkill(args[0]) && mcPermissions.getInstance().permission(player, "mcmmo.skills." + Skills.getSkillType(args[0]).toString().toLowerCase())) {
if (PP.getXpBarLocked()) {
PP.setSkillLock(Skills.getSkillType(args[0]));
player.sendMessage(mcLocale.getString("Commands.xplock.locked", new Object[] { m.getCapitalized(PP.getSkillLock().toString()) }));
@@ -52,7 +52,7 @@ public class XplockCommand implements CommandExecutor {
}
} else if (args.length >= 1 && !Skills.isSkill(args[0])) {
player.sendMessage("Commands.xplock.invalid");
} else if (args.length >= 2 && Skills.isSkill(args[0]) && !mcPermissions.permission(player, "mcmmo.skills." + Skills.getSkillType(args[0]).toString().toLowerCase())) {
} else if (args.length >= 2 && Skills.isSkill(args[0]) && !mcPermissions.getInstance().permission(player, "mcmmo.skills." + Skills.getSkillType(args[0]).toString().toLowerCase())) {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}

View File

@@ -19,57 +19,50 @@ package com.gmail.nossr50.config;
import com.gmail.nossr50.mcMMO;
import java.io.File;
import java.io.IOException;
import org.bukkit.configuration.file.FileConfiguration;
import com.gmail.nossr50.datatypes.HUDType;
public class LoadProperties {
public static Boolean enableOnlyActivateWhenSneaking,
enableAbilityMessages, enableAbilities, showDisplayName, showFaces,
watch, xplockEnable, xpbar, xpicon, partybar, string, bucket, web,
xprateEnable, slimeballs, spoutEnabled, donateMessage,
chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable,
mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable,
statsEnable, addxpEnable, ptpEnable, mmoeditEnable,
clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable,
mcrefreshEnable, aEnable, pEnable, enableMotd, enableMySpawn,
enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, mushrooms,
toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe,
excavationRequiresShovel, woodcuttingrequiresaxe, eggs, apples,
cake, music, diamond, glowstone, slowsand, sulphur, netherrack,
bones, coal, clay, anvilmessages, mayDowngradeEnchants,
mayLoseEnchants, fishingDrops, leatherArmor, ironArmor, goldArmor,
diamondArmor, woodenTools, stoneTools, ironTools, goldTools,
diamondTools, enderPearl, blazeRod, records, glowstoneDust,
fishingDiamonds, aDisplayNames, pDisplayNames;
xplockEnable, xpbar, xpicon, partybar, xprateEnable, spoutEnabled,
donateMessage, chimaeraWingEnable, xpGainsMobSpawners,
mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable,
inspectEnable, mcstatsEnable, addxpEnable, ptpEnable, mmoeditEnable, mcremoveEnable,
mcgodEnable, mcabilityEnable, mctopEnable,
addlevelsEnable, mcrefreshEnable, aEnable, pEnable, enableMotd,
enableCobbleToMossy, useMySQL, toolsLoseDurabilityFromAbilities,
pvpxp, miningrequirespickaxe, excavationRequiresShovel,
woodcuttingrequiresaxe, anvilmessages, mayDowngradeEnchants,
mayLoseEnchants, fishingDrops, aDisplayNames, pDisplayNames, enableSmoothToMossy,
enableDirtToGrass, statsTracking, eventCallback, herbalismHungerBonus,
repairArmor, repairTools;
public static String MySQLtablePrefix, MySQLuserName,
MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone,
nIron, nGold, nDiamond, locale, nString, nLeather;
public static int mfishing, mwatch, xpbar_x, xpbar_y, xpicon_x, xpicon_y,
mstring, mbucket, mweb, chimaeraId, msandstone, mcocoa,
water_thunder, cure_self, cure_other, mslimeballs, mbones,
msulphur, mslowsand, mmushroom2, mglowstone2, mmelon, mmusic,
mdiamond2, mbase, mapple, meggs, mcake, mpine, mbirch, mspruce,
public static int treeFellerThreshold, mjungle, mtameWolf, mtameOcelot,
mfishing, xpbar_x, xpbar_y, xpicon_x, xpicon_y,
chimaeraId, msandstone, mbase, moak, mbirch, mspruce, mmelon,
mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold,
mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack,
mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier,
superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown,
superBreakerCooldown, blastMiningCooldown, greenTerraCooldown, gigaDrillBreakerCooldown,
treeFellerCooldown, berserkCooldown, serratedStrikeCooldown,
skullSplitterCooldown, abilityDurabilityLoss,
feathersConsumedByChimaeraWing, bonesConsumedByCOTW,
repairdiamondlevel, rWood, rStone, rIron, rGold, rDiamond, rString,
rLeather, downgradeRank1, downgradeRank2, downgradeRank3,
downgradeRank4, keepEnchantsRank1, keepEnchantsRank2,
keepEnchantsRank3, keepEnchantsRank4, fishingDropChanceTier1,
fishingDropChanceTier2, fishingDropChanceTier3,
fishingDropChanceTier4, fishingDropChanceTier5, mnetherwart,
mvines, mlilypad, mnetherbrick, mendstone, mmossstone, mstonebrick,
keepEnchantsRank3, keepEnchantsRank4, mnetherwart,
mvines, mlilypad, mendstone, mmossstone,
levelCapAcrobatics, levelCapArchery, levelCapAxes, levelCapExcavation,
levelCapFishing, levelCapHerbalism, levelCapMining, levelCapRepair,
levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting;
levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting,
anvilID, saveInterval, fishingTier1, fishingTier2, fishingTier3, fishingTier4, fishingTier5,
repairStoneLevel, repairIronLevel, repairGoldLevel, arcaneRank1, arcaneRank2, arcaneRank3, arcaneRank4,
detonatorID;
public static double xpbackground_r, xpbackground_g, xpbackground_b,
xpborder_r, xpborder_g, xpborder_b, fishing_r, fishing_g,
@@ -81,9 +74,10 @@ public class LoadProperties {
unarmed_r, unarmed_g, unarmed_b, woodcutting_r, woodcutting_g,
woodcutting_b, pvpxprewardmodifier, tamingxpmodifier,
miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier,
sorceryxpmodifier, unarmedxpmodifier, herbalismxpmodifier,
fishingxpmodifier, unarmedxpmodifier, herbalismxpmodifier,
excavationxpmodifier, archeryxpmodifier, swordsxpmodifier,
axesxpmodifier, acrobaticsxpmodifier;
axesxpmodifier, acrobaticsxpmodifier, animalXP, creeperXP, skeletonXP, spiderXP, ghastXP, slimeXP,
zombieXP, pigzombieXP, endermanXP, cavespiderXP, silverfishXP, blazeXP, magmacubeXP, enderdragonXP;
public static HUDType defaulthud;
protected static File configFile;
@@ -143,27 +137,24 @@ public class LoadProperties {
}
private void loadKeys() {
plugin.getLogger().info("Loading Config File...");
plugin.getLogger().info("Loading mcMMO config.yml File...");
// Setup default HUD
String temp = readString("Spout.HUD.Default", "STANDARD");
for (HUDType x : HUDType.values()) {
if (x.toString().equalsIgnoreCase(temp)) {
if (x.toString().equalsIgnoreCase(temp))
defaulthud = x;
}
}
enableAbilityMessages = readBoolean("Abilities.Messages", true);
enableAbilities = readBoolean("Abilities.Enabled", true);
donateMessage = readBoolean("Commands.mcmmo.Donate_Message", true);
xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled", false);
xpGainsMobSpawners = readBoolean("Experience.Gains.Mobspawners.Enabled", false);
bonesConsumedByCOTW = readInteger("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10);
xpbar = readBoolean("Spout.XP.Bar.Enabled", true);
// web_url = readString("Spout.Images.URL_DIR",
// "http://mcmmo.rycochet.net/mcmmo/");
xpicon = readBoolean("Spout.XP.Icon.Enabled", true);
xpbar_x = readInteger("Spout.XP.Bar.X_POS", 95);
xpbar_y = readInteger("Spout.XP.Bar.Y_POS", 6);
@@ -218,23 +209,7 @@ public class LoadProperties {
xpbackground_g = readDouble("Spout.HUD.Retro.Colors.Background.GREEN", 0.75);
xpbackground_b = readDouble("Spout.HUD.Retro.Colors.Background.BLUE", 0.75);
msulphur = readInteger("Experience.Excavation.Sulphur", 30);
mbones = readInteger("Experience.Excavation.Bones", 30);
mbase = readInteger("Experience.Excavation.Base", 40);
mmushroom2 = readInteger("Experience.Excavation.Mushroom", 80);
mslowsand = readInteger("Experience.Excavation.Slowsand", 80);
mglowstone2 = readInteger("Experience.Excavation.Glowstone", 80);
mmusic = readInteger("Experience.Excavation.Music", 3000);
mdiamond2 = readInteger("Experience.Excavation.Diamond", 1000);
mapple = readInteger("Experience.Excavation.Apple", 100);
meggs = readInteger("Experience.Excavation.Eggs", 100);
mcake = readInteger("Experience.Excavation.Cake", 3000);
mcocoa = readInteger("Experience.Excavation.Cocoa_Beans", 100);
mslimeballs = readInteger("Experience.Excavation.Slimeballs", 100);
mstring = readInteger("Experience.Excavation.String", 200);
mbucket = readInteger("Experience.Excavation.Bucket", 100);
mweb = readInteger("Experience.Excavation.Web", 150);
mwatch = readInteger("Experience.Excavation.Watch", 200);
msugar = readInteger("Experience.Herbalism.Sugar_Cane", 30);
mwheat = readInteger("Experience.Herbalism.Wheat", 50);
@@ -246,26 +221,29 @@ public class LoadProperties {
mnetherwart = readInteger("Experience.Herbalism.Nether_Wart", 50);
mlilypad = readInteger("Experience.Herbalism.Lily_Pads", 100);
mvines = readInteger("Experience.Herbalism.Vines", 10);
herbalismHungerBonus = readBoolean("Skills.Herbalism.Hunger_Bonus", true);
mpine = readInteger("Experience.Woodcutting.Pine", 70);
mbirch = readInteger("Experience.Woodcutting.Birch", 80);
mspruce = readInteger("Experience.Woodcutting.Spruce", 90);
moak = readInteger("Experience.Woodcutting.Oak", 70);
mbirch = readInteger("Experience.Woodcutting.Birch", 90);
mspruce = readInteger("Experience.Woodcutting.Spruce", 80);
mjungle = readInteger("Experience.Woodcutting.Jungle", 100);
mgold = readInteger("Experience.Mining.Gold", 250);
mdiamond = readInteger("Experience.Mining.Diamond", 750);
miron = readInteger("Experience.Mining.Iron", 250);
mredstone = readInteger("Experience.Mining.Redstone", 150);
mlapis = readInteger("Experience.Mining.lapis", 400);
mlapis = readInteger("Experience.Mining.Lapis", 400);
mobsidian = readInteger("Experience.Mining.Obsidian", 150);
mnetherrack = readInteger("Experience.Mining.Netherrack", 30);
mglowstone = readInteger("Experience.Mining.Glowstone", 30);
mcoal = readInteger("Experience.Mining.Coal", 100);
mstone = readInteger("Experience.Mining.Stone", 30);
msandstone = readInteger("Experience.Mining.Sandstone", 30);
mnetherbrick = readInteger("Experience.Mining.Nether_Brick", 30);
mendstone = readInteger("Experience.Mining.End_Stone", 150);
mmossstone = readInteger("Experience.Mining.Moss_Stone", 30);
mstonebrick = readInteger("Experience.Mining.Stone_Brick", 30);
mtameWolf = readInteger("Experience.Taming.Animal_Taming.Wolf", 250);
mtameOcelot = readInteger("Experience.Taming.Animal_Taming.Wolf", 500);
mfishing = readInteger("Experience.Fishing.Base", 800);
@@ -274,10 +252,12 @@ public class LoadProperties {
greenTerraCooldown = readInteger("Abilities.Cooldowns.Green_Terra", 240);
superBreakerCooldown = readInteger("Abilities.Cooldowns.Super_Breaker", 240);
gigaDrillBreakerCooldown = readInteger("Abilities.Cooldowns.Giga_Drill_Breaker", 240);
treeFellerThreshold = readInteger("Abilities.Limits.Tree_Feller_Threshold", 500);
treeFellerCooldown = readInteger("Abilities.Cooldowns.Tree_Feller", 240);
berserkCooldown = readInteger("Abilities.Cooldowns.Berserk", 240);
serratedStrikeCooldown = readInteger("Abilities.Cooldowns.Serrated_Strikes", 240);
skullSplitterCooldown = readInteger("Abilities.Cooldowns.Skull_Splitter", 240);
blastMiningCooldown = readInteger("Abilities.Cooldowns.Blast_Mining", 60);
MySQLserverName = readString("MySQL.Server.Address", "localhost");
if (readString("MySQL.Database.User.Password", null) != null)
@@ -293,10 +273,13 @@ public class LoadProperties {
locale = readString("General.Locale", "en_us");
enableMotd = readBoolean("General.MOTD.Enabled", true);
enableMySpawn = readBoolean("General.MySpawn.Enabled", true);
enableRegen = readBoolean("General.HP_Regeneration.Enabled", true);
saveInterval = readInteger("General.Save_Interval", 10);
statsTracking = readBoolean("General.Stats_Tracking", true);
eventCallback = readBoolean("General.Event_Callback", true);
enableCobbleToMossy = readBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true);
enableSmoothToMossy = readBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true);
enableDirtToGrass = readBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true);
xpGainMultiplier = readInteger("Experience.Gains.Multiplier.Global", 1);
toolsLoseDurabilityFromAbilities = readBoolean("Abilities.Tools.Durability_Loss_Enabled", true);
@@ -306,14 +289,19 @@ public class LoadProperties {
chimaeraId = readInteger("Items.Chimaera_Wing.Item_ID", 288);
chimaeraWingEnable = readBoolean("Items.Chimaera_Wing.Enabled", true);
pvpxp = readBoolean("XP.PVP.Rewards", true);
pvpxp = readBoolean("Experience.PVP.Rewards", true);
pvpxprewardmodifier = readDouble("Experience.Gains.Multiplier.PVP", 1.0);
miningrequirespickaxe = readBoolean("Skills.Mining.Requires_Pickaxe", true);
excavationRequiresShovel = readBoolean("Skills.Excavation.Requires_Shovel", true);
woodcuttingrequiresaxe = readBoolean("Skills.Woodcutting.Requires_Axe", true);
repairArmor = readBoolean("Skills.Repair.Can_Repair_Armor", true);
repairTools = readBoolean("Skills.Repair.Can_Repair_Tools", true);
repairdiamondlevel = readInteger("Skills.Repair.Diamond.Level_Required", 50);
repairIronLevel = readInteger("Skills.Repair.Iron.Level_Required", 0);
repairGoldLevel = readInteger("Skills.Repair.Gold.Level_Required", 0);
repairStoneLevel = readInteger("Skills.Repair.Stone.Level_Required", 0);
sorceryxpmodifier = readDouble("Experience.Formula.Multiplier.Sorcery", 1.0);
tamingxpmodifier = readDouble("Experience.Formula.Multiplier.Taming", 1.0);
miningxpmodifier = readDouble("Experience.Formula.Multiplier.Mining", 1.0);
repairxpmodifier = readDouble("Experience.Formula.Multiplier.Repair", 1.0);
@@ -325,8 +313,10 @@ public class LoadProperties {
swordsxpmodifier = readDouble("Experience.Formula.Multiplier.Swords", 1.0);
axesxpmodifier = readDouble("Experience.Formula.Multiplier.Axes", 1.0);
acrobaticsxpmodifier = readDouble("Experience.Formula.Multiplier.Acrobatics", 1.0);
fishingxpmodifier = readDouble("Experience.Forumla.Multiplier.Fishing", 1.0);
anvilmessages = readBoolean("Skills.Repair.Anvil_Messages", true);
anvilID = readInteger("Skills.Repair.Anvil_ID", 42);
rGold = readInteger("Skills.Repair.Gold.ID", 266);
nGold = readString("Skills.Repair.Gold.Name", "Gold Bars");
@@ -341,7 +331,7 @@ public class LoadProperties {
rString = readInteger("Skills.Repair.String.ID", 287);
nString = readString("Skills.Repair.String.Name", "String");
rLeather = readInteger("Skills.Repair.Leather.ID", 334);
nLeather = readString("Skills.Repair.String.Name", "Leather");
nLeather = readString("Skills.Repair.Leather.Name", "Leather");
levelCapAcrobatics = readInteger("Skills.Acrobatics.Level_Cap", 0);
levelCapArchery = readInteger("Skills.Archery.Level_Cap", 0);
@@ -361,73 +351,62 @@ public class LoadProperties {
downgradeRank2 = readInteger("Arcane_Forging.Downgrades.Chance.Rank_2", 50);
downgradeRank3 = readInteger("Arcane_Forging.Downgrades.Chance.Rank_3", 25);
downgradeRank4 = readInteger("Arcane_Forging.Downgrades.Chance.Rank_4", 15);
mayLoseEnchants = readBoolean("Arcane_Forging.May_Lose_Enchants.Enabled", true);
mayLoseEnchants = readBoolean("Arcane_Forging.May_Lose_Enchants", true);
keepEnchantsRank1 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_1", 10);
keepEnchantsRank2 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_2", 20);
keepEnchantsRank3 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_3", 30);
keepEnchantsRank4 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_4", 40);
arcaneRank1 = readInteger("Arcane_Forging.Rank_Levels.Rank_1", 100);
arcaneRank2 = readInteger("Arcane_Forging.Rank_Levels.Rank_2", 250);
arcaneRank3 = readInteger("Arcane_Forging.Rank_Levels.Rank_3", 500);
arcaneRank4 = readInteger("Arcane_Forging.Rank_Levels.Rank_4", 750);
cocoabeans = readBoolean("Excavation.Drops.Cocoa_Beans", true);
mushrooms = readBoolean("Excavation.Drops.Mushrooms", true);
glowstone = readBoolean("Excavation.Drops.Glowstone", true);
eggs = readBoolean("Excavation.Drops.Eggs", true);
apples = readBoolean("Excavation.Drops.Apples", true);
cake = readBoolean("Excavation.Drops.Cake", true);
music = readBoolean("Excavation.Drops.Music", true);
diamond = readBoolean("Excavation.Drops.Diamond", true);
slowsand = readBoolean("Excavation.Drops.Slowsand", true);
sulphur = readBoolean("Excavation.Drops.Sulphur", true);
netherrack = readBoolean("Excavation.Drops.Netherrack", true);
bones = readBoolean("Excavation.Drops.Bones", true);
slimeballs = readBoolean("Excavation.Drops.Slimeballs", true);
watch = readBoolean("Excavation.Drops.Watch", true);
string = readBoolean("Excavation.Drops.String", true);
bucket = readBoolean("Excavation.Drops.Bucket", true);
web = readBoolean("Excavation.Drops.Web", true);
fishingDrops = readBoolean("Fishing.Drops.Item_Drops_Enabled", true);
fishingDropChanceTier1 = readInteger("Fishing.Drops.Drop_Chance.Tier_1", 20);
fishingDropChanceTier2 = readInteger("Fishing.Drops.Drop_Chance.Tier_2", 25);
fishingDropChanceTier3 = readInteger("Fishing.Drops.Drop_Chance.Tier_3", 30);
fishingDropChanceTier4 = readInteger("Fishing.Drops.Drop_Chance.Tier_4", 35);
fishingDropChanceTier5 = readInteger("Fishing.Drops.Drop_Chance.Tier_5", 40);
leatherArmor = readBoolean("Fishing.Drops.Leather_Armor", true);
ironArmor = readBoolean("Fishing.Drops.Iron_Armor", true);
goldArmor = readBoolean("Fishing.Drops.Gold_Armor", true);
diamondArmor = readBoolean("Fishing.Drops.Diamond_Armor", true);
woodenTools = readBoolean("Fishing.Drops.Wooden_Tools", true);
stoneTools = readBoolean("Fishing.Drops.Stone_Tools", true);
ironTools = readBoolean("Fishing.Drops.Iron_Tools", true);
goldTools = readBoolean("Fishing.Drops.Gold_Tools", true);
diamondTools = readBoolean("Fishing.Drops.Diamond_Tools", true);
enderPearl = readBoolean("Fishing.Drops.Ender_Pearl", true);
blazeRod = readBoolean("Fishing.Drops.Blaze_Rod", true);
records = readBoolean("Fishing.Drops.Records", true);
glowstoneDust = readBoolean("Fishing.Drops.Glowstone_Dust", true);
fishingDiamonds = readBoolean("Fishing.Drops.Diamonds", true);
fishingDrops = readBoolean("Fishing.Drops_Enabled", true);
fishingTier1 = readInteger("Fishing.Tier_Levels.Tier1", 0);
fishingTier2 = readInteger("Fishing.Tier_Levels.Tier2", 200);
fishingTier3 = readInteger("Fishing.Tier_Levels.Tier3", 400);
fishingTier4 = readInteger("Fishing.Tier_Levels.Tier4", 600);
fishingTier5 = readInteger("Fishing.Tier_Levels.Tier5", 800);
xplockEnable = readBoolean("Commands.xplock.Enabled", true);
xprateEnable = readBoolean("Commands.xprate.Enabled", true);
mctopEnable = readBoolean("Commands.mctop.Enabled", true);
addxpEnable = readBoolean("Commands.addxp.Enabled", true);
addlevelsEnable = readBoolean("Commands.addlevels.Enabled", true);
mcabilityEnable = readBoolean("Commands.mcability.Enabled", true);
mcrefreshEnable = readBoolean("Commands.mcrefresh.Enabled", true);
mcmmoEnable = readBoolean("Commands.mcmmo.Enabled", true);
mccEnable = readBoolean("Commands.mcc.Enabled", true);
mcgodEnable = readBoolean("Commands.mcgod.Enabled", true);
statsEnable = readBoolean("Commands.stats.Enabled", true);
mcstatsEnable = readBoolean("Commands.mcstats.Enabled", true);
mmoeditEnable = readBoolean("Commands.mmoedit.Enabled", true);
mcremoveEnable = readBoolean("Commands.mcremove.Enable", true);
ptpEnable = readBoolean("Commands.ptp.Enabled", true);
partyEnable = readBoolean("Commands.party.Enabled", true);
myspawnEnable = readBoolean("Commands.myspawn.Enabled", true);
whoisEnable = readBoolean("Commands.whois.Enabled", true);
inspectEnable = readBoolean("Commands.inspect.Enabled", true);
inviteEnable = readBoolean("Commands.invite.Enabled", true);
acceptEnable = readBoolean("Commands.accept.Enabled", true);
clearmyspawnEnable = readBoolean("Commands.clearmyspawn.Enabled", true);
aEnable = readBoolean("Commands.a.Enabled", true);
pEnable = readBoolean("Commands.p.Enabled", true);
aDisplayNames = readBoolean("Commands.a.Display_Names", true);
pDisplayNames = readBoolean("Commands.p.Display_Names", true);
animalXP = readDouble("Experience.Combat.Multiplier.Animals", 1.0);
creeperXP = readDouble("Experience.Combat.Multiplier.Creeper", 4.0);
skeletonXP = readDouble("Experience.Combat.Multiplier.Skeleton", 2.0);
spiderXP = readDouble("Experience.Combat.Multiplier.Spider", 3.0);
ghastXP = readDouble("Experience.Combat.Multiplier.Ghast", 3.0);
slimeXP = readDouble("Experience.Combat.Multiplier.Slime", 2.0);
zombieXP = readDouble("Experience.Combat.Multiplier.Zombie", 2.0);
pigzombieXP = readDouble("Experience.Combat.Multiplier.Pig_Zombie", 3.0);
endermanXP = readDouble("Experience.Combat.Multiplier.Enderman", 2.0);
cavespiderXP = readDouble("Experience.Combat.Multiplier.Cave_Spider", 3.0);
silverfishXP = readDouble("Experience.Combat.Multiplier.Silverfish", 3.0);
blazeXP = readDouble("Experience.Combat.Multiplier.Blaze", 3.0);
magmacubeXP = readDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0);
enderdragonXP = readDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0);
detonatorID = readInteger("Skills.Mining.Detonator_ID", 259);
}
}

View File

@@ -0,0 +1,219 @@
package com.gmail.nossr50.config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
import com.gmail.nossr50.datatypes.treasure.Treasure;
public class LoadTreasures {
public static List<ExcavationTreasure> excavationFromDirt = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromGrass = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromSand = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromGravel = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromClay = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromMycel = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromSoulSand = new ArrayList<ExcavationTreasure>();
public static List<FishingTreasure> fishingRewardsTier1 = new ArrayList<FishingTreasure>();
public static List<FishingTreasure> fishingRewardsTier2 = new ArrayList<FishingTreasure>();
public static List<FishingTreasure> fishingRewardsTier3 = new ArrayList<FishingTreasure>();
public static List<FishingTreasure> fishingRewardsTier4 = new ArrayList<FishingTreasure>();
public static List<FishingTreasure> fishingRewardsTier5 = new ArrayList<FishingTreasure>();
protected static File configFile;
protected static File dataFolder;
protected final mcMMO plugin;
protected static FileConfiguration config;
public LoadTreasures(mcMMO plugin) {
this.plugin = plugin;
dataFolder = plugin.getDataFolder();
configFile = new File(dataFolder, File.separator + "treasures.yml");
config = plugin.getTreasuresConfig();
}
public void load() {
// If not exist, copy from the jar
if (!configFile.exists()) {
dataFolder.mkdir();
plugin.saveTreasuresConfig();
}
addDefaults();
loadKeys();
}
private static void saveConfig() {
try {
config.save(configFile);
} catch (IOException e) {
e.printStackTrace();
}
}
private void addDefaults() {
// Load from included config.yml
config.options().copyDefaults(true);
saveConfig();
}
private Boolean readBoolean(String root, Boolean def) {
Boolean result = config.getBoolean(root, def);
return result;
}
private void loadKeys()
{
plugin.getLogger().info("Loading mcMMO treasures.yml File...");
// Load treasures
Map<String, Treasure> treasures = new HashMap<String, Treasure>();
ConfigurationSection treasureSection = config.getConfigurationSection("Treasures");
Set<String> treasureConfigSet = treasureSection.getKeys(false);
Iterator<String> iterator = treasureConfigSet.iterator();
while(iterator.hasNext())
{
String treasureName = iterator.next();
// Validate all the things!
List<String> reason = new ArrayList<String>();
if(!config.contains("Treasures." + treasureName + ".ID")) reason.add("Missing ID");
if(!config.contains("Treasures." + treasureName + ".Amount")) reason.add("Missing Amount");
if(!config.contains("Treasures." + treasureName + ".Data")) reason.add("Missing Data");
int id = config.getInt("Treasures." + treasureName + ".ID");
int amount = config.getInt("Treasures." + treasureName + ".Amount");
int data = config.getInt("Treasures." + treasureName + ".Data");
if(Material.getMaterial(id) == null) reason.add("Invlid id: " + id);
if(amount < 1) reason.add("Invalid amount: " + amount);
if(data > 127 || data < -128) reason.add("Invalid data: " + data);
if(!config.contains("Treasures." + treasureName + ".XP")) reason.add("Missing XP");
if(!config.contains("Treasures." + treasureName + ".Drop_Chance")) reason.add("Missing Drop_Chance");
if(!config.contains("Treasures." + treasureName + ".Drop_Level")) reason.add("Missing Drop_Level");
int xp = config.getInt("Treasures." + treasureName + ".XP");
Double dropChance = config.getDouble("Treasures." + treasureName + ".Drop_Chance");
int dropLevel = config.getInt("Treasures." + treasureName + ".Drop_Level");
if(xp < 0) reason.add("Invalid xp: " + xp);
if(dropChance < 0) reason.add("Invalid Drop_Chance: " + dropChance);
if(dropLevel < 0) reason.add("Invalid Drop_Level: " + dropLevel);
ItemStack item = new ItemStack(id, amount, (byte) 0, (byte) data);
if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) {
if(config.getConfigurationSection("Treasures." + treasureName + ".Drops_From").getKeys(false).size() != 1)
reason.add("Fishing drops cannot also be excavation drops");
if(!config.contains("Treasures." + treasureName + ".Max_Level")) reason.add("Missing Max_Level");
int maxLevel = config.getInt("Treasures." + treasureName + ".Max_Level");
if(maxLevel < 0) reason.add("Invalid Max_Level: " + maxLevel);
if(noErrorsInTreasure(reason)) {
FishingTreasure fTreasure = new FishingTreasure(item, xp, dropChance, dropLevel, maxLevel);
treasures.put(treasureName, fTreasure);
}
} else {
ExcavationTreasure eTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel);
if(readBoolean("Treasures." + treasureName + ".Drops_From.Dirt", false))
eTreasure.setDropsFromDirt();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Grass", false))
eTreasure.setDropsFromGrass();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Sand", false))
eTreasure.setDropsFromSand();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Gravel", false))
eTreasure.setDropsFromGravel();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Clay", false))
eTreasure.setDropsFromClay();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Mycelium", false))
eTreasure.setDropsFromMycel();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Soul_Sand", false))
eTreasure.setDropsFromSoulSand();
if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) {
reason.add("Excavation drops cannot also be fishing drops");
}
if(noErrorsInTreasure(reason)) {
treasures.put(treasureName, eTreasure);
}
}
}
List<String> excavationTreasures = config.getStringList("Excavation.Treasure");
List<String> fishingTreasures = config.getStringList("Fishing.Treasure");
Iterator<String> treasureIterator = treasures.keySet().iterator();
while(treasureIterator.hasNext()) {
String treasureKey = treasureIterator.next();
Treasure treasure = treasures.get(treasureKey);
if(treasure instanceof FishingTreasure) {
if(!fishingTreasures.contains(treasureKey)) continue;
FishingTreasure fTreasure = (FishingTreasure) treasure;
int dropLevel = fTreasure.getDropLevel();
int maxLevel = fTreasure.getMaxLevel();
if(dropLevel <= LoadProperties.fishingTier1 && maxLevel >= LoadProperties.fishingTier1)
fishingRewardsTier1.add(fTreasure);
if(dropLevel <= LoadProperties.fishingTier2 && maxLevel >= LoadProperties.fishingTier2)
fishingRewardsTier2.add(fTreasure);
if(dropLevel <= LoadProperties.fishingTier3 && maxLevel >= LoadProperties.fishingTier3)
fishingRewardsTier3.add(fTreasure);
if(dropLevel <= LoadProperties.fishingTier4 && maxLevel >= LoadProperties.fishingTier4)
fishingRewardsTier4.add(fTreasure);
if(dropLevel <= LoadProperties.fishingTier5 && maxLevel >= LoadProperties.fishingTier5)
fishingRewardsTier5.add(fTreasure);
} else if(treasure instanceof ExcavationTreasure) {
if(!excavationTreasures.contains(treasureKey)) continue;
ExcavationTreasure eTreasure = (ExcavationTreasure) treasure;
if(eTreasure.getDropsFromDirt())
excavationFromDirt.add(eTreasure);
if(eTreasure.getDropsFromGrass())
excavationFromGrass.add(eTreasure);
if(eTreasure.getDropsFromSand())
excavationFromSand.add(eTreasure);
if(eTreasure.getDropsFromGravel())
excavationFromGravel.add(eTreasure);
if(eTreasure.getDropsFromClay())
excavationFromClay.add(eTreasure);
if(eTreasure.getDropsFromMycel())
excavationFromMycel.add(eTreasure);
if(eTreasure.getDropsFromSoulSand())
excavationFromSoulSand.add(eTreasure);
}
}
}
private boolean noErrorsInTreasure(List<String> issues) {
if(issues.isEmpty()) return true;
for(String issue : issues) {
plugin.getLogger().warning(issue);
}
return false;
}
}

View File

@@ -18,9 +18,12 @@ package com.gmail.nossr50.config;
import java.util.*;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
@@ -30,11 +33,11 @@ public class Misc
protected static final Logger log = Logger.getLogger("Minecraft");
public ArrayList<Entity> mobSpawnerList = new ArrayList<Entity>();
public ArrayList<Integer> mobSpawnerList = new ArrayList<Integer>();
public HashSet<Block> blockWatchList = new HashSet<Block>();
public ArrayList<Block> treeFeller = new ArrayList<Block>();
public HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
public ArrayList<LivingEntity> bleedTracker = new ArrayList<LivingEntity>();
public HashMap<Location, Player> tntTracker = new HashMap<Location, Player>();
mcMMO plugin = null;
//BLEED QUE STUFF

View File

@@ -0,0 +1,195 @@
package com.gmail.nossr50.datatypes;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.locale.mcLocale;
public enum AbilityType
{
BERSERK(LoadProperties.berserkCooldown, mcLocale.getString("Skills.BerserkOn"), mcLocale.getString("Skills.BerserkOff"), "Skills.BerserkPlayer", mcLocale.getString("Skills.YourBerserk"), "Skills.BerserkPlayerOff"),
SUPER_BREAKER(LoadProperties.superBreakerCooldown, mcLocale.getString("Skills.SuperBreakerOn"), mcLocale.getString("Skills.SuperBreakerOff"), "Skills.SuperBreakerPlayer", mcLocale.getString("Skills.YourSuperBreaker"), "Skills.SuperBreakerPlayerOff"),
GIGA_DRILL_BREAKER(LoadProperties.gigaDrillBreakerCooldown, mcLocale.getString("Skills.GigaDrillBreakerOn"), mcLocale.getString("Skills.GigaDrillBreakerOff"), "Skills.GigaDrillBreakerPlayer", mcLocale.getString("Skills.YourGigaDrillBreaker"), "Skills.GigaDrillBreakerPlayerOff"),
GREEN_TERRA(LoadProperties.greenTerraCooldown, mcLocale.getString("Skills.GreenTerraOn"), mcLocale.getString("Skills.GreenTerraOff"), "Skills.GreenTerraPlayer", mcLocale.getString("Skills.YourGreenTerra"), mcLocale.getString("Skills.GreenTerraPlayerOff")),
SKULL_SPLIITER(LoadProperties.skullSplitterCooldown, mcLocale.getString("Skills.SkullSplitterOn"), mcLocale.getString("Skills.SkullSplitterOff"), "Skills.SkullSplitterPlayer", mcLocale.getString("Skills.YourSkullSplitter"), "Skills.SkullSplitterPlayerOff"),
TREE_FELLER(LoadProperties.treeFellerCooldown, mcLocale.getString("Skills.TreeFellerOn"), mcLocale.getString("Skills.TreeFellerOff"), "Skills.TreeFellerPlayer", mcLocale.getString("Skills.YourTreeFeller"), "Skills.TreeFellerPlayerOff"),
SERRATED_STRIKES(LoadProperties.skullSplitterCooldown, mcLocale.getString("Skills.SerratedStrikesOn"), mcLocale.getString("Skills.SerratedStrikesOff"), "Skills.SerratedStrikesPlayer", mcLocale.getString("Skills.YourSerratedStrikes"), "Skills.SerratedStrikesPlayerOff"),
BLAST_MINING(LoadProperties.blastMiningCooldown, "NOT NEEDED FOR BLAST MINING", "NOT NEEDED FOR BLAST MINING", "Skills.BlastMiningPlayer", mcLocale.getString("Skills.YourBlastMining"), "NOT NEEDED FOR BLAST MINING");
private int cooldown;
private String abilityOn;
private String abilityOff;
private String abilityPlayer;
private String abilityRefresh;
private String abilityPlayerOff;
private AbilityType(int cooldown, String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff)
{
this.cooldown = cooldown;
this.abilityOn = abilityOn;
this.abilityOff = abilityOff;
this.abilityPlayer = abilityPlayer;
this.abilityRefresh = abilityRefresh;
this.abilityPlayerOff = abilityPlayerOff;
}
public int getCooldown()
{
return this.cooldown;
}
public String getAbilityOn()
{
return this.abilityOn;
}
public String getAbilityOff()
{
return this.abilityOff;
}
public String getAbilityPlayer(Player player)
{
return mcLocale.getString(this.abilityPlayer, new Object[] {player.getName()});
}
public String getAbilityPlayerOff(Player player)
{
return mcLocale.getString(this.abilityPlayerOff, new Object[] {player.getName()});
}
public String getAbilityRefresh()
{
return this.abilityRefresh;
}
public boolean getMode(PlayerProfile PP)
{
switch(this)
{
case BERSERK:
return PP.getBerserkMode();
case SUPER_BREAKER:
return PP.getSuperBreakerMode();
case GIGA_DRILL_BREAKER:
return PP.getGigaDrillBreakerMode();
case GREEN_TERRA:
return PP.getGreenTerraMode();
case SKULL_SPLIITER:
return PP.getSkullSplitterMode();
case TREE_FELLER:
return PP.getTreeFellerMode();
case SERRATED_STRIKES:
return PP.getSerratedStrikesMode();
}
return false;
}
public void setMode(PlayerProfile PP, boolean bool)
{
switch(this)
{
case BERSERK:
PP.setBerserkMode(bool);
break;
case SUPER_BREAKER:
PP.setSuperBreakerMode(bool);
break;
case GIGA_DRILL_BREAKER:
PP.setGigaDrillBreakerMode(bool);
break;
case GREEN_TERRA:
PP.setGreenTerraMode(bool);
break;
case SKULL_SPLIITER:
PP.setSkullSplitterMode(bool);
break;
case TREE_FELLER:
PP.setTreeFellerMode(bool);
break;
case SERRATED_STRIKES:
PP.setSerratedStrikesMode(bool);
break;
}
}
public boolean getInformed(PlayerProfile PP)
{
switch(this)
{
case BLAST_MINING:
return PP.getBlastMiningInformed();
case BERSERK:
return PP.getBerserkInformed();
case SUPER_BREAKER:
return PP.getSuperBreakerInformed();
case GIGA_DRILL_BREAKER:
return PP.getGigaDrillBreakerInformed();
case GREEN_TERRA:
return PP.getGreenTerraInformed();
case SKULL_SPLIITER:
return PP.getSkullSplitterInformed();
case TREE_FELLER:
return PP.getTreeFellerInformed();
case SERRATED_STRIKES:
return PP.getSerratedStrikesInformed();
}
return false;
}
public void setInformed(PlayerProfile PP, boolean bool)
{
switch(this)
{
case BLAST_MINING:
PP.setBlastMiningInformed(bool);
break;
case BERSERK:
PP.setBerserkInformed(bool);
break;
case SUPER_BREAKER:
PP.setSuperBreakerInformed(bool);
break;
case GIGA_DRILL_BREAKER:
PP.setGigaDrillBreakerInformed(bool);
break;
case GREEN_TERRA:
PP.setGreenTerraInformed(bool);
break;
case SKULL_SPLIITER:
PP.setSkullSplitterInformed(bool);
break;
case TREE_FELLER:
PP.setTreeFellerInformed(bool);
break;
case SERRATED_STRIKES:
PP.setSerratedStrikesInformed(bool);
break;
}
}
public boolean getPermissions(Player player)
{
switch(this)
{
case BERSERK:
return mcPermissions.getInstance().unarmedAbility(player);
case GIGA_DRILL_BREAKER:
return mcPermissions.getInstance().excavationAbility(player);
case GREEN_TERRA:
return mcPermissions.getInstance().herbalismAbility(player);
case SERRATED_STRIKES:
return mcPermissions.getInstance().swordsAbility(player);
case SKULL_SPLIITER:
return mcPermissions.getInstance().axesAbility(player);
case SUPER_BREAKER:
return mcPermissions.getInstance().miningAbility(player);
case TREE_FELLER:
return mcPermissions.getInstance().woodCuttingAbility(player);
case BLAST_MINING:
return mcPermissions.getInstance().blastMining(player);
}
return false;
}
}

View File

@@ -25,20 +25,16 @@ import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.events.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
public class PlayerProfile
{
protected final Logger log = Logger.getLogger("Minecraft");
@@ -47,41 +43,41 @@ public class PlayerProfile
private HUDType hud;
//MISC
private String party, myspawn, myspawnworld, invite;
private String party, invite;
//TOGGLES
private boolean partyhud = true, spoutcraft = false, filling = false, xpbarlocked = false, placedAnvil = false, partyChatMode = false, adminChatMode = false, godMode = false, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true,
superBreakerInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode,
private boolean loaded = false, partyhud = true, spoutcraft = false, filling = false, xpbarlocked = false, placedAnvil = false, partyChatMode = false, adminChatMode = false, godMode = false, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true,
superBreakerInformed = true, blastMiningInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode,
serratedStrikesMode, hoePreparationMode = false, shovelPreparationMode = false, swordsPreparationMode = false, fistsPreparationMode = false, pickaxePreparationMode = false, axePreparationMode = false, skullSplitterMode, berserkMode;
//TIMESTAMPS
//ATS = (Time of) Activation Time Stamp
//DATS = (Time of) Deactivation Time Stamp
private int xpGainATS = 0, recentlyHurt = 0, berserkATS = 0, berserkDATS = 0, gigaDrillBreakerATS = 0, gigaDrillBreakerDATS = 0,
respawnATS = 0, mySpawnATS = 0, greenTerraATS = 0, greenTerraDATS = 0, superBreakerATS = 0, superBreakerDATS = 0, serratedStrikesATS = 0, serratedStrikesDATS = 0, treeFellerATS = 0, treeFellerDATS = 0,
skullSplitterATS = 0, skullSplitterDATS = 0, hoePreparationATS = 0, axePreparationATS = 0, pickaxePreparationATS = 0, fistsPreparationATS = 0, shovelPreparationATS = 0, swordsPreparationATS = 0;
private int xpGainATS = 0, recentlyHurt = 0, respawnATS, hoePreparationATS, shovelPreparationATS, swordsPreparationATS, fistsPreparationATS, axePreparationATS, pickaxePreparationATS;
private SkillType lastgained = null, skillLock = null;
//MySQL STUFF
private int xpbarinc=0, lastlogin=0, userid = 0, bleedticks = 0;
//MAGIC STUFF
private int mana = 0;
private int greenDyeCycleSel = 0, greenDyeCycle = 0, blueDyeCycle = 0, blueDyeCycleSel = 0;
public boolean dyeChanged = false;
private String playername;
private String playerName;
//Time to HashMap this shiz
HashMap<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); //Skills and XP
HashMap<SkillType, Integer> skillsXp = new HashMap<SkillType, Integer>(); //Skills and XP
HashMap<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>(); //Skill ATS
String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
public PlayerProfile(Player player)
public PlayerProfile(String name)
{
hud = LoadProperties.defaulthud;
//Setup the HashMap for ability DATS
for(AbilityType abilityType : AbilityType.values())
{
skillsDATS.put(abilityType, 0);
}
//Setup the HashMap for the skills
for(SkillType skillType : SkillType.values())
{
@@ -92,18 +88,51 @@ public class PlayerProfile
}
}
playername = player.getName();
playerName = name;
if (LoadProperties.useMySQL)
{
if(!loadMySQL(player)) {
addMySQLPlayer(player);
loadMySQL(player);//This is probably not needed anymore, could just delete
if(!loadMySQL()) {
addMySQLPlayer();
loadMySQL();//This is probably not needed anymore, could just delete
}
} else {
if(!load()) { addPlayer(); }
if(!load()) { addPlayer();}
}
lastlogin = ((Long) (System.currentTimeMillis()/1000)).intValue();
}
public PlayerProfile(String name, boolean addNew)
{
hud = LoadProperties.defaulthud;
//Setup the HashMap for ability DATS
for(AbilityType abilityType : AbilityType.values())
{
skillsDATS.put(abilityType, 0);
}
//Setup the HashMap for the skills
for(SkillType skillType : SkillType.values())
{
if(skillType != SkillType.ALL)
{
skills.put(skillType, 0);
skillsXp.put(skillType, 0);
}
}
playerName = name;
if (LoadProperties.useMySQL)
{
if(!loadMySQL() && addNew) {
addMySQLPlayer();
loadMySQL();//This is probably not needed anymore, could just delete
}
} else {
if(!load() && addNew) { addPlayer(); loaded = true; }
}
lastlogin = ((Long) (System.currentTimeMillis()/1000)).intValue();
}
public int getLastLogin()
{
return lastlogin;
@@ -113,10 +142,10 @@ public class PlayerProfile
return userid;
}
public boolean loadMySQL(Player p)
public boolean loadMySQL()
{
Integer id = 0;
id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + p.getName() + "'");
id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'");
if(id == 0)
return false;
this.userid = id;
@@ -141,11 +170,8 @@ public class PlayerProfile
}
HashMap<Integer, ArrayList<String>> users = mcMMO.database.Read("SELECT lastlogin, party FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = " + id);
//lastlogin = Integer.parseInt(users.get(1).get(0));
party = users.get(1).get(1);
HashMap<Integer, ArrayList<String>> spawn = mcMMO.database.Read("SELECT world, x, y, z FROM "+LoadProperties.MySQLtablePrefix+"spawn WHERE user_id = " + id);
myspawnworld = spawn.get(1).get(0);
myspawn = spawn.get(1).get(1) + "," + spawn.get(1).get(2) + "," + spawn.get(1).get(3);
HashMap<Integer, ArrayList<String>> cooldowns = mcMMO.database.Read("SELECT mining, woodcutting, unarmed, herbalism, excavation, swords, axes FROM "+LoadProperties.MySQLtablePrefix+"cooldowns WHERE user_id = " + id);
party = users.get(1).get(1);
HashMap<Integer, ArrayList<String>> cooldowns = mcMMO.database.Read("SELECT mining, woodcutting, unarmed, herbalism, excavation, swords, axes, blast_mining FROM "+LoadProperties.MySQLtablePrefix+"cooldowns WHERE user_id = " + id);
/*
* I'm still learning MySQL, this is a fix for adding a new table
* its not pretty but it works
@@ -156,13 +182,14 @@ public class PlayerProfile
}
else
{
superBreakerDATS = Integer.valueOf(cooldowns.get(1).get(0));
treeFellerDATS = Integer.valueOf(cooldowns.get(1).get(1));
berserkDATS = Integer.valueOf(cooldowns.get(1).get(2));
greenTerraDATS = Integer.valueOf(cooldowns.get(1).get(3));
gigaDrillBreakerDATS = Integer.valueOf(cooldowns.get(1).get(4));
serratedStrikesDATS = Integer.valueOf(cooldowns.get(1).get(5));
skullSplitterDATS = Integer.valueOf(cooldowns.get(1).get(6));
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(cooldowns.get(1).get(0)));
skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(cooldowns.get(1).get(1)));
skillsDATS.put(AbilityType.BERSERK, Integer.valueOf(cooldowns.get(1).get(2)));
skillsDATS.put(AbilityType.GREEN_TERRA, Integer.valueOf(cooldowns.get(1).get(3)));
skillsDATS.put(AbilityType.GIGA_DRILL_BREAKER, Integer.valueOf(cooldowns.get(1).get(4)));
skillsDATS.put(AbilityType.SERRATED_STRIKES, Integer.valueOf(cooldowns.get(1).get(5)));
skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(cooldowns.get(1).get(6)));
skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(cooldowns.get(1).get(7)));
}
HashMap<Integer, ArrayList<String>> stats = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics, fishing FROM "+LoadProperties.MySQLtablePrefix+"skills WHERE user_id = " + id);
skills.put(SkillType.TAMING, Integer.valueOf(stats.get(1).get(0)));
@@ -190,18 +217,18 @@ public class PlayerProfile
skillsXp.put(SkillType.AXES, Integer.valueOf(experience.get(1).get(9)));
skillsXp.put(SkillType.ACROBATICS, Integer.valueOf(experience.get(1).get(10)));
skillsXp.put(SkillType.FISHING, Integer.valueOf(experience.get(1).get(11)));
loaded = true;
return true;
}
else {
return false;
}
}
public void addMySQLPlayer(Player p) {
public void addMySQLPlayer() {
Integer id = 0;
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + p.getName() + "'," + System.currentTimeMillis() / 1000 +")");
id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + p.getName() + "'");
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")");
id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'");
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"cooldowns (user_id) VALUES ("+id+")");
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"spawn (user_id) VALUES ("+id+")");
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"skills (user_id) VALUES ("+id+")");
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"experience (user_id) VALUES ("+id+")");
this.userid = id;
@@ -219,14 +246,11 @@ public class PlayerProfile
//Find if the line contains the player we want.
String[] character = line.split(":");
if(!character[0].equals(playername)){continue;}
if(!character[0].equals(playerName)){continue;}
//Get Mining
if(character.length > 1 && m.isInt(character[1]))
skills.put(SkillType.MINING, Integer.valueOf(character[1]));
//Myspawn
if(character.length > 2)
myspawn = character[2];
//Party
if(character.length > 3)
party = character[3];
@@ -269,26 +293,24 @@ public class PlayerProfile
skillsXp.put(SkillType.AXES, Integer.valueOf(character[21]));
if(character.length > 22 && m.isInt(character[22]))
skillsXp.put(SkillType.ACROBATICS, Integer.valueOf(character[22]));
if(character.length > 23 && m.isInt(character[23]))
myspawnworld = character[23];
if(character.length > 24 && m.isInt(character[24]))
skills.put(SkillType.TAMING, Integer.valueOf(character[24]));
if(character.length > 25 && m.isInt(character[25]))
skillsXp.put(SkillType.TAMING, Integer.valueOf(character[25]));
if(character.length > 26)
berserkDATS = Integer.valueOf(character[26]);
skillsDATS.put(AbilityType.BERSERK, Integer.valueOf(character[26]));
if(character.length > 27)
gigaDrillBreakerDATS = Integer.valueOf(character[27]);
skillsDATS.put(AbilityType.GIGA_DRILL_BREAKER, Integer.valueOf(character[27]));
if(character.length > 28)
treeFellerDATS = Integer.valueOf(character[28]);
skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(character[28]));
if(character.length > 29)
greenTerraDATS = Integer.valueOf(character[29]);
skillsDATS.put(AbilityType.GREEN_TERRA, Integer.valueOf(character[29]));
if(character.length > 30)
serratedStrikesDATS = Integer.valueOf(character[30]);
skillsDATS.put(AbilityType.SERRATED_STRIKES, Integer.valueOf(character[30]));
if(character.length > 31)
skullSplitterDATS = Integer.valueOf(character[31]);
skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(character[31]));
if(character.length > 32)
superBreakerDATS = Integer.valueOf(character[32]);
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
if(character.length > 33)
{
for(HUDType x : HUDType.values())
@@ -303,7 +325,10 @@ public class PlayerProfile
skills.put(SkillType.FISHING, Integer.valueOf(character[34]));
if(character.length > 35)
skillsXp.put(SkillType.FISHING, Integer.valueOf(character[35]));
if(character.length > 36)
skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(character[36]));
in.close();
loaded = true;
return true;
}
in.close();
@@ -324,15 +349,15 @@ public class PlayerProfile
+" hudtype = '"+hud.toString()+"' WHERE user_id = "+this.userid);
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid);
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET party = '"+this.party+"' WHERE id = " +this.userid);
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"spawn SET world = '" + this.myspawnworld + "', x = " +getX()+", y = "+getY()+", z = "+getZ()+" WHERE user_id = "+this.userid);
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"cooldowns SET "
+" mining = "+(superBreakerDATS)
+", woodcutting = "+(treeFellerDATS)
+", unarmed = "+(berserkDATS)
+", herbalism = "+(greenTerraDATS)
+", excavation = "+(gigaDrillBreakerDATS)
+", swords = " +(serratedStrikesDATS)
+", axes = "+(skullSplitterDATS)
+" mining = " + skillsDATS.get(AbilityType.SUPER_BREAKER)
+", woodcutting = " + skillsDATS.get(AbilityType.TREE_FELLER)
+", unarmed = " + skillsDATS.get(AbilityType.BERSERK)
+", herbalism = " + skillsDATS.get(AbilityType.GREEN_TERRA)
+", excavation = " + skillsDATS.get(AbilityType.GIGA_DRILL_BREAKER)
+", swords = " + skillsDATS.get(AbilityType.SERRATED_STRIKES)
+", axes = " + skillsDATS.get(AbilityType.SKULL_SPLIITER)
+", blast_mining = " + skillsDATS.get(AbilityType.BLAST_MINING)
+" WHERE user_id = "+this.userid);
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET "
+" taming = "+skills.get(SkillType.TAMING)
@@ -377,15 +402,15 @@ public class PlayerProfile
{
//Read the line in and copy it to the output it's not the player
//we want to edit
if(!line.split(":")[0].equalsIgnoreCase(playername))
if(!line.split(":")[0].equalsIgnoreCase(playerName))
{
writer.append(line).append("\r\n");
//Otherwise write the new player information
} else {
writer.append(playername + ":");
writer.append(playerName + ":");
writer.append(skills.get(SkillType.MINING) + ":");
writer.append(myspawn + ":");
writer.append("" + ":");
writer.append(party+":");
writer.append(skillsXp.get(SkillType.MINING) + ":");
writer.append(skills.get(SkillType.WOODCUTTING) + ":");
@@ -406,21 +431,22 @@ public class PlayerProfile
writer.append(skillsXp.get(SkillType.SWORDS) + ":");
writer.append(skillsXp.get(SkillType.AXES) + ":");
writer.append(skillsXp.get(SkillType.ACROBATICS) + ":");
writer.append(myspawnworld+":");
writer.append(""+":");
writer.append(skills.get(SkillType.TAMING) + ":");
writer.append(skillsXp.get(SkillType.TAMING) + ":");
//Need to store the DATS of abilities nao
//Berserk, Gigadrillbreaker, Tree Feller, Green Terra, Serrated Strikes, Skull Splitter, Super Breaker
writer.append(String.valueOf(berserkDATS)+":");
writer.append(String.valueOf(gigaDrillBreakerDATS)+":");
writer.append(String.valueOf(treeFellerDATS)+":");
writer.append(String.valueOf(greenTerraDATS)+":");
writer.append(String.valueOf(serratedStrikesDATS)+":");
writer.append(String.valueOf(skullSplitterDATS)+":");
writer.append(String.valueOf(superBreakerDATS)+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.BERSERK))+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.GIGA_DRILL_BREAKER))+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.TREE_FELLER))+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.GREEN_TERRA))+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.SERRATED_STRIKES))+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.SKULL_SPLIITER))+":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.SUPER_BREAKER))+":");
writer.append(hud.toString()+":");
writer.append(skills.get(SkillType.FISHING) + ":");
writer.append(skillsXp.get(SkillType.FISHING) + ":");
writer.append(String.valueOf(skillsDATS.get(AbilityType.BLAST_MINING)) + ":");
writer.append("\r\n");
}
}
@@ -434,6 +460,29 @@ public class PlayerProfile
}
}
}
public void resetAllData()
{
//This will reset everything to default values and then save the information to FlatFile/MySQL
for(SkillType skillType : SkillType.values())
{
if(skillType == SkillType.ALL)
continue;
skills.put(skillType, 0);
skillsXp.put(skillType, 0);
}
for(AbilityType abilityType : AbilityType.values())
{
skillsDATS.put(abilityType, 0);
}
//Misc stuff
party = "";
save();
}
public void addPlayer()
{
try {
@@ -442,9 +491,9 @@ public class PlayerProfile
BufferedWriter out = new BufferedWriter(file);
//Add the player to the end
out.append(playername + ":");
out.append(playerName + ":");
out.append(0 + ":"); //mining
out.append(myspawn+":");
out.append(""+":");
out.append(party+":");
out.append(0+":"); //XP
out.append(0+":"); //woodcutting
@@ -465,7 +514,7 @@ public class PlayerProfile
out.append(0+":"); //swordsXP
out.append(0+":"); //axesXP
out.append(0+":"); //acrobaticsXP
out.append(myspawnworld+":");
out.append(""+":");
out.append(0+":"); //taming
out.append(0+":"); //tamingXP
out.append(0+":"); //DATS
@@ -478,6 +527,7 @@ public class PlayerProfile
out.append(LoadProperties.defaulthud.toString()+":");//HUD
out.append(0+":"); //Fishing
out.append(0+":"); //FishingXP
out.append(0+":"); //Blast Mining
//Add more in the same format as the line above
@@ -491,6 +541,10 @@ public class PlayerProfile
{
partyhud = !partyhud;
}
public boolean isLoaded()
{
return loaded;
}
public boolean getPartyHUD()
{
return partyhud;
@@ -577,60 +631,10 @@ public class PlayerProfile
{
partyChatMode = !partyChatMode;
}
public void setMana(int newvalue)
{
mana = newvalue;
}
public int getCurrentMana()
{
return mana;
}
public void setDyeChanged(Boolean bool)
{
dyeChanged = bool;
}
public boolean getDyeChanged()
{
return dyeChanged;
}
public void setBlueDyeCycle(int newvalue)
{
blueDyeCycle = newvalue;
}
public int getBlueDyeCycle()
{
return blueDyeCycle;
}
public void setBlueDyeCycleSel(int newvalue)
{
blueDyeCycleSel = newvalue;
}
public int getBlueDyeCycleSel()
{
return blueDyeCycleSel;
}
public void setGreenDyeCycle(int newvalue)
{
greenDyeCycle = newvalue;
}
public int getGreenDyeCycle()
{
return greenDyeCycle;
}
public void setGreenDyeCycleSel(int newvalue)
{
greenDyeCycleSel = newvalue;
}
public int getGreenDyeCycleSel()
{
return greenDyeCycleSel;
}
public boolean isPlayer(String player)
{
return player.equals(playername);
return player.equals(Bukkit.getPlayer(playerName));
}
public boolean getPartyChatOnlyToggle(){return partyChatOnly;}
public void togglePartyChatOnly(){partyChatOnly = !partyChatOnly;}
@@ -641,13 +645,6 @@ public class PlayerProfile
{
abilityuse = !abilityuse;
}
public long getMySpawnATS(){
return mySpawnATS;
}
public void setMySpawnATS(long newvalue)
{
mySpawnATS = (int) (newvalue/1000);
}
public void decreaseBleedTicks()
{
bleedticks--;
@@ -657,9 +654,17 @@ public class PlayerProfile
}
public void setBleedTicks(Integer newvalue){
bleedticks = newvalue;
//Cap maximum ticks at 10
if(bleedticks > 10)
bleedticks = 10;
}
public void addBleedTicks(Integer newvalue){
bleedticks+=newvalue;
//Cap maximum ticks at 10
if(bleedticks > 10)
bleedticks = 10;
}
/*
* EXPLOIT PREVENTION
@@ -673,7 +678,7 @@ public class PlayerProfile
public boolean getHoePreparationMode(){
return hoePreparationMode;
}
public void setHoePreparationMode(Boolean bool){
public void setHoePreparationMode(boolean bool){
hoePreparationMode = bool;
}
public long getHoePreparationATS(){
@@ -689,7 +694,7 @@ public class PlayerProfile
public boolean getSwordsPreparationMode(){
return swordsPreparationMode;
}
public void setSwordsPreparationMode(Boolean bool){
public void setSwordsPreparationMode(boolean bool){
swordsPreparationMode = bool;
}
public long getSwordsPreparationATS(){
@@ -704,7 +709,7 @@ public class PlayerProfile
public boolean getShovelPreparationMode(){
return shovelPreparationMode;
}
public void setShovelPreparationMode(Boolean bool){
public void setShovelPreparationMode(boolean bool){
shovelPreparationMode = bool;
}
public long getShovelPreparationATS(){
@@ -719,7 +724,7 @@ public class PlayerProfile
public boolean getFistsPreparationMode(){
return fistsPreparationMode;
}
public void setFistsPreparationMode(Boolean bool){
public void setFistsPreparationMode(boolean bool){
fistsPreparationMode = bool;
}
public long getFistsPreparationATS(){
@@ -734,7 +739,7 @@ public class PlayerProfile
public boolean getAxePreparationMode(){
return axePreparationMode;
}
public void setAxePreparationMode(Boolean bool){
public void setAxePreparationMode(boolean bool){
axePreparationMode = bool;
}
public long getAxePreparationATS(){
@@ -749,169 +754,111 @@ public class PlayerProfile
public boolean getPickaxePreparationMode(){
return pickaxePreparationMode;
}
public void setPickaxePreparationMode(Boolean bool){
public void setPickaxePreparationMode(boolean bool){
pickaxePreparationMode = bool;
}
public long getPickaxePreparationATS(){
return pickaxePreparationATS;
return pickaxePreparationATS;
}
public void setPickaxePreparationATS(long newvalue){
pickaxePreparationATS = (int) (newvalue/1000);
pickaxePreparationATS = (int) (newvalue/1000);
}
/*
* GREEN TERRA MODE
*/
public boolean getGreenTerraInformed() {return greenTerraInformed;}
public void setGreenTerraInformed(Boolean bool){
public void setGreenTerraInformed(boolean bool){
greenTerraInformed = bool;
}
public boolean getGreenTerraMode(){
return greenTerraMode;
}
public void setGreenTerraMode(Boolean bool){
public void setGreenTerraMode(boolean bool){
greenTerraMode = bool;
}
public long getGreenTerraActivatedTimeStamp() {return greenTerraATS;}
public void setGreenTerraActivatedTimeStamp(Long newvalue){
greenTerraATS = (int) (newvalue/1000);
}
public long getGreenTerraDeactivatedTimeStamp() {return greenTerraDATS;}
public void setGreenTerraDeactivatedTimeStamp(Long newvalue){
greenTerraDATS = (int) (newvalue/1000);
save();
}
/*
* BERSERK MODE
*/
public boolean getBerserkInformed() {return berserkInformed;}
public void setBerserkInformed(Boolean bool){
public void setBerserkInformed(boolean bool){
berserkInformed = bool;
}
public boolean getBerserkMode(){
return berserkMode;
}
public void setBerserkMode(Boolean bool){
public void setBerserkMode(boolean bool){
berserkMode = bool;
}
public long getBerserkActivatedTimeStamp() {return berserkATS;}
public void setBerserkActivatedTimeStamp(Long newvalue){
berserkATS = (int) (newvalue/1000);
}
public long getBerserkDeactivatedTimeStamp() {return berserkDATS;}
public void setBerserkDeactivatedTimeStamp(Long newvalue){
berserkDATS = (int) (newvalue/1000);
save();
}
/*
* SKULL SPLITTER
*/
public boolean getSkullSplitterInformed() {return skullSplitterInformed;}
public void setSkullSplitterInformed(Boolean bool){
public void setSkullSplitterInformed(boolean bool){
skullSplitterInformed = bool;
}
public boolean getSkullSplitterMode(){
return skullSplitterMode;
}
public void setSkullSplitterMode(Boolean bool){
public void setSkullSplitterMode(boolean bool){
skullSplitterMode = bool;
}
public long getSkullSplitterActivatedTimeStamp() {return skullSplitterATS;}
public void setSkullSplitterActivatedTimeStamp(Long newvalue){
skullSplitterATS = (int) (newvalue/1000);
}
public long getSkullSplitterDeactivatedTimeStamp() {return skullSplitterDATS;}
public void setSkullSplitterDeactivatedTimeStamp(Long newvalue){
skullSplitterDATS = (int) (newvalue/1000);
save();
}
/*
* SERRATED STRIKES
*/
public boolean getSerratedStrikesInformed() {return serratedStrikesInformed;}
public void setSerratedStrikesInformed(Boolean bool){
public void setSerratedStrikesInformed(boolean bool){
serratedStrikesInformed = bool;
}
public boolean getSerratedStrikesMode(){
return serratedStrikesMode;
}
public void setSerratedStrikesMode(Boolean bool){
public void setSerratedStrikesMode(boolean bool){
serratedStrikesMode = bool;
}
public long getSerratedStrikesActivatedTimeStamp() {return serratedStrikesATS;}
public void setSerratedStrikesActivatedTimeStamp(Long newvalue){
serratedStrikesATS = (int) (newvalue/1000);
}
public long getSerratedStrikesDeactivatedTimeStamp() {return serratedStrikesDATS;}
public void setSerratedStrikesDeactivatedTimeStamp(Long newvalue){
serratedStrikesDATS = (int) (newvalue/1000);
save();
}
/*
* GIGA DRILL BREAKER
*/
public boolean getGigaDrillBreakerInformed() {return gigaDrillBreakerInformed;}
public void setGigaDrillBreakerInformed(Boolean bool){
public void setGigaDrillBreakerInformed(boolean bool){
gigaDrillBreakerInformed = bool;
}
public boolean getGigaDrillBreakerMode(){
return gigaDrillBreakerMode;
}
public void setGigaDrillBreakerMode(Boolean bool){
public void setGigaDrillBreakerMode(boolean bool){
gigaDrillBreakerMode = bool;
}
public long getGigaDrillBreakerActivatedTimeStamp() {return gigaDrillBreakerATS;}
public void setGigaDrillBreakerActivatedTimeStamp(Long newvalue){
gigaDrillBreakerATS = (int) (newvalue/1000);
}
public long getGigaDrillBreakerDeactivatedTimeStamp() {return gigaDrillBreakerDATS;}
public void setGigaDrillBreakerDeactivatedTimeStamp(Long newvalue){
gigaDrillBreakerDATS = (int) (newvalue/1000);
save();
}
/*
* TREE FELLER STUFF
*/
public boolean getTreeFellerInformed() {return treeFellerInformed;}
public void setTreeFellerInformed(Boolean bool){
public void setTreeFellerInformed(boolean bool){
treeFellerInformed = bool;
}
public boolean getTreeFellerMode(){
return treeFellerMode;
}
public void setTreeFellerMode(Boolean bool){
public void setTreeFellerMode(boolean bool){
treeFellerMode = bool;
}
public long getTreeFellerActivatedTimeStamp() {return treeFellerATS;}
public void setTreeFellerActivatedTimeStamp(Long newvalue){
treeFellerATS = (int) (newvalue/1000);
}
public long getTreeFellerDeactivatedTimeStamp() {return treeFellerDATS;}
public void setTreeFellerDeactivatedTimeStamp(Long newvalue){
treeFellerDATS = (int) (newvalue/1000);
save();
}
/*
* MINING
*/
public boolean getSuperBreakerInformed() {return superBreakerInformed;}
public void setSuperBreakerInformed(Boolean bool){
public void setSuperBreakerInformed(boolean bool){
superBreakerInformed = bool;
}
public boolean getBlastMiningInformed() {return blastMiningInformed;}
public void setBlastMiningInformed(boolean bool){
blastMiningInformed = bool;
}
public boolean getSuperBreakerMode(){
return superBreakerMode;
}
public void setSuperBreakerMode(Boolean bool){
public void setSuperBreakerMode(boolean bool){
superBreakerMode = bool;
}
public long getSuperBreakerActivatedTimeStamp() {return superBreakerATS;}
public void setSuperBreakerActivatedTimeStamp(Long newvalue){
superBreakerATS = (int) (newvalue/1000);
}
public long getSuperBreakerDeactivatedTimeStamp() {return superBreakerDATS;}
public void setSuperBreakerDeactivatedTimeStamp(Long newvalue){
superBreakerDATS = (int) (newvalue/1000);
save();
}
public long getRecentlyHurt(){
return recentlyHurt;
}
@@ -921,7 +868,6 @@ public class PlayerProfile
public void skillUp(SkillType skillType, int newvalue)
{
skills.put(skillType, skills.get(skillType)+newvalue);
save();
}
public Integer getSkillLevel(SkillType skillType)
{
@@ -935,7 +881,51 @@ public class PlayerProfile
{
skills.put(skillType, 0);
}
public long getSkillDATS(AbilityType abilityType)
{
//Is this actually unused, or should it actually be returning the convertedBack variable?
//It *is* unused, I don't think I put this here so I'm going to comment it out - nossr50
//long convertedBack = skillsDATS.get(abilityType) * 1000;
return skillsDATS.get(abilityType);
}
public void setSkillDATS(AbilityType abilityType, long value)
{
int wearsOff = (int) (value * .001D);
skillsDATS.put(abilityType, wearsOff);
}
public void resetCooldowns()
{
for(AbilityType x : skillsDATS.keySet())
{
skillsDATS.put(x, 0);
}
}
/**
* Adds XP to the player, doesn't calculate for XP Rate
* @param skillType The skill to add XP to
* @param newvalue The amount of XP to add
*/
public void addXPOverrideNoBonus(SkillType skillType, int newvalue)
{
if(skillType == SkillType.ALL)
{
for(SkillType x : SkillType.values())
{
if(x == SkillType.ALL)
continue;
Bukkit.getPluginManager().callEvent(new McMMOPlayerXpGainEvent(Bukkit.getPlayer(playerName), x, newvalue));
skillsXp.put(x, skillsXp.get(x)+newvalue);
}
} else {
int xp = newvalue;
Bukkit.getPluginManager().callEvent(new McMMOPlayerXpGainEvent(Bukkit.getPlayer(playerName), skillType, xp));
skillsXp.put(skillType, skillsXp.get(skillType)+xp);
lastgained = skillType;
}
}
/**
* Adds XP to the player, this ignores skill modifiers
* @param skillType The skill to add XP to
@@ -949,18 +939,21 @@ public class PlayerProfile
{
if(x == SkillType.ALL)
continue;
Bukkit.getPluginManager().callEvent(new McMMOPlayerXpGainEvent(Bukkit.getPlayer(playerName), x, newvalue));
skillsXp.put(x, skillsXp.get(x)+newvalue);
}
} else {
int xp = newvalue;
xp=xp*LoadProperties.xpGainMultiplier;
Bukkit.getPluginManager().callEvent(new McMMOPlayerXpGainEvent(Bukkit.getPlayer(playerName), skillType, xp));
skillsXp.put(skillType, skillsXp.get(skillType)+xp);
lastgained = skillType;
}
}
/**
* Adds XP to the player, this is affected by skill modifiers
* Adds XP to the player, this is affected by skill modifiers and xp rate
* @param skillType The skill to add XP to
* @param newvalue The amount of XP to add
*/
@@ -973,7 +966,7 @@ public class PlayerProfile
xpGainATS = (int) (System.currentTimeMillis()/1000);
double bonusModifier = 0;
String leaderName = "";
//String leaderName = "";
if(inParty())
{
@@ -981,8 +974,8 @@ public class PlayerProfile
{
if(x.isOnline() && !x.getName().equals(thisplayer.getName()) && Party.getInstance().isPartyLeader(x.getName(), this.getParty()))
{
leaderName = x.getName();
if(m.getDistance(thisplayer.getLocation(), x.getLocation()) < 25)
//leaderName = x.getName();
if(m.isNear(thisplayer.getLocation(), x.getLocation(), 25))
{
PlayerProfile PartyLeader = Users.getProfile(x);
if(PartyLeader.getSkillLevel(skillType) >= this.getSkillLevel(skillType))
@@ -1001,6 +994,7 @@ public class PlayerProfile
{
if(x == SkillType.ALL)
continue;
Bukkit.getPluginManager().callEvent(new McMMOPlayerXpGainEvent(Bukkit.getPlayer(playerName), x, newvalue));
skillsXp.put(x, skillsXp.get(x)+newvalue);
}
} else {
@@ -1041,6 +1035,9 @@ public class PlayerProfile
case AXES:
xp=(int) (xp/LoadProperties.axesxpmodifier);
break;
case FISHING:
xp=(int) (xp/LoadProperties.fishingxpmodifier);
break;
}
xp=xp*LoadProperties.xpGainMultiplier;
@@ -1050,15 +1047,12 @@ public class PlayerProfile
bonusModifier = 2;
double trueBonus = bonusModifier * xp;
double oldxp = xp;
xp+=trueBonus;
double percent = (trueBonus/oldxp)*100;
thisplayer.sendMessage(ChatColor.GREEN+"XP: "+oldxp+" Bonus XP: "+trueBonus+" Total: "+xp+ChatColor.GOLD+" [Master: "+leaderName+" " +" +"+(int)percent+"%]");
}
Bukkit.getPluginManager().callEvent(new McMMOPlayerXpGainEvent(Bukkit.getPlayer(playerName), skillType, xp));
skillsXp.put(skillType, skillsXp.get(skillType)+xp);
lastgained = skillType;
}
//save();
}
public void removeXP(SkillType skillType, int newvalue)
@@ -1080,7 +1074,6 @@ public class PlayerProfile
} else {
skillsXp.put(skillType, skillsXp.get(skillType)-newvalue);
}
//save();
}
public void acceptInvite()
{
@@ -1124,10 +1117,45 @@ public class PlayerProfile
skillsXp.put(SkillType.FISHING, 0);
} else {
skills.put(skillType, newvalue);
skillsXp.put(skillType, newvalue);
skillsXp.put(skillType, 0);
}
save();
}
public void addLevels(SkillType skillType, int levels)
{
if(skillType == SkillType.ALL)
{
skills.put(SkillType.TAMING, skills.get(SkillType.TAMING)+levels);
skills.put(SkillType.MINING, skills.get(SkillType.MINING)+levels);
skills.put(SkillType.WOODCUTTING, skills.get(SkillType.WOODCUTTING)+levels);
skills.put(SkillType.REPAIR, skills.get(SkillType.REPAIR)+levels);
skills.put(SkillType.HERBALISM, skills.get(SkillType.HERBALISM)+levels);
skills.put(SkillType.ACROBATICS, skills.get(SkillType.ACROBATICS)+levels);
skills.put(SkillType.SWORDS, skills.get(SkillType.SWORDS)+levels);
skills.put(SkillType.ARCHERY, skills.get(SkillType.ARCHERY)+levels);
skills.put(SkillType.UNARMED, skills.get(SkillType.UNARMED)+levels);
skills.put(SkillType.EXCAVATION, skills.get(SkillType.EXCAVATION)+levels);
skills.put(SkillType.AXES, skills.get(SkillType.AXES)+levels);
skills.put(SkillType.FISHING, skills.get(SkillType.FISHING)+levels);
skillsXp.put(SkillType.TAMING, 0);
skillsXp.put(SkillType.MINING, 0);
skillsXp.put(SkillType.WOODCUTTING, 0);
skillsXp.put(SkillType.REPAIR, 0);
skillsXp.put(SkillType.HERBALISM, 0);
skillsXp.put(SkillType.ACROBATICS, 0);
skillsXp.put(SkillType.SWORDS, 0);
skillsXp.put(SkillType.ARCHERY, 0);
skillsXp.put(SkillType.UNARMED, 0);
skillsXp.put(SkillType.EXCAVATION, 0);
skillsXp.put(SkillType.AXES, 0);
skillsXp.put(SkillType.FISHING, 0);
} else {
skills.put(skillType, skills.get(skillType)+levels);
skillsXp.put(skillType, 0);
}
}
public Integer getXpToLevel(SkillType skillType)
{
return (int) ((1020+(skills.get(skillType) * 20)));
@@ -1137,14 +1165,12 @@ public class PlayerProfile
public void setParty(String newParty)
{
party = newParty;
save();
}
//Retrieve the player's party
public String getParty() {return party;}
//Remove party
public void removeParty() {
party = null;
save();
}
//Retrieve whether or not the player is in a party
public boolean inParty()
@@ -1164,73 +1190,13 @@ public class PlayerProfile
return false;
}
}
public String getMySpawnWorld()
{
if(myspawnworld != null && !myspawnworld.equals("") && !myspawnworld.equals("null")){
return myspawnworld;
} else {
return Bukkit.getServer().getWorlds().get(0).toString();
}
}
//Save a users spawn location
public void setMySpawn(double x, double y, double z, String myspawnworldlocation){
myspawn = x+","+y+","+z;
myspawnworld = myspawnworldlocation;
save();
}
public String getX(){
if(myspawn != null)
{
String[] split = myspawn.split(",");
return split[0];
}
else
return null;
}
public String getY(){
if(myspawn != null)
{
String[] split = myspawn.split(",");
return split[1];
}
else
return null;
}
public String getZ(){
if(myspawn != null)
{
String[] split = myspawn.split(",");
return split[2];
}
else
return null;
}
public boolean isDead(){
return dead;
}
public Location getMySpawn(Player player)
public String getPlayerName()
{
Location loc = null;
if(myspawn != null)
{
if(m.isDouble(getX()) && m.isDouble(getY()) && m.isDouble(getZ()))
loc = new Location(player.getWorld(),(Double.parseDouble(getX())), Double.parseDouble(getY()), Double.parseDouble(getZ()));
else
return null;
} else
return null;
loc.setYaw(0);
loc.setPitch(0);
if(loc.getX() != 0 && loc.getY() != 0 && loc.getZ() != 0 && loc.getWorld() != null)
{
if(Bukkit.getServer().getWorld(this.getMySpawnWorld()) != null)
loc.setWorld(Bukkit.getServer().getWorld(this.getMySpawnWorld()));
else
loc.setWorld(Bukkit.getServer().getWorlds().get(0));
return loc;
} else {
return null;
}
return playerName;
}
}

View File

@@ -16,21 +16,97 @@
*/
package com.gmail.nossr50.datatypes;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
public enum SkillType
{
ACROBATICS,
ALCHEMY,
ACROBATICS(LoadProperties.levelCapAcrobatics),
ALL, //This one is just for convenience
ARCHERY,
AXES,
EXCAVATION,
ENCHANTING,
FISHING,
HERBALISM,
MINING,
REPAIR,
SWORDS,
TAMING,
UNARMED,
WOODCUTTING;
ARCHERY(LoadProperties.levelCapArchery),
AXES(AbilityType.SKULL_SPLIITER, LoadProperties.levelCapAxes, ToolType.AXE),
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, LoadProperties.levelCapExcavation, ToolType.SHOVEL),
FISHING(LoadProperties.levelCapFishing),
HERBALISM(AbilityType.GREEN_TERRA, LoadProperties.levelCapHerbalism, ToolType.HOE),
MINING(AbilityType.SUPER_BREAKER, LoadProperties.levelCapMining, ToolType.PICKAXE),
REPAIR(LoadProperties.levelCapRepair),
SWORDS(AbilityType.SERRATED_STRIKES, LoadProperties.levelCapSwords, ToolType.SWORD),
TAMING(LoadProperties.levelCapTaming),
UNARMED(AbilityType.BERSERK, LoadProperties.levelCapUnarmed, ToolType.FISTS),
WOODCUTTING(AbilityType.TREE_FELLER, LoadProperties.levelCapWoodcutting, ToolType.AXE);
private AbilityType ability;
private int maxLevel;
private ToolType tool;
private SkillType()
{
this.ability = null;
this.maxLevel = 0;
this.tool = null;
}
private SkillType(AbilityType ability, int maxLevel, ToolType tool)
{
this.ability = ability;
this.maxLevel = maxLevel;
this.tool = tool;
}
private SkillType(int maxLevel)
{
this(null, maxLevel, null);
}
public AbilityType getAbility()
{
return this.ability;
}
public int getMaxLevel()
{
if(maxLevel > 0)
return maxLevel;
else
return Integer.MAX_VALUE;
}
public ToolType getTool()
{
return this.tool;
}
public boolean getPermissions(Player player)
{
switch(this)
{
case ACROBATICS:
return mcPermissions.getInstance().acrobatics(player);
case ARCHERY:
return mcPermissions.getInstance().archery(player);
case AXES:
return mcPermissions.getInstance().axes(player);
case EXCAVATION:
return mcPermissions.getInstance().excavation(player);
case FISHING:
return mcPermissions.getInstance().fishing(player);
case HERBALISM:
return mcPermissions.getInstance().herbalism(player);
case MINING:
return mcPermissions.getInstance().mining(player);
case REPAIR:
return mcPermissions.getInstance().repair(player);
case SWORDS:
return mcPermissions.getInstance().swords(player);
case TAMING:
return mcPermissions.getInstance().taming(player);
case UNARMED:
return mcPermissions.getInstance().unarmed(player);
case WOODCUTTING:
return mcPermissions.getInstance().woodcutting(player);
}
return false;
}
}

View File

@@ -0,0 +1,147 @@
package com.gmail.nossr50.datatypes;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.m;
import com.gmail.nossr50.locale.mcLocale;
public enum ToolType
{
AXE(mcLocale.getString("Skills.LowerAxe"), mcLocale.getString("Skills.ReadyAxe")),
FISTS(mcLocale.getString("Skills.LowerFists"), mcLocale.getString("Skills.ReadyFists")),
HOE(mcLocale.getString("Skills.LowerHoe"), mcLocale.getString("Skills.ReadyHoe")),
PICKAXE(mcLocale.getString("Skills.LowerPickAxe"), mcLocale.getString("Skills.ReadyPickAxe")),
SHOVEL(mcLocale.getString("Skills.LowerShovel"), mcLocale.getString("Skills.ReadyShovel")),
SWORD(mcLocale.getString("Skills.LowerSword"), mcLocale.getString("Skills.ReadySword"));
private String lowerTool;
private String raiseTool;
private ToolType(String lowerTool, String raiseTool)
{
this.lowerTool = lowerTool;
this.raiseTool = raiseTool;
}
public String getLowerTool()
{
return this.lowerTool;
}
public String getRaiseTool()
{
return this.raiseTool;
}
public boolean getToolMode(PlayerProfile PP)
{
switch(this)
{
case AXE:
return PP.getAxePreparationMode();
case FISTS:
return PP.getFistsPreparationMode();
case HOE:
return PP.getHoePreparationMode();
case PICKAXE:
return PP.getPickaxePreparationMode();
case SHOVEL:
return PP.getShovelPreparationMode();
case SWORD:
return PP.getSwordsPreparationMode();
}
return false;
}
public void setToolMode(PlayerProfile PP, boolean bool)
{
switch(this)
{
case AXE:
PP.setAxePreparationMode(bool);
break;
case FISTS:
PP.setFistsPreparationMode(bool);
break;
case HOE:
PP.setHoePreparationMode(bool);
break;
case PICKAXE:
PP.setPickaxePreparationMode(bool);
break;
case SHOVEL:
PP.setShovelPreparationMode(bool);
break;
case SWORD:
PP.setSwordsPreparationMode(bool);
break;
}
}
public long getToolATS(PlayerProfile PP)
{
switch(this)
{
case AXE:
return PP.getAxePreparationATS();
case FISTS:
return PP.getFistsPreparationATS();
case HOE:
return PP.getHoePreparationATS();
case PICKAXE:
return PP.getPickaxePreparationATS();
case SHOVEL:
return PP.getShovelPreparationATS();
case SWORD:
return PP.getSwordsPreparationATS();
}
return 0;
}
public void setToolATS(PlayerProfile PP, long ats)
{
switch(this)
{
case AXE:
PP.setAxePreparationATS(ats);
break;
case FISTS:
PP.setFistsPreparationATS(ats);
break;
case HOE:
PP.setHoePreparationATS(ats);
break;
case PICKAXE:
PP.setPickaxePreparationATS(ats);
break;
case SHOVEL:
PP.setShovelPreparationATS(ats);
break;
case SWORD:
PP.setSwordsPreparationATS(ats);
break;
}
}
public boolean inHand(ItemStack is)
{
switch(this)
{
case AXE:
return m.isAxes(is);
case FISTS:
return is.getType().equals(Material.AIR);
case HOE:
return m.isHoe(is);
case PICKAXE:
return m.isMiningPick(is);
case SHOVEL:
return m.isShovel(is);
case SWORD:
return m.isSwords(is);
}
return false;
}
}

View File

@@ -0,0 +1,127 @@
package com.gmail.nossr50.datatypes.treasure;
import org.bukkit.inventory.ItemStack;
public class ExcavationTreasure extends Treasure {
// dirt grass sand gravel clay mycel soulsand
// 00000001 - dirt 1
// 00000010 - grass 2
// 00000100 - sand 4
// 00001000 - gravel 8
// 00010000 - clay 16
// 00100000 - mycel 32
// 01000000 - soulsand 64
private byte dropsFrom = 0x0;
public ExcavationTreasure(ItemStack drop, int xp, Double dropChance, int dropLevel) {
super(drop, xp, dropChance, dropLevel);
}
// Raw getters and setters
public byte getDropsFrom() {
return dropsFrom;
}
public void setDropsFrom(byte dropsFrom) {
this.dropsFrom = dropsFrom;
}
// Getters
public boolean getDropsFromDirt() {
return getDropFromMask(1);
}
public boolean getDropsFromGrass() {
return getDropFromMask(2);
}
public boolean getDropsFromSand() {
return getDropFromMask(4);
}
public boolean getDropsFromGravel() {
return getDropFromMask(8);
}
public boolean getDropsFromClay() {
return getDropFromMask(16);
}
public boolean getDropsFromMycel() {
return getDropFromMask(32);
}
public boolean getDropsFromSoulSand() {
return getDropFromMask(64);
}
private boolean getDropFromMask(int mask) {
return ((dropsFrom & mask) > 0) ? true : false;
}
// Setters
public void setDropsFromDirt() {
setDropFromMask(1);
}
public void setDropsFromGrass() {
setDropFromMask(2);
}
public void setDropsFromSand() {
setDropFromMask(4);
}
public void setDropsFromGravel() {
setDropFromMask(8);
}
public void setDropsFromClay() {
setDropFromMask(16);
}
public void setDropsFromMycel() {
setDropFromMask(32);
}
public void setDropsFromSoulSand() {
setDropFromMask(64);
}
private void setDropFromMask(int mask) {
dropsFrom |= mask;
}
// Un-setters
public void unsetDropsFromDirt() {
unsetDropFromMask(1);
}
public void unsetDropsFromGrass() {
unsetDropFromMask(2);
}
public void unsetDropsFromSand() {
unsetDropFromMask(4);
}
public void unsetDropsFromGravel() {
unsetDropFromMask(8);
}
public void unsetDropsFromClay() {
unsetDropFromMask(16);
}
public void unsetDropsFromMycel() {
unsetDropFromMask(32);
}
public void unsetDropsFromSoulSand() {
unsetDropFromMask(64);
}
private void unsetDropFromMask(int mask) {
dropsFrom &= ~mask;
}
}

View File

@@ -0,0 +1,20 @@
package com.gmail.nossr50.datatypes.treasure;
import org.bukkit.inventory.ItemStack;
public class FishingTreasure extends Treasure {
private int maxLevel;
public FishingTreasure(ItemStack drop, int xp, Double dropChance, int dropLevel, int maxLevel) {
super(drop, xp, dropChance, dropLevel);
this.setMaxLevel(maxLevel);
}
public int getMaxLevel() {
return maxLevel;
}
public void setMaxLevel(int maxLevel) {
this.maxLevel = maxLevel;
}
}

View File

@@ -0,0 +1,50 @@
package com.gmail.nossr50.datatypes.treasure;
import org.bukkit.inventory.ItemStack;
public abstract class Treasure {
private int xp;
private Double dropChance;
private int dropLevel;
private ItemStack drop;
public Treasure(ItemStack drop, int xp, Double dropChance, int dropLevel) {
this.drop = drop;
this.xp = xp;
this.dropChance = dropChance;
this.dropLevel = dropLevel;
}
public ItemStack getDrop() {
return drop;
}
public void setDrop(ItemStack drop) {
this.drop = drop;
}
public int getXp() {
return xp;
}
public void setXp(int xp) {
this.xp = xp;
}
public Double getDropChance() {
return dropChance;
}
public void setDropChance(Double dropChance) {
this.dropChance = dropChance;
}
public int getDropLevel() {
return dropLevel;
}
public void setDropLevel(int dropLevel) {
this.dropLevel = dropLevel;
}
}

View File

@@ -1,29 +1,28 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.datatypes;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
public class FakeBlockBreakEvent extends BlockBreakEvent {
private static final long serialVersionUID = 1L;
public FakeBlockBreakEvent(Block theBlock, Player player) {
super(theBlock, player);
}
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.events;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
public class FakeBlockBreakEvent extends BlockBreakEvent {
public FakeBlockBreakEvent(Block theBlock, Player player) {
super(theBlock, player);
}
}

View File

@@ -0,0 +1,10 @@
package com.gmail.nossr50.events;
import org.bukkit.entity.Entity;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public class FakeEntityDamageByEntityEvent extends EntityDamageByEntityEvent {
public FakeEntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage) {
super(damager, damagee, cause, damage);
}
}

View File

@@ -0,0 +1,10 @@
package com.gmail.nossr50.events;
import org.bukkit.entity.Entity;
import org.bukkit.event.entity.EntityDamageEvent;
public class FakeEntityDamageEvent extends EntityDamageEvent{
public FakeEntityDamageEvent(Entity damagee, DamageCause cause, int damage) {
super(damagee, cause, damage);
}
}

View File

@@ -25,7 +25,6 @@ import org.bukkit.inventory.ItemStack;
/**
* Called when mcMMO is preparing to drop an item
*/
@SuppressWarnings("serial")
public class McMMOItemSpawnEvent extends Event implements Cancellable {
private Location location;
private ItemStack itemStack;

View File

@@ -25,7 +25,6 @@ import com.gmail.nossr50.datatypes.SkillType;
/**
* Called when a user levels up in a skill
*/
@SuppressWarnings("serial")
public class McMMOPlayerLevelUpEvent extends Event {
private Player player;
private SkillType skill;

View File

@@ -0,0 +1,67 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.events;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.gmail.nossr50.datatypes.SkillType;
public class McMMOPlayerXpGainEvent extends Event {
private Player player;
private SkillType skill;
private int xpGained;
public McMMOPlayerXpGainEvent(Player player, SkillType skill, int xpGained) {
this.player = player;
this.skill = skill;
this.xpGained = xpGained;
}
/**
* @return Player gaining experience (can be null)
*/
public Player getPlayer() {
return player;
}
/**
* @return SkillType that is gaining experience
*/
public SkillType getSkill() {
return skill;
}
/**
* @return The number experience gained in this event
*/
public int getXpGained() {
return xpGained;
}
/** Rest of file is required boilerplate for custom events **/
private static final HandlerList handlers = new HandlerList();
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@@ -26,8 +26,8 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import org.bukkit.Material;
import org.bukkit.Statistic;
import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -37,15 +37,14 @@ import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer;
import org.getspout.spoutapi.sound.SoundEffect;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.*;
import com.gmail.nossr50.datatypes.FakeBlockBreakEvent;
import net.minecraft.server.Enchantment;
import com.gmail.nossr50.events.FakeBlockBreakEvent;
public class mcBlockListener implements Listener
{
@@ -56,232 +55,147 @@ public class mcBlockListener implements Listener
this.plugin = plugin;
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent event)
{
//Setup some basic vars
//Setup some basic variables
Block block;
Player player = event.getPlayer();
//When blocks are placed on snow this event reports the wrong block.
if (event.getBlockReplacedState() != null && event.getBlockReplacedState().getTypeId() == 78)
{
block = event.getBlockAgainst();
}
else
{
block = event.getBlock();
}
int id = block.getTypeId();
Material mat = block.getType();
//TNT placement checks - needed for Blast Mining
if(id == 46 && mcPermissions.getInstance().blastMining(player))
plugin.misc.tntTracker.put(block.getLocation(), player);
//Check if the blocks placed should be monitored so they do not give out XP in the future
if(m.shouldBeWatched(block))
{
int id = block.getTypeId();
if(m.shouldBeWatched(mat))
{
//Only needed for blocks that use their block data (wood, pumpkins, etc.)
if (id == 17 || id == 73 || id == 74 || id == 81 || id == 83 || id == 86 || id == 91 || id == 106 || id == 98)
boolean shouldBeChanged = true;
switch(mat)
{
case CACTUS:
case GLOWING_REDSTONE_ORE:
case JACK_O_LANTERN:
case LOG:
case PUMPKIN:
case REDSTONE_ORE:
case SUGAR_CANE_BLOCK:
case VINE:
shouldBeChanged = false; //We don't want these added to changeQueue
plugin.misc.blockWatchList.add(block);
else {
//block.setData((byte) 5); //Change the byte
//The following is a method to get around a breakage in 1.1-R2 and onward
//it should be removed as soon as functionality to change a block
//in this event returns.
plugin.changeQueue.push(block);
break;
case BROWN_MUSHROOM:
case RED_MUSHROOM:
case RED_ROSE:
case YELLOW_FLOWER:
case WATER_LILY:
plugin.fastChangeQueue.push(block);
break;
}
if(shouldBeChanged)
plugin.changeQueue.push(block);
}
if(block.getTypeId() == 42 && LoadProperties.anvilmessages)
if(id == LoadProperties.anvilID && LoadProperties.anvilmessages)
{
PlayerProfile PP = Users.getProfile(player);
if(LoadProperties.spoutEnabled)
if(!PP.getPlacedAnvil())
{
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if(sPlayer.isSpoutCraftEnabled())
{
if(!PP.getPlacedAnvil())
{
sPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.IRON_BLOCK);
PP.togglePlacedAnvil();
}
if(LoadProperties.spoutEnabled)
{
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if(sPlayer.isSpoutCraftEnabled())
sPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.IRON_BLOCK);
}
else
{
if(!PP.getPlacedAnvil())
{
event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$
PP.togglePlacedAnvil();
}
}
}
else
{
if(!PP.getPlacedAnvil())
{
event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$
PP.togglePlacedAnvil();
}
event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$
PP.togglePlacedAnvil();
}
}
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event)
{
Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player);
Block block = event.getBlock();
int id = block.getTypeId();
ItemStack inhand = player.getItemInHand();
if(event.isCancelled())
return;
if (event instanceof FakeBlockBreakEvent)
if(event instanceof FakeBlockBreakEvent)
return;
/*
* HERBALISM
*/
/*
* HERBALISM
*/
//Green Terra
if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && block.getTypeId() == 59 && block.getData() == (byte) 0x07)
{
Herbalism.greenTerraCheck(player, block);
}
if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && ((id == 59 && block.getData() == (byte) 0x07) || Herbalism.canBeGreenTerra(block)))
Skills.abilityCheck(player, SkillType.HERBALISM);
//Wheat && Triple drops
if(PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block))
{
Herbalism.herbalismProcCheck(block, player, event, plugin);
Herbalism.greenTerraWheat(player, block, event, plugin);
}
if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5)
Herbalism.herbalismProcCheck(block, player, event, plugin);
/*
* MINING
*/
//TNT removal checks - needed for Blast Mining
if(id == 46 && plugin.misc.tntTracker.containsKey(block.getLocation()))
plugin.misc.tntTracker.remove(block.getLocation());
if(mcPermissions.getInstance().mining(player))
{
if(LoadProperties.miningrequirespickaxe)
{
if(m.isMiningPick(inhand))
{
Mining.miningBlockCheck(player, block, plugin);
}
} else
{
if(LoadProperties.miningrequirespickaxe && m.isMiningPick(inhand))
Mining.miningBlockCheck(player, block, plugin);
else if(!LoadProperties.miningrequirespickaxe)
Mining.miningBlockCheck(player, block, plugin);
}
}
/*
* WOOD CUTTING
*/
if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player))
if(mcPermissions.getInstance().woodcutting(player) && id == 17)
{
if(LoadProperties.woodcuttingrequiresaxe)
{
if(m.isAxes(inhand))
{
if(!plugin.misc.blockWatchList.contains(block))
{
WoodCutting.woodCuttingProcCheck(player, block);
//Default
if(block.getData() == (byte)0)
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
//Spruce
if(block.getData() == (byte)1)
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mspruce, player);
//Birch
if(block.getData() == (byte)2)
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mbirch, player);
}
}
} else
{
if(!plugin.misc.blockWatchList.contains(block))
{
WoodCutting.woodCuttingProcCheck(player, block);
//Default
if(block.getData() == (byte)0)
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
//Spruce
if(block.getData() == (byte)1)
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mspruce, player);
//Birch
if(block.getData() == (byte)2)
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mbirch, player);
}
}
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
/*
* IF PLAYER IS USING TREEFELLER
*/
if(mcPermissions.getInstance().woodCuttingAbility(player)
&& PP.getTreeFellerMode()
&& block.getTypeId() == 17
&& m.blockBreakSimulate(block, player))
{
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.EXPLODE, player, block.getLocation());
WoodCutting.treeFeller(block, player, plugin);
for(Block blockx : plugin.misc.treeFeller)
{
if(blockx != null)
{
Material mat = Material.getMaterial(block.getTypeId());
byte type = 0;
if(block.getTypeId() == 17)
type = block.getData();
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
if(blockx.getTypeId() == 17)
{
m.mcDropItem(blockx.getLocation(), item);
//XP WOODCUTTING
if(!plugin.misc.blockWatchList.contains(block))
{
WoodCutting.woodCuttingProcCheck(player, blockx);
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
}
}
if(blockx.getTypeId() == 18)
{
mat = Material.SAPLING;
item = new ItemStack(mat, 1, (short)0, (byte)(blockx.getData()-8));
if(Math.random() * 10 > 9)
m.mcDropItem(blockx.getLocation(), item);
}
if(blockx.getType() != Material.AIR)
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
blockx.setType(Material.AIR);
}
}
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
}
plugin.misc.treeFeller.clear();
}
if(LoadProperties.woodcuttingrequiresaxe && m.isAxes(inhand))
WoodCutting.woodcuttingBlockCheck(player, block, plugin);
else if(!LoadProperties.woodcuttingrequiresaxe)
WoodCutting.woodcuttingBlockCheck(player, block, plugin);
if(PP.getTreeFellerMode())
WoodCutting.treeFeller(event, plugin);
}
/*
* EXCAVATION
*/
if(Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 5)
Excavation.excavationProcCheck(block.getData(), block.getType(), block.getLocation(), player);
/*
* HERBALISM
*/
if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(block))
{
Herbalism.greenTerraCheck(player, block);
if(LoadProperties.excavationRequiresShovel && m.isShovel(inhand))
Excavation.excavationProcCheck(block, player);
else if(!LoadProperties.excavationRequiresShovel)
Excavation.excavationProcCheck(block, player);
}
if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5)
Herbalism.herbalismProcCheck(block, player, event, plugin);
//Change the byte back when broken
if(block.getData() == 5 && m.shouldBeWatched(block))
if(block.getData() == 5 && m.shouldBeWatched(block.getType()))
{
block.setData((byte) 0);
if(plugin.misc.blockWatchList.contains(block))
@@ -291,181 +205,139 @@ public class mcBlockListener implements Listener
}
}
@EventHandler(priority = EventPriority.HIGHEST)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockDamage(BlockDamageEvent event)
{
if(event.isCancelled())
return;
Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player);
ItemStack inhand = player.getItemInHand();
Block block = event.getBlock();
Skills.monitorSkills(player, PP);
int id = block.getTypeId();
/*
* ABILITY PREPARATION CHECKS
*/
if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
Herbalism.greenTerraCheck(player, block);
if(PP.getAxePreparationMode() && block.getTypeId() == 17)
WoodCutting.treeFellerCheck(player, block);
if(PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(block))
Mining.superBreakerCheck(player, block);
if(PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(block))
Excavation.gigaDrillBreakerActivationCheck(player, block);
if(PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(block) || block.getTypeId() == 78))
Unarmed.berserkActivationCheck(player);
if(m.abilityBlockCheck(block))
{
if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
Skills.abilityCheck(player, SkillType.HERBALISM);
if(PP.getAxePreparationMode() && id == 17 && mcPermissions.getInstance().woodCuttingAbility(player))
Skills.abilityCheck(player, SkillType.WOODCUTTING);
if(PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(block))
Skills.abilityCheck(player, SkillType.MINING);
if(PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(block))
Skills.abilityCheck(player, SkillType.EXCAVATION);
}
if(PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(block) || id == 78))
Skills.abilityCheck(player, SkillType.UNARMED);
/*
* TREE FELLAN STUFF
* TREE FELLER STUFF
*/
if(LoadProperties.spoutEnabled && block.getTypeId() == 17 && Users.getProfile(player).getTreeFellerMode())
if(LoadProperties.spoutEnabled && id == 17 && PP.getTreeFellerMode())
SpoutStuff.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
/*
* GREEN TERRA STUFF
*/
if(PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player) && PP.getGreenTerraMode())
{
if(PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player))
Herbalism.greenTerra(player, block);
}
/*
* GIGA DRILL BREAKER CHECKS
*/
if(PP.getGigaDrillBreakerMode() && m.blockBreakSimulate(block, player)
&& Excavation.canBeGigaDrillBroken(block) && m.isShovel(inhand))
{
int x = 0;
while(x < 3)
if(PP.getGigaDrillBreakerMode() && Excavation.canBeGigaDrillBroken(block) && m.blockBreakSimulate(block, player, true) && mcPermissions.getInstance().excavationAbility(player))
{
if(LoadProperties.excavationRequiresShovel && m.isShovel(inhand))
{
if(block.getData() != (byte)5)
Excavation.excavationProcCheck(block.getData(), block.getType(), block.getLocation(), player);
x++;
event.setInstaBreak(true);
Excavation.gigaDrillBreaker(player, block);
}
else if(!LoadProperties.excavationRequiresShovel){
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!inhand.containsEnchantment(Enchantment.DURABILITY))
{
short durability = inhand.getDurability();
durability += (LoadProperties.abilityDurabilityLoss);
inhand.setDurability(durability);
}
}
event.setInstaBreak(true);
Excavation.gigaDrillBreaker(player, block);
}
Material mat = Material.getMaterial(block.getTypeId());
if(block.getType() == Material.GRASS)
mat = Material.DIRT;
if(block.getType() == Material.CLAY)
mat = Material.CLAY_BALL;
if(block.getType() == Material.MYCEL)
mat = Material.DIRT;
byte type = block.getData();
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
block.setType(Material.AIR);
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
}
if(item.getType() == Material.CLAY_BALL)
{
m.mcDropItem(block.getLocation(), item);
m.mcDropItem(block.getLocation(), item);
m.mcDropItem(block.getLocation(), item);
m.mcDropItem(block.getLocation(), item);
} else
{
m.mcDropItem(block.getLocation(), item);
}
//Spout stuff
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
/*
* BERSERK MODE CHECKS
*/
if(PP.getBerserkMode()
&& m.blockBreakSimulate(block, player)
&& m.blockBreakSimulate(block, player, true)
&& player.getItemInHand().getTypeId() == 0
&& (Excavation.canBeGigaDrillBroken(block) || block.getTypeId() == 78))
&& (Excavation.canBeGigaDrillBroken(block) || id == 78)
&& mcPermissions.getInstance().unarmedAbility(player))
{
Material mat = Material.getMaterial(block.getTypeId());
if(block.getTypeId() == 2)
mat = Material.DIRT;
if(block.getTypeId() == 78)
mat = Material.SNOW_BALL;
if(block.getTypeId() == 82)
mat = Material.CLAY_BALL;
if(block.getTypeId() == 110)
mat = Material.DIRT;
byte type = block.getData();
event.setInstaBreak(true);
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
block.setType(Material.AIR);
if(item.getType() == Material.CLAY_BALL)
{
m.mcDropItem(block.getLocation(), item);
m.mcDropItem(block.getLocation(), item);
m.mcDropItem(block.getLocation(), item);
m.mcDropItem(block.getLocation(), item);
} else
{
m.mcDropItem(block.getLocation(), item);
}
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
/*
* SUPER BREAKER CHECKS
*/
if(PP.getSuperBreakerMode()
&& Mining.canBeSuperBroken(block)
&& m.blockBreakSimulate(block, player))
&& Mining.canBeSuperBroken(block)
&& m.blockBreakSimulate(block, player, true)
&& mcPermissions.getInstance().miningAbility(player))
{
if(LoadProperties.miningrequirespickaxe)
{
if(m.isMiningPick(inhand))
if(m.isMiningPick(inhand)){
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!inhand.containsEnchantment(Enchantment.DURABILITY))
{
short durability = inhand.getDurability();
durability += (LoadProperties.abilityDurabilityLoss);
inhand.setDurability(durability);
}
}
event.setInstaBreak(true);
Mining.SuperBreakerBlockCheck(player, block, plugin);
}
} else {
event.setInstaBreak(true);
Mining.SuperBreakerBlockCheck(player, block, plugin);
}
}
/*
* LEAF BLOWER
* LEAF BLOWER CHECKS
*/
if(block.getTypeId() == 18 && mcPermissions.getInstance().woodcutting(player) && PP.getSkillLevel(SkillType.WOODCUTTING) >= 100 && m.isAxes(player.getItemInHand()) && m.blockBreakSimulate(block, player))
if(id == 18
&& mcPermissions.getInstance().woodCuttingAbility(player)
&& PP.getSkillLevel(SkillType.WOODCUTTING) >= 100
&& m.blockBreakSimulate(block, player, true))
{
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
}
if(Math.random() * 10 > 9)
if(LoadProperties.woodcuttingrequiresaxe)
{
ItemStack x = new ItemStack(Material.SAPLING, 1, (short)0, (byte)(block.getData()-8));
m.mcDropItem(block.getLocation(), x);
if(m.isAxes(inhand)){
event.setInstaBreak(true);
WoodCutting.leafBlower(player, block);
}
}
block.setType(Material.AIR);
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
if(block.getType() == Material.AIR && plugin.misc.blockWatchList.contains(block))
{
plugin.misc.blockWatchList.remove(block);
else{
if(inhand.getTypeId() != 359){
event.setInstaBreak(true);
WoodCutting.leafBlower(player, block);
}
}
}
}
@@ -474,9 +346,9 @@ public class mcBlockListener implements Listener
{
Block blockFrom = event.getBlock();
Block blockTo = event.getToBlock();
if(m.shouldBeWatched(blockFrom) && blockFrom.getData() == (byte)5)
if(m.shouldBeWatched(blockFrom.getType()) && blockFrom.getData() == (byte)5)
{
blockTo.setData((byte)5);
}
}
}
}
}

View File

@@ -16,9 +16,13 @@
*/
package com.gmail.nossr50.listeners;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.Wolf;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -29,17 +33,25 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityTameEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.events.FakeEntityDamageByEntityEvent;
import com.gmail.nossr50.events.FakeEntityDamageEvent;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.skills.Acrobatics;
import com.gmail.nossr50.skills.Archery;
import com.gmail.nossr50.skills.BlastMining;
import com.gmail.nossr50.skills.Skills;
import com.gmail.nossr50.skills.Taming;
@@ -51,138 +63,93 @@ public class mcEntityListener implements Listener
public mcEntityListener(final mcMMO plugin) {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event)
{
//Lets just put this here...
if(event instanceof FakeEntityDamageByEntityEvent)
return;
Entity defender = event.getEntity();
Entity attacker = event.getDamager();
if(attacker instanceof Player && defender instanceof Player)
{
if(!defender.getWorld().getPVP())
return;
if(Party.getInstance().inSameParty((Player)defender, (Player)attacker))
event.setCancelled(true);
}
//Make sure defender is not invincible
if(defender instanceof LivingEntity)
{
LivingEntity livingDefender = (LivingEntity)defender;
if(!m.isInvincible(livingDefender, event))
Combat.combatChecks(event, plugin);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityDamage(EntityDamageEvent event)
{
if(event.isCancelled())
return;
//Check for world pvp flag
if(event instanceof EntityDamageByEntityEvent)
{
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event;
if(eventb.getEntity() instanceof Player && eventb.getDamager() instanceof Player && !event.getEntity().getWorld().getPVP())
return;
}
/*
* CHECK FOR INVULNERABILITY
*/
if(event.getEntity() instanceof Player)
{
Player defender = (Player)event.getEntity();
PlayerProfile PPd = Users.getProfile(defender);
if(defender != null && PPd.getGodMode())
event.setCancelled(true);
if(PPd == null)
Users.addUser(defender);
}
if(event instanceof FakeEntityDamageEvent)
return;
Entity entity = event.getEntity();
EntityType type = entity.getType();
DamageCause cause = event.getCause();
if(event.getEntity() instanceof LivingEntity)
switch(type)
{
//CraftEntity cEntity = (CraftEntity)event.getEntity();
//if(cEntity.getHandle() instanceof EntityLiving)
{
LivingEntity entityliving = (LivingEntity)event.getEntity();
if(entityliving.getNoDamageTicks() < entityliving.getMaximumNoDamageTicks()/2.0F)
{
Entity x = event.getEntity();
DamageCause type = event.getCause();
if(event.getEntity() instanceof Wolf && ((Wolf)event.getEntity()).isTamed() && Taming.getOwner(((Wolf)event.getEntity()), plugin) != null)
{
Wolf theWolf = (Wolf) event.getEntity();
Player master = Taming.getOwner(theWolf, plugin);
PlayerProfile PPo = Users.getProfile(master);
if(master == null || PPo == null)
return;
//Environmentally Aware
if((event.getCause() == DamageCause.CONTACT || event.getCause() == DamageCause.LAVA || event.getCause() == DamageCause.FIRE) && PPo.getSkillLevel(SkillType.TAMING) >= 100)
{
if(event.getDamage() < ((Wolf) event.getEntity()).getHealth())
{
event.getEntity().teleport(Taming.getOwner(theWolf, plugin).getLocation());
master.sendMessage(mcLocale.getString("mcEntityListener.WolfComesBack")); //$NON-NLS-1$
event.getEntity().setFireTicks(0);
}
}
if(event.getCause() == DamageCause.FALL && PPo.getSkillLevel(SkillType.TAMING) >= 100)
{
event.setCancelled(true);
}
//Thick Fur
if(event.getCause() == DamageCause.FIRE_TICK)
{
event.getEntity().setFireTicks(0);
}
}
/*
* ACROBATICS
*/
if(x instanceof Player){
Player player = (Player)x;
if(type == DamageCause.FALL){
Acrobatics.acrobaticsCheck(player, event);
}
}
/*
* Entity Damage by Entity checks
*/
if(event instanceof EntityDamageByEntityEvent && !event.isCancelled())
{
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent) event;
Entity f = eventb.getDamager();
Entity e = event.getEntity();
/*
* PARTY CHECKS
*/
if(event.getEntity() instanceof Player && f instanceof Player)
{
Player defender = (Player)e;
Player attacker = (Player)f;
if(Party.getInstance().inSameParty(defender, attacker))
event.setCancelled(true);
}
Combat.combatChecks(event, plugin);
}
/*
* Check to see if the defender took damage so we can apply recently hurt
*/
if(event.getEntity() instanceof Player)
{
Player herpderp = (Player)event.getEntity();
if(!event.isCancelled() && event.getDamage() >= 1)
{
Users.getProfile(herpderp).setRecentlyHurt(System.currentTimeMillis());
}
}
}
}
case PLAYER:
/*
* CHECK FOR INVULNERABILITY
*/
Player player = (Player) entity;
PlayerProfile PP = Users.getProfile(player);
if(PP.getGodMode())
event.setCancelled(true);
if(!m.isInvincible(player, event))
{
if(cause == DamageCause.FALL && mcPermissions.getInstance().acrobatics(player))
Acrobatics.acrobaticsCheck(player, event);
if(cause == DamageCause.BLOCK_EXPLOSION && mcPermissions.getInstance().blastMining(player))
BlastMining.demolitionsExpertise(player, event);
if(event.getDamage() >= 1)
PP.setRecentlyHurt(System.currentTimeMillis());
}
break;
case WOLF:
Wolf wolf = (Wolf) entity;
if((!m.isInvincible(wolf, event)) && wolf.isTamed() && wolf.getOwner() != null)
Taming.preventDamage(event, plugin);
break;
}
}
@EventHandler
public void onEntityDeath(EntityDeathEvent event)
{
Entity x = event.getEntity();
LivingEntity x = event.getEntity();
x.setFireTicks(0);
//Remove bleed track
if(plugin.misc.bleedTracker.contains((LivingEntity)x))
plugin.misc.addToBleedRemovalQue((LivingEntity)x);
Skills.arrowRetrievalCheck(x, plugin);
/*
if(Config.getInstance().isMobSpawnTracked(x)){
Config.getInstance().removeMobSpawnTrack(x);
}
*/
if(x instanceof Player){
Player player = (Player)x;
Users.getProfile(player).setBleedTicks(0);
//Remove mob from mob spawner list
if(plugin.misc.mobSpawnerList.contains(x.getEntityId()))
{
plugin.misc.mobSpawnerList.remove((Object)x.getEntityId());
}
//Remove bleed track
if(plugin.misc.bleedTracker.contains(x))
plugin.misc.addToBleedRemovalQue(x);
Archery.arrowRetrievalCheck(x, plugin);
if(x instanceof Player)
Users.getProfile((Player)x).setBleedTicks(0);
}
@EventHandler
@@ -191,23 +158,168 @@ public class mcEntityListener implements Listener
SpawnReason reason = event.getSpawnReason();
if(reason == SpawnReason.SPAWNER && !LoadProperties.xpGainsMobSpawners)
{
plugin.misc.mobSpawnerList.add(event.getEntity());
}
plugin.misc.mobSpawnerList.add(event.getEntity().getEntityId());
}
public boolean isBow(ItemStack is){
if (is.getTypeId() == 261){
return true;
} else {
return false;
@EventHandler (priority = EventPriority.LOW)
public void onExplosionPrime(ExplosionPrimeEvent event)
{
if(event.getEntity() instanceof TNTPrimed)
{
Location location = event.getEntity().getLocation();
//Ugly code to make it recognize the location
location.setX(location.getBlockX()+1);
location.setY(location.getBlockY());
location.setZ(location.getBlockZ()+1);
if(plugin.misc.tntTracker.containsKey(location))
{
Player player = plugin.misc.tntTracker.get(location);
BlastMining.biggerBombs(player, event);
}
}
}
@EventHandler (priority = EventPriority.LOW)
public void onEnitityExplode(EntityExplodeEvent event)
{
if(event.getEntity() instanceof TNTPrimed)
{
Location location = event.getEntity().getLocation();
//Ugly code to make it recognize the location
location.setX(location.getBlockX()+1);
location.setY(location.getBlockY());
location.setZ(location.getBlockZ()+1);
if(plugin.misc.tntTracker.containsKey(location))
{
Player player = plugin.misc.tntTracker.get(location);
BlastMining.dropProcessing(player, event, plugin);
plugin.misc.tntTracker.remove(location);
}
}
}
public boolean isPlayer(Entity entity){
if (entity instanceof Player) {
return true;
} else{
return false;
}
}
@EventHandler (priority = EventPriority.LOW)
public void onFoodLevelChange(FoodLevelChangeEvent event)
{
if(LoadProperties.herbalismHungerBonus)
{
if(event.getEntity() instanceof Player)
{
Player player = (Player) event.getEntity();
PlayerProfile PP = Users.getProfile(player);
int currentFoodLevel = player.getFoodLevel();
int newFoodLevel = event.getFoodLevel();
//Some foods have 3 ranks
//Some foods have 5 ranks
//The number of ranks is based on how 'common' the item is
//We can adjust this quite easily if we find something is giving too much of a bonus
if(newFoodLevel > currentFoodLevel)
{
Material food = player.getItemInHand().getType();
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
int foodChange = newFoodLevel - currentFoodLevel;
switch(food)
{
case BREAD:
{
//BREAD RESTORES 2 1/2 HUNGER
//Restores 5 HUNGER @ 1000
if(herbLevel >= 200 && herbLevel < 400)
foodChange = foodChange + 1;
else if(herbLevel >= 400 && herbLevel < 600)
foodChange = foodChange + 2;
else if(herbLevel >= 600 && herbLevel < 800)
foodChange = foodChange + 3;
else if(herbLevel >= 800 && herbLevel < 1000)
foodChange = foodChange + 4;
else if(herbLevel >= 1000)
foodChange = foodChange + 5;
break;
}
case COOKIE:
{
//COOKIE RESTORES 1/2 HUNGER
//RESTORES 2 HUNGER @ 1000
if(herbLevel >= 200 && herbLevel < 600)
foodChange = foodChange + 1;
else if(herbLevel >= 600 && herbLevel < 1000)
foodChange = foodChange + 2;
else if(herbLevel >= 1000)
foodChange = foodChange + 3;
break;
}
case MELON:
{
//MELON RESTORES 1 HUNGER
//RESTORES 2 1/2 HUNGER @ 1000
if(herbLevel >= 200 && herbLevel < 600)
foodChange = foodChange + 1;
else if(herbLevel >= 600 && herbLevel < 1000)
foodChange = foodChange + 2;
else if(herbLevel >= 1000)
foodChange = foodChange + 3;
break;
}
case MUSHROOM_SOUP:
{
//MUSHROOM SOUP RESTORES 4 HUNGER
//RESTORES 6 1/2 HUNGER @ 1000
if(herbLevel >= 200 && herbLevel < 400)
foodChange = foodChange + 1;
else if(herbLevel >= 400 && herbLevel < 600)
foodChange = foodChange + 2;
else if(herbLevel >= 600 && herbLevel < 800)
foodChange = foodChange + 3;
else if(herbLevel >= 800 && herbLevel < 1000)
foodChange = foodChange + 4;
else if(herbLevel >= 1000)
foodChange = foodChange + 5;
break;
}
}
//Make sure we don't go over the max value
newFoodLevel = currentFoodLevel + foodChange;
if(newFoodLevel > 20)
event.setFoodLevel(20);
if(newFoodLevel <= 20)
event.setFoodLevel(newFoodLevel);
}
}
}
}
@EventHandler (priority = EventPriority.MONITOR)
public void onEntityTame(EntityTameEvent event)
{
Player player = (Player) event.getOwner();
if(mcPermissions.getInstance().taming(player))
{
PlayerProfile PP = Users.getProfile(player);
EntityType type = event.getEntityType();
int xp = 0;
switch(type)
{
case WOLF:
xp = LoadProperties.mtameWolf;
break;
/*
case OCELOT:
xp = LoadProperties.mtameOcelot;
break;
*/
}
PP.addXP(SkillType.TAMING, xp, player);
Skills.XpCheckSkill(SkillType.TAMING, player);
}
}
}

View File

@@ -21,21 +21,19 @@ import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.command.ColouredConsoleSender;
import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.Wolf;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerFishEvent;
@@ -45,8 +43,9 @@ import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Item;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
@@ -54,14 +53,14 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.commands.general.XprateCommand;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.runnables.RemoveProfileFromMemoryTask;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.spout.mmoHelper;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.skills.Fishing;
import com.gmail.nossr50.skills.Herbalism;
import com.gmail.nossr50.skills.Repair;
import com.gmail.nossr50.skills.Skills;
@@ -69,102 +68,94 @@ import com.gmail.nossr50.skills.Skills;
public class mcPlayerListener implements Listener
{
protected static final Logger log = Logger.getLogger("Minecraft"); //$NON-NLS-1$
public Location spawn = null;
private mcMMO plugin;
public mcPlayerListener(mcMMO instance)
{
plugin = instance;
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerWorldChangeEvent(PlayerChangedWorldEvent event)
{
Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player);
if(PP.getGodMode())
{
if(!mcPermissions.getInstance().mcgod(player))
{
PP.toggleGodMode();
player.sendMessage("[mcMMO] God Mode not permitted on this world (See Permissions)");
}
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerFish(PlayerFishEvent event)
{
if(mcPermissions.getInstance().fishing(event.getPlayer()))
Player player = event.getPlayer();
if(mcPermissions.getInstance().fishing(player))
{
if(event.getState() == State.CAUGHT_FISH)
State state = event.getState();
Entity caught = event.getCaught();
if(state== State.CAUGHT_FISH)
{
if(event.getCaught() instanceof CraftItem)
{
if(caught instanceof org.bukkit.entity.Item)
Fishing.processResults(event);
}
} else if (event.getState() == State.CAUGHT_ENTITY)
}
else if (state == State.CAUGHT_ENTITY)
{
if(Users.getProfile(event.getPlayer()).getSkillLevel(SkillType.FISHING) >= 150 && event.getCaught() instanceof LivingEntity)
{
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.FISHING);
if(skillLevel >= 150)
Fishing.shakeMob(event);
}
}
}
}
@EventHandler
@EventHandler(ignoreCancelled = true)
public void onPlayerPickupItem(PlayerPickupItemEvent event)
{
if(Users.getProfile(event.getPlayer()).getBerserkMode())
{
event.setCancelled(true);
}
}
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event)
{
Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player);
if(LoadProperties.enableMySpawn && mcPermissions.getInstance().mySpawn(player))
{
if(player != null && PP != null)
{
PP.setRespawnATS(System.currentTimeMillis());
Location mySpawn = PP.getMySpawn(player);
if(mySpawn != null)
{
{
event.setRespawnLocation(mySpawn);
}
}
}
}
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerLogin(PlayerLoginEvent event)
{
Users.addUser(event.getPlayer());
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerQuit(PlayerQuitEvent event)
{
/*
* GARBAGE COLLECTION
*/
//Discard the PlayerProfile object
Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player);
if(LoadProperties.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player))
SpoutStuff.playerHUDs.remove(player);
if(LoadProperties.spoutEnabled)
{
if(SpoutStuff.playerHUDs.containsKey(player))
SpoutStuff.playerHUDs.remove(player);
if(mmoHelper.containers.containsKey(player))
mmoHelper.containers.remove(player);
}
//Bleed it out
if(PP.getBleedTicks() > 0)
Combat.dealDamage(player, PP.getBleedTicks()*2);
Users.removeUser(event.getPlayer());
//Save PlayerData to MySQL/FlatFile on player quit
PP.save();
//Schedule PlayerProfile removal 2 minutes after quitting
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new RemoveProfileFromMemoryTask(player), 2400);
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
if(mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd)
{
player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), "/mcmmo"}));
player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), "mcmmo"}));
player.sendMessage(mcLocale.getString("mcPlayerListener.WIKI"));
}
//THIS IS VERY BAD WAY TO DO THINGS, NEED BETTER WAY
@@ -179,27 +170,16 @@ public class mcPlayerListener implements Listener
PlayerProfile PP = Users.getProfile(player);
Action action = event.getAction();
Block block = event.getClickedBlock();
ItemStack is = player.getItemInHand();
/*
* Ability checks
*/
if(action == Action.RIGHT_CLICK_BLOCK)
{
ItemStack is = player.getItemInHand();
if(LoadProperties.enableMySpawn && block != null && player != null)
{
if(block.getTypeId() == 26 && mcPermissions.getInstance().setMySpawn(player))
{
Location loc = player.getLocation();
if(mcPermissions.getInstance().setMySpawn(player)){
PP.setMySpawn(loc.getX(), loc.getY(), loc.getZ(), loc.getWorld().getName());
}
//player.sendMessage(mcLocale.getString("mcPlayerListener.MyspawnSet"));
}
}
Material mat = block.getType();
if(block != null && player != null && mcPermissions.getInstance().repair(player)
&& event.getClickedBlock().getTypeId() == 42 && (Repair.isTools(player.getItemInHand()) || Repair.isArmor(player.getItemInHand())))
if(block != null && mcPermissions.getInstance().repair(player) && block.getTypeId() == LoadProperties.anvilID && (Repair.isTools(is) || Repair.isArmor(is)))
{
Repair.repairCheck(player, is, event.getClickedBlock());
event.setCancelled(true);
@@ -208,54 +188,67 @@ public class mcPlayerListener implements Listener
if(LoadProperties.enableAbilities && m.abilityBlockCheck(block))
{
if(block != null && m.isHoe(player.getItemInHand()) && block.getTypeId() != 3 && block.getTypeId() != 2 && block.getTypeId() != 60){
Skills.hoeReadinessCheck(player);
}
Skills.abilityActivationCheck(player);
if(block != null && m.isHoe(is) && !mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL))
Skills.activationCheck(player, SkillType.HERBALISM);
Skills.activationCheck(player, SkillType.AXES);
Skills.activationCheck(player, SkillType.EXCAVATION);
Skills.activationCheck(player, SkillType.MINING);
Skills.activationCheck(player, SkillType.SWORDS);
Skills.activationCheck(player, SkillType.UNARMED);
Skills.activationCheck(player, SkillType.WOODCUTTING);
}
//GREEN THUMB
if(block != null && mcPermissions.getInstance().herbalism(player) && (block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT || block.getType() == Material.SMOOTH_BRICK) && player.getItemInHand().getType() == Material.SEEDS)
if(block != null && mcPermissions.getInstance().herbalism(player) && (mat.equals(Material.COBBLESTONE) || mat.equals(Material.DIRT) || mat.equals(Material.SMOOTH_BRICK)) && is.getType().equals(Material.SEEDS))
{
boolean pass = false;
if(Herbalism.hasSeeds(player))
{
Herbalism.removeSeeds(player);
int seeds = is.getAmount();
player.setItemInHand(new ItemStack(Material.SEEDS, seeds - 1));
if(block.getType() == Material.DIRT || block.getType() == Material.COBBLESTONE || block.getType() == Material.SMOOTH_BRICK)
if(Math.random() * 1500 <= PP.getSkillLevel(SkillType.HERBALISM) && m.blockBreakSimulate(block, player, false))
{
switch(mat)
{
if(Math.random() * 1500 <= PP.getSkillLevel(SkillType.HERBALISM) && m.blockBreakSimulate(block, player))
case COBBLESTONE:
if(LoadProperties.enableCobbleToMossy)
{
switch(block.getType())
{
case COBBLESTONE:
if(LoadProperties.enableCobbleToMossy)
{
block.setType(Material.MOSSY_COBBLESTONE);
pass = true;
}
break;
case DIRT:
pass = true;
block.setType(Material.GRASS);
break;
case SMOOTH_BRICK:
pass = true;
block.setData((byte)1);
break;
}
if(pass == false)
player.sendMessage(mcLocale.getString("mcPlayerListener.GreenThumbFail"));
block.setType(Material.MOSSY_COBBLESTONE);
pass = true;
}
break;
case DIRT:
if(LoadProperties.enableDirtToGrass)
{
block.setType(Material.GRASS);
pass = true;
}
break;
case SMOOTH_BRICK:
if(LoadProperties.enableSmoothToMossy)
{
pass = true;
block.setData((byte)1);
}
break;
}
if(pass == false)
player.sendMessage(mcLocale.getString("mcPlayerListener.GreenThumbFail"));
}
return;
}
}
if(LoadProperties.enableAbilities && action == Action.RIGHT_CLICK_AIR)
{
Skills.hoeReadinessCheck(player);
Skills.abilityActivationCheck(player);
Skills.activationCheck(player, SkillType.AXES);
Skills.activationCheck(player, SkillType.EXCAVATION);
Skills.activationCheck(player, SkillType.HERBALISM);
Skills.activationCheck(player, SkillType.MINING);
Skills.activationCheck(player, SkillType.SWORDS);
Skills.activationCheck(player, SkillType.UNARMED);
Skills.activationCheck(player, SkillType.WOODCUTTING);
}
/*
@@ -263,15 +256,12 @@ public class mcPlayerListener implements Listener
*/
if(action == Action.RIGHT_CLICK_AIR)
Item.itemchecks(player, plugin);
if(action == Action.RIGHT_CLICK_BLOCK)
{
if(m.abilityBlockCheck(event.getClickedBlock()))
Item.itemchecks(player, plugin);
}
if(action == Action.RIGHT_CLICK_BLOCK && m.abilityBlockCheck(block))
Item.itemchecks(player, plugin);
if(player.isSneaking() && mcPermissions.getInstance().taming(player) && (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK))
{
if(player.getItemInHand().getType() == Material.BONE && player.getItemInHand().getAmount() > 9)
if(is.getType().equals(Material.BONE) && is.getAmount() >= LoadProperties.bonesConsumedByCOTW)
{
for(Entity x : player.getNearbyEntities(40, 40, 40))
{
@@ -281,33 +271,49 @@ public class mcPlayerListener implements Listener
return;
}
}
World world = player.getWorld();
world.spawnCreature(player.getLocation(), CreatureType.WOLF);
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x != null && x.getAmount() > LoadProperties.bonesConsumedByCOTW-1 && x.getType() == Material.BONE){
if(x.getAmount() >= LoadProperties.bonesConsumedByCOTW)
{
x.setAmount(x.getAmount() - LoadProperties.bonesConsumedByCOTW);
player.getInventory().setContents(inventory);
player.updateInventory();
break;
} else {
x.setAmount(0);
x.setTypeId(0);
player.getInventory().setContents(inventory);
player.updateInventory();
break;
}
}
}
World world = player.getWorld();
world.spawnCreature(player.getLocation(), EntityType.WOLF);
int bones = is.getAmount();
bones = bones - LoadProperties.bonesConsumedByCOTW;
player.setItemInHand(new ItemStack(Material.BONE, bones));
player.sendMessage(mcLocale.getString("m.TamingSummon"));
}
}
//BLAST MINING
if((action == Action.RIGHT_CLICK_BLOCK || action == Action.RIGHT_CLICK_AIR) && is.getTypeId() == LoadProperties.detonatorID)
{
Block b = player.getTargetBlock(null, 100);
if(b.getType().equals(Material.TNT) && mcPermissions.getInstance().blastMining(player) && m.blockBreakSimulate(b, player, true) && Users.getProfile(player).getSkillLevel(SkillType.MINING) >= 125)
{
AbilityType ability = AbilityType.BLAST_MINING;
//Check cooldown
if(!Skills.cooldownOver(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()))
{
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()) + "s)");
return;
}
//Send message to nearby players
for(Player y : player.getWorld().getPlayers())
{
if(y != player && m.isNear(player.getLocation(), y.getLocation(), 10))
y.sendMessage(ability.getAbilityPlayer(player));
}
player.sendMessage(ChatColor.GRAY+"**BOOM**");
TNTPrimed tnt = player.getWorld().spawn(b.getLocation(), TNTPrimed.class);
b.setType(Material.AIR);
tnt.setFuseTicks(0);
PP.setSkillDATS(ability, System.currentTimeMillis()); //Save DATS for Blast Mining
PP.setBlastMiningInformed(false);
}
}
}
@EventHandler(priority = EventPriority.LOW)
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerChat(PlayerChatEvent event)
{
Player player = event.getPlayer();
@@ -322,11 +328,7 @@ public class mcPlayerListener implements Listener
if(Party.getInstance().inSameParty(player, x))
x.sendMessage(format);
}
if(Bukkit.getServer() instanceof ColouredConsoleSender)
{
ColouredConsoleSender ccs = (ColouredConsoleSender) Bukkit.getServer();
ccs.sendMessage(ChatColor.GREEN+"[P]"+format); //Colors, woot!
}
log.log(Level.INFO, "[P](" + PP.getParty() + ")<" + name + ">" + event.getMessage());
} else if (PP.getAdminChatMode()) {
event.setCancelled(true);
String name = (LoadProperties.aDisplayNames) ? player.getDisplayName() : player.getName();
@@ -336,16 +338,10 @@ public class mcPlayerListener implements Listener
if(x.isOp() || mcPermissions.getInstance().adminChat(x))
x.sendMessage(format);
}
if(Bukkit.getServer() instanceof ColouredConsoleSender)
{
ColouredConsoleSender ccs = (ColouredConsoleSender) Bukkit.getServer();
ccs.sendMessage(ChatColor.AQUA+"[A]"+format); //Colors, woot!
} else {
log.log(Level.INFO, "[A]"+format);
}
log.log(Level.INFO, "[A]<" + name + ">" + event.getMessage());
}
}
// Dynamically aliasing commands need to be re-done.
// For now, using a command with an alias will send both the original command, and the mcMMO command
@EventHandler(priority = EventPriority.LOWEST)

View File

@@ -0,0 +1,40 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import com.gmail.nossr50.events.McMMOPlayerXpGainEvent;
/**
* Listener for listening to our own events, only really useful for catching errors
*/
public class mcSelfListener implements Listener {
@EventHandler
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
int xp = event.getXpGained();
if(xp < 0) {
try {
throw new Exception("Gained negative XP!");
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
}

View File

@@ -26,12 +26,15 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.*;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.FakeBlockBreakEvent;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.events.FakeBlockBreakEvent;
import com.gmail.nossr50.events.McMMOItemSpawnEvent;
import com.gmail.nossr50.skills.Repair;
public class m
{
@@ -53,25 +56,19 @@ public class m
public static int getInt(String string)
{
if(isInt(string))
{
return Integer.parseInt(string);
}
else
{
return 0;
}
}
public static Double getDouble(String string)
public static boolean isInvincible(LivingEntity le, EntityDamageEvent event)
{
if(isDouble(string))
{
return Double.parseDouble(string);
}
else
{
return (double) 0;
}
//So apparently if you do more damage to a LivingEntity than its last damage int you bypass the invincibility
//So yeah, this is for that
if(le.getNoDamageTicks() > le.getMaximumNoDamageTicks() / 2.0F && event.getDamage() <= le.getLastDamage())
return true;
else
return false;
}
public static boolean isDouble(String string)
@@ -86,16 +83,51 @@ public class m
return true;
}
public static boolean shouldBeWatched(Block block)
/**
* Checks to see if a block type awards XP.
*
* @param material Block type to check
* @return true if the block type awards XP, false otherwise
*/
public static boolean shouldBeWatched(Material material)
{
int id = block.getTypeId();
return shouldBeWatched(id);
}
public static boolean shouldBeWatched(int id) {
return id == 2 || id == 3 || id == 12 || id == 13 || id == 82 || //Excavation
id == 1 || id == 14 || id == 15 || id == 16 || id == 21 || id == 24 || id == 49 || id == 56 || id == 73 || id == 74 || id == 87 || id == 89 || id == 112 || id == 121 || id == 48 || id == 98 || //Mining
id == 17 || id == 37 || id == 38 || id == 39 || id == 40 || id == 81 || id == 83 || id == 86 || id == 91 || id == 103 || id == 106 || id == 111 || //Woodcutting & Herbalism
id == 42; //Anvil
switch(material){
case BROWN_MUSHROOM:
case CACTUS:
case CLAY:
case COAL_ORE:
case DIAMOND_ORE:
case DIRT:
case ENDER_STONE:
case GLOWING_REDSTONE_ORE:
case GLOWSTONE:
case GOLD_ORE:
case GRASS:
case GRAVEL:
case IRON_ORE:
case JACK_O_LANTERN:
case LAPIS_ORE:
case LOG:
case MELON_BLOCK:
case MOSSY_COBBLESTONE:
case MYCEL:
case NETHERRACK:
case OBSIDIAN:
case PUMPKIN:
case RED_MUSHROOM:
case RED_ROSE:
case REDSTONE_ORE:
case SAND:
case SANDSTONE:
case SOUL_SAND:
case STONE:
case SUGAR_CANE_BLOCK:
case VINE:
case WATER_LILY:
case YELLOW_FLOWER:
return true;
}
return false;
}
public static int getPowerLevel(Player player)
@@ -129,8 +161,15 @@ public class m
return x;
}
public static boolean blockBreakSimulate(Block block, Player player)
public static boolean blockBreakSimulate(Block block, Player player, Boolean shouldArmSwing)
{
//Support for NoCheat
if(shouldArmSwing)
{
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
}
FakeBlockBreakEvent event = new FakeBlockBreakEvent(block, player);
if(block != null && player != null){
Bukkit.getServer().getPluginManager().callEvent(event);
@@ -144,112 +183,66 @@ public class m
return false; //Return false if something went wrong
}
}
public static void damageTool(Player player, short damage)
{
if(player.getItemInHand().getTypeId() == 0)
return;
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + damage));
if(player.getItemInHand().getDurability() >= getMaxDurability(getTier(player), player.getItemInHand()))
{
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory)
{
if(x != null && x.getTypeId() == player.getItemInHand().getTypeId() && x.getDurability() == player.getItemInHand().getDurability()){
x.setTypeId(0);
x.setAmount(0);
player.getInventory().setContents(inventory);
return;
}
}
}
}
public static Integer getTier(Player player)
{
int i = player.getItemInHand().getTypeId();
if(i == 268 || i == 269 || i == 270 || i == 271 || i == 290){
return 1; //WOOD
} else if (i == 272 || i == 273 || i == 274 || i == 275 || i == 291){
return 2; //STONE
} else if (i == 256 || i == 257 || i == 258 || i == 267 || i == 292){
return 3; //IRON
} else if (i == 283 || i == 284 || i == 285 || i == 286 || i == 294){
return 1; //GOLD
} else if (i == 276 || i == 277 || i == 278 || i == 279 || i == 293){
return 4; //DIAMOND
} else {
return 1; //UNRECOGNIZED
}
ItemStack is = player.getItemInHand();
if(Repair.isWoodTools(is))
return 1;
if(Repair.isStoneTools(is))
return 2;
if(Repair.isIronTools(is))
return 3;
if(Repair.isGoldTools(is))
return 1;
if(Repair.isDiamondTools(is))
return 4;
return 1;
}
public static Integer getMaxDurability(Integer tier, ItemStack item)
{
int id = item.getTypeId();
if(tier == 1){
if((id == 283 || id == 284 || id == 285 || id == 286 || id == 294)){
return 33; //GOLD
} else {
return 60; //WOOD
}
} else if (tier == 2){
return 132;
} else if (tier == 3){
return 251;
} else if (tier == 4){
return 1562;
} else {
return 0;
}
}
public static double getDistance(Location loca, Location locb)
{
return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2)
+ Math.pow(loca.getZ() - locb.getZ(), 2));
}
public static boolean abilityBlockCheck(Block block)
{
int i = block.getTypeId();
if(i == 107 ||i == 117 || i == 116 || i == 96 || i == 68 || i == 355 || i == 26 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){
return false;
} else {
public static boolean isNear(Location first, Location second, int maxDistance) {
double relX = first.getX() - second.getX();
double relY = first.getY() - second.getY();
double relZ = first.getZ() - second.getZ();
double dist = relX * relX + relY * relY + relZ * relZ;
if (dist < maxDistance * maxDistance)
return true;
}
}
public static boolean isBlockAround(Location loc, Integer radius, Integer typeid)
{
Block blockx = loc.getBlock();
int ox = blockx.getX();
int oy = blockx.getY();
int oz = blockx.getZ();
for (int cx = -radius; cx <= radius; cx++) {
for (int cy = -radius; cy <= radius; cy++) {
for (int cz = -radius; cz <= radius; cz++) {
Block block = loc.getWorld().getBlockAt(ox + cx, oy + cy, oz + cz);
if (block.getTypeId() == typeid) {
return true;
}
}
}
}
return false;
}
public static Integer calculateHealth(Integer health, Integer newvalue){
if((health + newvalue) > 20){
return 20;
} else {
return health+newvalue;
}
}
public Integer calculateMinusHealth(Integer health, Integer newvalue){
if((health - newvalue) < 1){
return 0;
} else {
return health-newvalue;
public static boolean abilityBlockCheck(Block block)
{
switch(block.getType()){
case BED_BLOCK:
case BREWING_STAND:
case BURNING_FURNACE:
case CAKE_BLOCK:
case CHEST:
case DISPENSER:
case ENCHANTMENT_TABLE:
case FENCE_GATE:
case FURNACE:
case IRON_DOOR_BLOCK:
case JUKEBOX:
case LEVER:
case NOTE_BLOCK:
case STONE_BUTTON:
case TRAP_DOOR:
case WALL_SIGN:
case WOODEN_DOOR:
case WORKBENCH:
return false;
}
if(block.getTypeId() == LoadProperties.anvilID)
return false;
return true;
}
public static boolean isInt(String string)
{
try
@@ -262,14 +255,25 @@ public class m
}
return true;
}
public static void mcDropItem(Location location, int id)
public static void mcDropItems(Location location, ItemStack is, int quantity)
{
if(location == null) return;
Material mat = Material.getMaterial(id);
ItemStack item = new ItemStack(mat, 1, (byte) 0, (byte) 0);
mcDropItem(location, item);
for(int i = 0; i < quantity; i++)
mcDropItem(location, is);
}
public static void mcRandomDropItem(Location location, ItemStack is, int chance)
{
if(Math.random() * 100 < chance)
mcDropItem(location, is);
}
public static void mcRandomDropItems(Location location, ItemStack is, int chance, int quantity)
{
for(int i = 0; i < quantity; i++)
mcRandomDropItem(location, is, chance);
}
public static void mcDropItem(Location location, ItemStack itemStack) {
// We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
@@ -281,38 +285,132 @@ public class m
public static boolean isSwords(ItemStack is)
{
int id = is.getTypeId();
return id == 268 || id == 267 || id == 272 || id == 283 || id == 276;
switch(is.getType()){
case DIAMOND_SWORD:
case GOLD_SWORD:
case IRON_SWORD:
case STONE_SWORD:
case WOOD_SWORD:
return true;
}
return false;
}
public static boolean isHoe(ItemStack is)
{
int id = is.getTypeId();
return id == 290 || id == 291 || id == 292 || id == 293 || id == 294;
switch(is.getType()){
case DIAMOND_HOE:
case GOLD_HOE:
case IRON_HOE:
case STONE_HOE:
case WOOD_HOE:
return true;
}
return false;
}
public static boolean isShovel(ItemStack is)
{
int id = is.getTypeId();
return id == 269 || id == 273 || id == 277 || id == 284 || id == 256;
switch(is.getType()){
case DIAMOND_SPADE:
case GOLD_SPADE:
case IRON_SPADE:
case STONE_SPADE:
case WOOD_SPADE:
return true;
}
return false;
}
public static boolean isAxes(ItemStack is)
{
int id = is.getTypeId();
return id == 271 || id == 258 || id == 286 || id == 279 || id == 275;
switch(is.getType()){
case DIAMOND_AXE:
case GOLD_AXE:
case IRON_AXE:
case STONE_AXE:
case WOOD_AXE:
return true;
}
return false;
}
public static boolean isMiningPick(ItemStack is)
{
int id = is.getTypeId();
return id == 270 || id == 274 || id == 285 || id == 257 || id == 278;
switch(is.getType()){
case DIAMOND_PICKAXE:
case GOLD_PICKAXE:
case IRON_PICKAXE:
case STONE_PICKAXE:
case WOOD_PICKAXE:
return true;
}
return false;
}
// public boolean isGold(ItemStack is)
// {
// int id = is.getTypeId();
// return id == 283 || id == 284 || id == 285 || id == 286 || id == 294 || id == 314 || id == 315 || id == 316 || id == 317;
// }
public static boolean isHelmet(ItemStack is)
{
switch(is.getType()){
case DIAMOND_HELMET:
case GOLD_HELMET:
case IRON_HELMET:
case LEATHER_HELMET:
return true;
}
return false;
}
public static boolean isChestplate(ItemStack is)
{
switch(is.getType()){
case DIAMOND_CHESTPLATE:
case GOLD_CHESTPLATE:
case IRON_CHESTPLATE:
case LEATHER_CHESTPLATE:
return true;
}
return false;
}
public static boolean isPants(ItemStack is)
{
switch(is.getType()){
case DIAMOND_LEGGINGS:
case GOLD_LEGGINGS:
case IRON_LEGGINGS:
case LEATHER_LEGGINGS:
return true;
}
return false;
}
public static boolean isBoots(ItemStack is)
{
switch(is.getType()){
case DIAMOND_BOOTS:
case GOLD_BOOTS:
case IRON_BOOTS:
case LEATHER_BOOTS:
return true;
}
return false;
}
public static boolean isOre(Block block)
{
switch (block.getType()) {
case COAL_ORE:
case DIAMOND_ORE:
case GLOWING_REDSTONE_ORE:
case GOLD_ORE:
case IRON_ORE:
case LAPIS_ORE:
case REDSTONE_ORE:
return true;
}
return false;
}
public static void convertToMySQL()
{
if(!LoadProperties.useMySQL)
@@ -405,8 +503,6 @@ public class m
+ LoadProperties.MySQLtablePrefix
+ "users SET lastlogin = " + 0
+ " WHERE id = " + id);
//if(getDouble(x) > 0 && getDouble(y) > 0 && getDouble(z) > 0)
//mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"spawn SET world = '" + myspawnworld + "', x = " +getDouble(x)+", y = "+getDouble(y)+", z = "+getDouble(z)+" WHERE user_id = "+id);
mcMMO.database.Write("UPDATE "
+ LoadProperties.MySQLtablePrefix
+ "skills SET " + " taming = taming+"
@@ -456,9 +552,6 @@ public class m
+ LoadProperties.MySQLtablePrefix
+ "users WHERE user = '"
+ playerName + "'");
mcMMO.database.Write("INSERT INTO "
+ LoadProperties.MySQLtablePrefix
+ "spawn (user_id) VALUES (" + id + ")");
mcMMO.database.Write("INSERT INTO "
+ LoadProperties.MySQLtablePrefix
+ "skills (user_id) VALUES (" + id + ")");
@@ -475,10 +568,6 @@ public class m
+ LoadProperties.MySQLtablePrefix
+ "users SET party = '" + party
+ "' WHERE id = " + id);
/*
if(getDouble(x) > 0 && getDouble(y) > 0 && getDouble(z) > 0)
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"spawn SET world = '" + myspawnworld + "', x = " +getDouble(x)+", y = "+getDouble(y)+", z = "+getDouble(z)+" WHERE user_id = "+id);
*/
mcMMO.database.Write("UPDATE "
+ LoadProperties.MySQLtablePrefix
+ "skills SET " + " taming = "
@@ -525,4 +614,4 @@ public class m
}
}, 1);
}
}
}

View File

@@ -1,18 +1,19 @@
/*
This file is part of mcMMO.
Copyright (C) 2012 Matt 'The Yeti' Burnett & mcMMO Development
Copyright (C) 2010-2011 'nossr50'
mcMMO is free software: you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50;
@@ -32,7 +33,6 @@ import com.gmail.nossr50.listeners.mcPlayerListener;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.skills.*;
import com.nijikokun.bukkit.Permissions.Permissions;
import org.bukkit.Bukkit;
@@ -45,16 +45,20 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.block.Block;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.FileManager;
@@ -62,17 +66,6 @@ import org.getspout.spoutapi.player.FileManager;
public class mcMMO extends JavaPlugin
{
/*
* I never expected mcMMO to get so popular!
* Thanks for all the support for the mod
* Thanks to the people who have worked on the code
* Thanks to the donators who helped me out financially
* Thanks to the server admins who use my mod :)
*
* This mod is open source, and its going to stay that way >:3
*
* Donate via paypal to nossr50@gmail.com (A million thanks to anyone that does!)
*/
public static String maindirectory = "plugins" + File.separator + "mcMMO";
File file = new File(maindirectory + File.separator + "config.yml");
@@ -83,12 +76,14 @@ public class mcMMO extends JavaPlugin
private final mcBlockListener blockListener = new mcBlockListener(this);
private final mcEntityListener entityListener = new mcEntityListener(this);
public static mcPermissions permissionHandler = new mcPermissions();
private Permissions permissions;
//Queue for block data change for R2+ fix
public ArrayDeque<Block> changeQueue = new ArrayDeque<Block>();
public ArrayDeque<Block> fastChangeQueue = new ArrayDeque<Block>();
private Runnable mcMMO_Timer = new mcTimer(this); //BLEED AND REGENERATION
private Runnable ChangeDataValueTimer = new ChangeDataValueTimer(this); //R2 block place workaround
//private Timer mcMMO_SpellTimer = new Timer(true);
private Runnable mcMMO_SaveTimer = new mcSaveTimer(this); //Periodic saving of Player Data
private Runnable ChangeDataValueTimer = new ChangeDataValueTimer(changeQueue); //R2 block place workaround
private Runnable FastChangeDataValueTimer = new ChangeDataValueTimer(fastChangeQueue);
//Alias - Command
public HashMap<String, String> aliasMap = new HashMap<String, String>();
@@ -96,18 +91,16 @@ public class mcMMO extends JavaPlugin
public static Database database = null;
public Misc misc = new Misc(this);
public static ArrayList<String> gotCake;
//Config file stuff
LoadProperties config;
LoadTreasures config2;
//Jar stuff
public static File mcmmo;
//Queue for block data change for R2+ fix
public ArrayDeque<Block> changeQueue = new ArrayDeque<Block>();
public void onEnable()
{
final Plugin thisPlugin = this;
mcmmo = this.getFile();
new File(maindirectory).mkdir();
@@ -126,40 +119,13 @@ public class mcMMO extends JavaPlugin
//Catch all for versions not matching and no specific code being needed
else if(!vnum.equalsIgnoreCase(this.getDescription().getVersion())) updateFrom(-1);
}
File cakeFile = new File(getDataFolder().getAbsolutePath() + File.separator + "cake");
if (!cakeFile.exists()) {
try {
cakeFile.createNewFile();
}
catch (IOException ex) {
System.out.println(ex);
}
}
gotCake = new ArrayList<String>();
try {
gotCake.clear();
BufferedReader reader = new BufferedReader(new FileReader(getDataFolder().getAbsolutePath() + File.separator + "players"));
String line = reader.readLine();
while(line != null) {
gotCake.add(line);
line = reader.readLine();
}
reader.close();
}
catch (Exception ex) {
System.out.println(ex);
}
mcPermissions.initialize(getServer());
this.config = new LoadProperties(this);
this.config.load();
this.config2 = new LoadTreasures(this);
this.config2.load();
Party.getInstance().loadParties();
new Party(this);
@@ -170,7 +136,7 @@ public class mcMMO extends JavaPlugin
*/
PluginManager pm = getServer().getPluginManager();
if(pm.getPlugin("Spout") != null)
LoadProperties.spoutEnabled = true;
else
@@ -182,7 +148,6 @@ public class mcMMO extends JavaPlugin
pm.registerEvents(entityListener, this);
PluginDescriptionFile pdfFile = this.getDescription();
mcPermissions.initialize(getServer());
if(LoadProperties.useMySQL)
{
@@ -194,9 +159,13 @@ public class mcMMO extends JavaPlugin
for(Player player : getServer().getOnlinePlayers()){Users.addUser(player);} //In case of reload add all users back into PlayerProfile
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
//Periodic save timer (Saves every 10 minutes)
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, mcMMO_SaveTimer, 0, LoadProperties.saveInterval * 1200);
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, mcMMO_Timer, 0, 20);
//R2+ block place fix
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, ChangeDataValueTimer, 0, 10);
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, FastChangeDataValueTimer, 0, 1);
registerCommands();
@@ -209,17 +178,23 @@ public class mcMMO extends JavaPlugin
FileManager FM = SpoutManager.getFileManager();
FM.addToPreLoginCache(this, SpoutStuff.getFiles());
/*
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this,
new Runnable() {
@Override
public void run() {
mmoHelper.updateAll();
}
}, 20, 20);
*/
}
if(LoadProperties.statsTracking) {
//Plugin Metrics running in a new thread
new Thread(new Runnable() {
public void run() {
try {
// create a new metrics object
Metrics metrics = new Metrics();
// 'this' in this context is the Plugin object
metrics.beginMeasuringPlugin(thisPlugin);
} catch (IOException e) {
// Failed to submit the stats :-(
}
}
}).start();
}
}
@@ -281,24 +256,18 @@ public class mcMMO extends JavaPlugin
PlayerProfile PP = Users.getProfile(player);
return PP.inParty();
}
public Permissions getPermissions() {
return permissions;
}
public void onDisable() {
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(getDataFolder().getAbsolutePath() + File.separator + "cake"));
for (String player : gotCake) {
writer.write(player);
writer.newLine();
}
writer.close();
}
catch (Exception ex) {
System.out.println(ex);
}
Bukkit.getServer().getScheduler().cancelTasks(this);
System.out.println("mcMMO was disabled.");
public void onDisable()
{
//Make sure to save player information if the server shuts down
for(Player x : Bukkit.getServer().getOnlinePlayers())
{
Users.getProfile(x).save();
}
Bukkit.getServer().getScheduler().cancelTasks(this); //This removes our tasks
System.out.println("mcMMO was disabled."); //How informative!
}
private void registerCommands() {
@@ -334,6 +303,7 @@ public class mcMMO extends JavaPlugin
getCommand("woodcutting").setExecutor(new WoodcuttingCommand());
//Mc* commands
if(LoadProperties.mcremoveEnable) getCommand("mcremove").setExecutor(new McremoveCommand());
if(LoadProperties.mcabilityEnable) getCommand("mcability").setExecutor(new McabilityCommand());
if(LoadProperties.mccEnable) getCommand("mcc").setExecutor(new MccCommand());
if(LoadProperties.mcgodEnable) getCommand("mcgod").setExecutor(new McgodCommand());
@@ -351,12 +321,11 @@ public class mcMMO extends JavaPlugin
//Other commands
if(LoadProperties.addxpEnable) getCommand("addxp").setExecutor(new AddxpCommand(this));
if(LoadProperties.clearmyspawnEnable) getCommand("clearmyspawn").setExecutor(new ClearmyspawnCommand());
if(LoadProperties.addlevelsEnable) getCommand("addlevels").setExecutor(new AddlevelsCommand(this));
if(LoadProperties.mmoeditEnable) getCommand("mmoedit").setExecutor(new MmoeditCommand(this));
getCommand("mmoupdate").setExecutor(new MmoupdateCommand());
if(LoadProperties.myspawnEnable) getCommand("myspawn").setExecutor(new MyspawnCommand());
if(LoadProperties.statsEnable) getCommand("stats").setExecutor(new StatsCommand());
if(LoadProperties.whoisEnable) getCommand("whois").setExecutor(new WhoisCommand(this));
if(LoadProperties.mcstatsEnable) getCommand("mcstats").setExecutor(new McstatsCommand());
if(LoadProperties.inspectEnable) getCommand("inspect").setExecutor(new InspectCommand(this));
if(LoadProperties.xprateEnable) getCommand("xprate").setExecutor(new XprateCommand());
//Spout commands
@@ -418,4 +387,43 @@ public class mcMMO extends JavaPlugin
return new String(buffer);
}
/*
* Boilerplate Custom Config Stuff
*/
private FileConfiguration treasuresConfig = null;
private File treasuresConfigFile = null;
public void reloadTreasuresConfig() {
if (treasuresConfigFile == null) {
treasuresConfigFile = new File(getDataFolder(), "treasures.yml");
}
treasuresConfig = YamlConfiguration.loadConfiguration(treasuresConfigFile);
// Look for defaults in the jar
InputStream defConfigStream = getResource("treasures.yml");
if (defConfigStream != null) {
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
treasuresConfig.setDefaults(defConfig);
}
}
public FileConfiguration getTreasuresConfig() {
if (treasuresConfig == null) {
reloadTreasuresConfig();
}
return treasuresConfig;
}
public void saveTreasuresConfig() {
if (treasuresConfig == null || treasuresConfigFile == null) {
return;
}
try {
treasuresConfig.save(treasuresConfigFile);
} catch (IOException ex) {
Logger.getLogger(JavaPlugin.class.getName()).log(Level.SEVERE, "Could not save config to " + treasuresConfigFile, ex);
}
}
}

View File

@@ -16,337 +16,121 @@
*/
package com.gmail.nossr50;
import java.util.logging.Logger;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import ru.tehkode.permissions.PermissionManager;
import ru.tehkode.permissions.bukkit.PermissionsEx;
import com.nijiko.permissions.PermissionHandler;
import com.nijikokun.bukkit.Permissions.Permissions;
public class mcPermissions
{
private static volatile mcPermissions instance;
private enum PermissionType {
PEX, PERMISSIONS, BUKKIT
}
private static PermissionType permissionType;
private static Object PHandle;
public static boolean permissionsEnabled = false;
public static void initialize(Server server)
{
Logger log = Logger.getLogger("Minecraft");
if(permissionsEnabled && permissionType != PermissionType.PERMISSIONS) return;
Plugin PEXtest = server.getPluginManager().getPlugin("PermissionsEx");
Plugin test = server.getPluginManager().getPlugin("Permissions");
if(PEXtest != null) {
PHandle = (PermissionManager) PermissionsEx.getPermissionManager();
permissionType = PermissionType.PEX;
permissionsEnabled = true;
log.info("[mcMMO] PermissionsEx found, using PermissionsEx.");
} else if(test != null) {
PHandle = (PermissionHandler) ((Permissions) test).getHandler();
permissionType = PermissionType.PERMISSIONS;
permissionsEnabled = true;
log.info("[mcMMO] Permissions version "+test.getDescription().getVersion()+" found, using Permissions.");
} else {
permissionType = PermissionType.BUKKIT;
permissionsEnabled = true;
log.info("[mcMMO] Using Bukkit Permissions.");
}
public boolean permission(Player player, String perm) {
return player.hasPermission(perm);
}
public static boolean getEnabled()
{
return permissionsEnabled;
}
public static boolean permission(Player player, String permission)
{
if(!permissionsEnabled) return player.isOp();
switch(permissionType) {
case PEX:
return ((PermissionManager) PHandle).has(player, permission);
case PERMISSIONS:
return ((PermissionHandler) PHandle).has(player, permission);
case BUKKIT:
return player.hasPermission(permission);
default:
return true;
}
}
public boolean admin(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.admin");
} else {
return true;
}
return player.hasPermission("mcmmo.admin");
}
public boolean mcrefresh(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.tools.mcrefresh");
} else {
return true;
}
return player.hasPermission("mcmmo.tools.mcrefresh");
}
public boolean mcremove(Player player) {
return player.hasPermission("mcmmo.tools.mcremove");
}
public boolean mmoedit(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.tools.mmoedit");
} else {
return true;
}
return player.hasPermission("mcmmo.tools.mmoedit");
}
public boolean herbalismAbility(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.herbalism");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.herbalism");
}
public boolean excavationAbility(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.excavation");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.excavation");
}
public boolean unarmedAbility(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.unarmed");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.unarmed");
}
public boolean chimaeraWing(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.item.chimaerawing");
} else {
return true;
}
return player.hasPermission("mcmmo.item.chimaerawing");
}
public boolean miningAbility(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.mining");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.mining");
}
public boolean axesAbility(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.axes");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.axes");
}
public boolean swordsAbility(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.swords");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.swords");
}
public boolean woodCuttingAbility(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.woodcutting");
} else {
return true;
}
return player.hasPermission("mcmmo.ability.woodcutting");
}
public boolean mcgod(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.tools.mcgod");
} else {
return true;
}
}
public boolean regeneration(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.regeneration");
} else {
return true;
}
return player.hasPermission("mcmmo.tools.mcgod");
}
public boolean motd(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.motd");
} else {
return true;
}
return player.hasPermission("mcmmo.motd");
}
public boolean mcAbility(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.commands.ability");
} else {
return true;
}
}
public boolean mySpawn(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.commands.myspawn");
} else {
return true;
}
}
public boolean setMySpawn(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.commands.setmyspawn");
} else {
return true;
}
return player.hasPermission("mcmmo.commands.ability");
}
public boolean partyChat(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.chat.partychat");
} else {
return true;
}
return player.hasPermission("mcmmo.chat.partychat");
}
public boolean partyLock(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.chat.partylock");
} else {
return true;
}
return player.hasPermission("mcmmo.chat.partylock");
}
public boolean partyTeleport(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.commands.ptp");
} else {
return true;
}
return player.hasPermission("mcmmo.commands.ptp");
}
public boolean whois(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.commands.whois");
} else {
return true;
}
public boolean inspect(Player player) {
return player.hasPermission("mcmmo.commands.inspect");
}
public boolean party(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.commands.party");
} else {
return true;
}
return player.hasPermission("mcmmo.commands.party");
}
public boolean adminChat(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.chat.adminchat");
} else {
return true;
}
return player.hasPermission("mcmmo.chat.adminchat");
}
public static mcPermissions getInstance() {
if (instance == null) {
instance = new mcPermissions();
instance = new mcPermissions();
}
return instance;
}
}
public boolean taming(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.taming");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.taming");
}
public boolean mining(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.mining");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.mining");
}
public boolean blastMining(Player player) {
return player.hasPermission("mcmmo.skills.blastmining");
}
public boolean fishing(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.fishing");
} else {
return true;
}
}
public boolean alchemy(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.alchemy");
} else {
return true;
}
}
public boolean enchanting(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.enchanting");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.fishing");
}
public boolean woodcutting(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.woodcutting");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.woodcutting");
}
public boolean repair(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.repair");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.repair");
}
public boolean unarmed(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.unarmed");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.unarmed");
}
public boolean archery(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.archery");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.archery");
}
public boolean herbalism(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.herbalism");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.herbalism");
}
public boolean excavation(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.excavation");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.excavation");
}
public boolean swords(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.swords");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.swords");
}
public boolean axes(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.axes");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.axes");
}
public boolean acrobatics(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.acrobatics");
} else {
return true;
}
return player.hasPermission("mcmmo.skills.acrobatics");
}
}

View File

@@ -32,10 +32,8 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.spout.util.ArrayListString;
public class Party
@@ -118,7 +116,6 @@ public class Party
public void informPartyMembers(Player player, Player[] players)
{
int x = 0;
for(Player p : players)
{
if(player != null && p != null)
@@ -126,7 +123,6 @@ public class Party
if(inSameParty(player, p) && !p.getName().equals(player.getName()))
{
p.sendMessage(mcLocale.getString("Party.InformedOnJoin", new Object[] {player.getName()}));
x++;
}
}
}
@@ -148,22 +144,6 @@ public class Party
}
return players;
}
public ArrayListString getPartyMembersByName(Player player)
{
ArrayListString players = new ArrayListString();
for(Player p : Bukkit.getServer().getOnlinePlayers())
{
if(p.isOnline())
{
if(inSameParty(player, p))
{
players.add(p.getName());
}
}
}
return players;
}
public void informPartyMembersOwnerChange(String newOwner) {
Player newOwnerPlayer = plugin.getServer().getPlayer(newOwner);
@@ -171,14 +151,12 @@ public class Party
}
public void informPartyMembersOwnerChange(Player newOwner, Player[] players) {
int x = 0;
for(Player p : players){
if(newOwner != null && p != null){
if(inSameParty(newOwner, p))
{
//TODO: Needs more locale.
p.sendMessage(newOwner.getName()+" is the new party owner.");
x++;
}
}
}
@@ -191,13 +169,11 @@ public class Party
public void informPartyMembersQuit(Player player, Player[] players)
{
int x = 0;
for(Player p : players){
if(player != null && p != null){
if(inSameParty(player, p) && !p.getName().equals(player.getName()))
{
p.sendMessage(mcLocale.getString("Party.InformedOnQuit", new Object[] {player.getName()}));
x++;
}
}
}

View File

@@ -16,30 +16,30 @@
*/
package com.gmail.nossr50.runnables;
import org.bukkit.block.Block;
import java.util.ArrayDeque;
import com.gmail.nossr50.mcMMO;
import org.bukkit.block.Block;
/*
* This file was created for a breakage introduced in 1.1-R2
* It should be removed afterwards if the breakage is removed.
*/
public class ChangeDataValueTimer implements Runnable {
private mcMMO plugin;
private ArrayDeque<Block> queue;
public ChangeDataValueTimer(mcMMO instance) {
this.plugin = instance;
public ChangeDataValueTimer(ArrayDeque<Block> queue) {
this.queue = queue;
}
public void run() {
int size = plugin.changeQueue.size();
int size = queue.size();
if(size == 0) return;
if(size > 25) {
size = (int) Math.floor(size / 10);
}
for(int i = 0; i < size; i++) {
Block change = plugin.changeQueue.poll();
Block change = queue.poll();
if(change == null) continue;
change.setData((byte) 5);
}

View File

@@ -0,0 +1,18 @@
package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
public class RemoveProfileFromMemoryTask implements Runnable {
private Player player;
public RemoveProfileFromMemoryTask(Player player) {
this.player = player;
}
@Override
public void run() {
Users.removeUser(player);
}
}

View File

@@ -0,0 +1,40 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
public class mcSaveTimer implements Runnable {
private final mcMMO plugin;
public mcSaveTimer(final mcMMO plugin)
{
this.plugin = plugin;
}
public void run()
{
//All player data will be saved periodically through this
for(Player player : plugin.getServer().getOnlinePlayers())
{
Users.getProfile(player).save();
}
}
}

View File

@@ -20,7 +20,10 @@ import org.bukkit.entity.*;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.skills.Skills;
import com.gmail.nossr50.skills.Swords;
@@ -50,20 +53,43 @@ public class mcTimer implements Runnable
/*
* MONITOR SKILLS
*/
Skills.monitorSkills(player, PP, curTime);
Skills.monitorSkill(player, PP, curTime, SkillType.AXES);
Skills.monitorSkill(player, PP, curTime, SkillType.EXCAVATION);
Skills.monitorSkill(player, PP, curTime, SkillType.HERBALISM);
Skills.monitorSkill(player, PP, curTime, SkillType.MINING);
Skills.monitorSkill(player, PP, curTime, SkillType.SWORDS);
Skills.monitorSkill(player, PP, curTime, SkillType.UNARMED);
Skills.monitorSkill(player, PP, curTime, SkillType.WOODCUTTING);
/*
* COOLDOWN MONITORING
*/
Skills.watchCooldowns(player, PP, curTime);
Skills.watchCooldown(player, PP, curTime, AbilityType.SKULL_SPLIITER);
Skills.watchCooldown(player, PP, curTime, AbilityType.GIGA_DRILL_BREAKER);
Skills.watchCooldown(player, PP, curTime, AbilityType.GREEN_TERRA);
Skills.watchCooldown(player, PP, curTime, AbilityType.SUPER_BREAKER);
Skills.watchCooldown(player, PP, curTime, AbilityType.SERRATED_STRIKES);
Skills.watchCooldown(player, PP, curTime, AbilityType.BERSERK);
Skills.watchCooldown(player, PP, curTime, AbilityType.TREE_FELLER);
Skills.watchCooldown(player, PP, curTime, AbilityType.BLAST_MINING);
/*
* PLAYER BLEED MONITORING
*/
if(thecount % 2 == 0 && PP.getBleedTicks() >= 1)
{
Combat.dealDamage(player, 2);
//Never kill with Bleeding
if(player.getHealth() - 2 < 0)
{
if(player.getHealth() - 1 > 0)
Combat.dealDamage(player, 1);
} else
Combat.dealDamage(player, 2);
PP.decreaseBleedTicks();
if(PP.getBleedTicks() == 0)
player.sendMessage(mcLocale.getString("Swords.StoppedBleeding"));
}
/*

View File

@@ -16,7 +16,6 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
@@ -25,51 +24,52 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
public class Acrobatics {
public static void acrobaticsCheck(Player player, EntityDamageEvent event)
{
if(player != null && mcPermissions.getInstance().acrobatics(player))
{
PlayerProfile PP = Users.getProfile(player);
int acrovar = PP.getSkillLevel(SkillType.ACROBATICS);
if(player.isSneaking())
acrovar = acrovar * 2;
if(Math.random() * 1000 <= acrovar && !event.isCancelled())
PlayerProfile PP = Users.getProfile(player);
int acrovar = PP.getSkillLevel(SkillType.ACROBATICS);
if(player.isSneaking())
acrovar = acrovar * 2;
if(Math.random() * 1000 <= acrovar)
{
int threshold = 7;
if(player.isSneaking())
threshold = 14;
int newDamage = event.getDamage() - threshold;
if(newDamage < 0)
newDamage = 0;
/*
* Check for death
*/
if(player.getHealth() - newDamage >= 1)
{
int threshold = 7;
if(player.isSneaking())
threshold = 14;
int newDamage = event.getDamage() - threshold;
if(newDamage < 0)
newDamage = 0;
/*
* Check for death
*/
if(player.getHealth() - newDamage >= 1){
if(!event.isCancelled())
PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 8)*10, player);
Skills.XpCheckSkill(SkillType.ACROBATICS, player);
event.setDamage(newDamage);
if(event.getDamage() <= 0)
event.setCancelled(true);
if(player.isSneaking()){
player.sendMessage(ChatColor.GREEN+"**GRACEFUL ROLL**");
} else {
player.sendMessage("**ROLL**");
}
}
} else if (!event.isCancelled()){
if(player.getHealth() - event.getDamage() >= 1){
PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*10, player);
Skills.XpCheckSkill(SkillType.ACROBATICS, player);
PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 8)*10, player);
Skills.XpCheckSkill(SkillType.ACROBATICS, player);
event.setDamage(newDamage);
if(event.getDamage() <= 0)
event.setCancelled(true);
if(player.isSneaking()){
player.sendMessage(mcLocale.getString("Acrobatics.GracefulRoll"));
} else {
player.sendMessage(mcLocale.getString("Acrobatics.Roll"));
}
}
}
}
else if(player.getHealth() - event.getDamage() >= 1)
{
PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*10, player);
Skills.XpCheckSkill(SkillType.ACROBATICS, player);
}
}
public static void dodgeChecks(EntityDamageByEntityEvent event){
Player defender = (Player) event.getEntity();
@@ -78,7 +78,7 @@ public class Acrobatics {
if(mcPermissions.getInstance().acrobatics(defender)){
if(PPd.getSkillLevel(SkillType.ACROBATICS) <= 800){
if(Math.random() * 4000 <= PPd.getSkillLevel(SkillType.ACROBATICS)){
defender.sendMessage(ChatColor.GREEN+"**DODGE**");
defender.sendMessage(mcLocale.getString("Acrobatics.Dodge"));
if(System.currentTimeMillis() >= 5000 + PPd.getRespawnATS() && defender.getHealth() >= 1){
PPd.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*1, defender);
Skills.XpCheckSkill(SkillType.ACROBATICS, defender);
@@ -89,7 +89,7 @@ public class Acrobatics {
event.setDamage(1);
}
} else if(Math.random() * 4000 <= 800) {
defender.sendMessage(ChatColor.GREEN+"**DODGE**");
defender.sendMessage(mcLocale.getString("Acrobatics.Dodge"));
if(System.currentTimeMillis() >= 5000 + PPd.getRespawnATS() && defender.getHealth() >= 1){
PPd.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*10, defender);
Skills.XpCheckSkill(SkillType.ACROBATICS, defender);

View File

@@ -1,5 +0,0 @@
package com.gmail.nossr50.skills;
public class Alchemy {
}

View File

@@ -19,8 +19,10 @@ package com.gmail.nossr50.skills;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@@ -29,34 +31,16 @@ import com.gmail.nossr50.party.Party;
public class Archery
{
public static void trackArrows(mcMMO pluginx, Entity x, EntityDamageByEntityEvent event, Player attacker)
public static void trackArrows(mcMMO pluginx, Entity x, PlayerProfile PPa)
{
PlayerProfile PPa = Users.getProfile(attacker);
if(!pluginx.misc.arrowTracker.containsKey(x) && event.getDamage() > 0)
{
int skillLevel = PPa.getSkillLevel(SkillType.ARCHERY);
if(!pluginx.misc.arrowTracker.containsKey(x))
pluginx.misc.arrowTracker.put(x, 0);
if(attacker != null)
{
if( (Math.random() * 1000 <= PPa.getSkillLevel(SkillType.ARCHERY)) || PPa.getSkillLevel(SkillType.ARCHERY) > 1000)
{
pluginx.misc.arrowTracker.put(x, 1);
}
}
} else
{
if(event.getDamage() > 0)
{
if(attacker != null)
{
if( (Math.random() * 1000 <= PPa.getSkillLevel(SkillType.ARCHERY)) || PPa.getSkillLevel(SkillType.ARCHERY) > 1000)
{
pluginx.misc.arrowTracker.put(x, 1);
}
}
}
}
if(skillLevel > 1000 || (Math.random() * 1000 <= skillLevel))
pluginx.misc.arrowTracker.put(x, 1);
}
public static void ignitionCheck(Entity x, EntityDamageByEntityEvent event, Player attacker)
public static void ignitionCheck(Entity x, Player attacker)
{
//Check to see if PVP for this world is disabled before executing
if(!x.getWorld().getPVP())
@@ -65,55 +49,68 @@ public class Archery
PlayerProfile PPa = Users.getProfile(attacker);
if(Math.random() * 100 >= 75)
{
int ignition = 20;
ignition += (PPa.getSkillLevel(SkillType.ARCHERY)/200)*20;
int ignition = 20;
if(PPa.getSkillLevel(SkillType.ARCHERY) >= 200)
ignition+=20;
if(PPa.getSkillLevel(SkillType.ARCHERY) >= 400)
ignition+=20;
if(PPa.getSkillLevel(SkillType.ARCHERY) >= 600)
ignition+=20;
if(PPa.getSkillLevel(SkillType.ARCHERY) >= 800)
ignition+=20;
if(PPa.getSkillLevel(SkillType.ARCHERY) >= 1000)
ignition+=20;
if(ignition > 120)
ignition = 120;
if(x instanceof Player)
{
Player Defender = (Player)x;
if(!Party.getInstance().inSameParty(attacker, Defender))
Player defender = (Player)x;
if(!Party.getInstance().inSameParty(attacker, defender))
{
event.getEntity().setFireTicks(ignition);
defender.setFireTicks(defender.getFireTicks() + ignition);
attacker.sendMessage(mcLocale.getString("Combat.Ignition")); //$NON-NLS-1$
Defender.sendMessage(mcLocale.getString("Combat.BurningArrowHit")); //$NON-NLS-1$
defender.sendMessage(mcLocale.getString("Combat.BurningArrowHit")); //$NON-NLS-1$
}
} else {
event.getEntity().setFireTicks(ignition);
attacker.sendMessage(mcLocale.getString("Combat.Ignition")); //$NON-NLS-1$
}
else
{
x.setFireTicks(x.getFireTicks() + ignition);
attacker.sendMessage(mcLocale.getString("Combat.Ignition")); //$NON-NLS-1$
}
}
}
public static void dazeCheck(Player defender, Player attacker)
{
PlayerProfile PPa = Users.getProfile(attacker);
int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY);
Location loc = defender.getLocation();
if(Math.random() * 10 > 5)
{
loc.setPitch(90);
} else {
loc.setPitch(90);
else
loc.setPitch(-90);
}
if(PPa.getSkillLevel(SkillType.ARCHERY) >= 1000){
if(Math.random() * 1000 <= 500){
if(skillLevel >= 1000)
{
if(Math.random() * 1000 <= 500)
{
defender.teleport(loc);
defender.sendMessage(mcLocale.getString("Combat.TouchedFuzzy")); //$NON-NLS-1$
attacker.sendMessage(mcLocale.getString("Combat.TargetDazed")); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if(Math.random() * 2000 <= PPa.getSkillLevel(SkillType.ARCHERY)){
}
else if(Math.random() * 2000 <= skillLevel)
{
defender.teleport(loc);
defender.sendMessage(mcLocale.getString("Combat.TouchedFuzzy")); //$NON-NLS-1$
attacker.sendMessage(mcLocale.getString("Combat.TargetDazed")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public static void arrowRetrievalCheck(Entity entity, mcMMO plugin)
{
if(plugin.misc.arrowTracker.containsKey(entity))
{
Integer x = 0;
while(x < plugin.misc.arrowTracker.get(entity))
{
m.mcDropItem(entity.getLocation(), new ItemStack(262, 1));
x++;
}
}
plugin.misc.arrowTracker.remove(entity);
}
}

View File

@@ -16,158 +16,188 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Wolf;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
public class Axes {
public static void skullSplitterCheck(Player player){
PlayerProfile PP = Users.getProfile(player);
if(m.isAxes(player.getItemInHand()) && mcPermissions.getInstance().axesAbility(player)){
/*
* CHECK FOR AXE PREP MODE
*/
if(PP.getAxePreparationMode())
{
PP.setAxePreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.AXES);
while(x >= 50){
x-=50;
ticks++;
}
if(!PP.getSkullSplitterMode() && Skills.cooldownOver(player, (PP.getSkullSplitterDeactivatedTimeStamp()*1000), LoadProperties.skullSplitterCooldown))
{
player.sendMessage(mcLocale.getString("Skills.SkullSplitterOn"));
for(Player y : player.getWorld().getPlayers()){
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.SkullSplitterPlayer", new Object[] {player.getName()}));
}
PP.setSkullSplitterActivatedTimeStamp(System.currentTimeMillis());
PP.setSkullSplitterDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setSkullSplitterMode(true);
}
if(!PP.getSkullSplitterMode() && !Skills.cooldownOver(player, (PP.getSkullSplitterDeactivatedTimeStamp()*1000), LoadProperties.skullSplitterCooldown)){
player.sendMessage(mcLocale.getString("Skills.TooTired")
+ChatColor.YELLOW+" ("+Skills.calculateTimeLeft(player, (PP.getSkullSplitterDeactivatedTimeStamp()*1000), LoadProperties.skullSplitterCooldown)+"s)");
}
}
public static void axesBonus(Player attacker, EntityDamageByEntityEvent event)
{
int bonus = 0;
//Add 1 DMG for every 50 skill levels
bonus += Users.getProfile(attacker).getSkillLevel(SkillType.AXES)/50;
if(bonus > 4)
bonus = 4;
event.setDamage(event.getDamage() + bonus);
}
public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
{
Entity x = event.getEntity();
if(x instanceof Wolf){
Wolf wolf = (Wolf)x;
if(Taming.getOwner(wolf, pluginx) != null)
if(wolf.getOwner() instanceof Player)
{
if(Taming.getOwner(wolf, pluginx) == attacker)
Player owner = (Player) wolf.getOwner();
if(owner == attacker)
return;
if(Party.getInstance().inSameParty(attacker, Taming.getOwner(wolf, pluginx)))
if(Party.getInstance().inSameParty(attacker, owner))
return;
}
}
PlayerProfile PPa = Users.getProfile(attacker);
if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
if(PPa.getSkillLevel(SkillType.AXES) >= 750){
if(Math.random() * 1000 <= 750){
if(Math.random() * 2000 <= 750 && !x.isDead()){
if(x instanceof Player){
int damage = (event.getDamage() * 2) - (event.getDamage() / 2);
event.setDamage(damage);
Player player = (Player)x;
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
player.sendMessage(mcLocale.getString("Axes.HitCritically"));
}
if(x instanceof Player){
event.setDamage(event.getDamage() * 2 - event.getDamage() / 2);
} else {
event.setDamage(event.getDamage() * 2);
else {
int damage = event.getDamage() * 2;
event.setDamage(damage);
}
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
attacker.sendMessage(mcLocale.getString("Axes.CriticalHit"));
}
} else if(Math.random() * 1000 <= PPa.getSkillLevel(SkillType.AXES)){
} else if(Math.random() * 2000 <= PPa.getSkillLevel(SkillType.AXES) && !x.isDead()){
if(x instanceof Player){
int damage = (event.getDamage() * 2) - (event.getDamage() / 2);
event.setDamage(damage);
Player player = (Player)x;
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
player.sendMessage(mcLocale.getString("Axes.HitCritically"));
}
if(x instanceof Player){
event.setDamage(event.getDamage() * 2 - event.getDamage() / 2);
} else {
event.setDamage(event.getDamage() * 2);
else {
int damage = event.getDamage() * 2;
event.setDamage(damage);
}
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
attacker.sendMessage(mcLocale.getString("Axes.CriticalHit"));
}
}
}
public static void impact(Player attacker, LivingEntity target, EntityDamageByEntityEvent event)
{
//TODO: Finish this skill, the idea is you will greatly damage an opponents armor and when they are armor less you have a proc that will stun them and deal additional damage.
if(target instanceof Player)
{
Player targetPlayer = (Player) target;
int emptySlots = 0;
short durDmg = 5; //Start with 5 durability dmg
durDmg+=Users.getProfile(attacker).getSkillLevel(SkillType.AXES)/30; //Every 30 Skill Levels you gain 1 durability dmg
for(ItemStack x : targetPlayer.getInventory().getArmorContents())
{
if(x.getType() == Material.AIR)
{
emptySlots++;
} else {
x.setDurability((short) (x.getDurability()+durDmg)); //Damage armor piece
}
}
if(emptySlots == 4)
applyImpact(attacker, target, event);
}
else
//Since mobs are technically unarmored this will always trigger
applyImpact(attacker, target, event);
}
public static void applyImpact(Player attacker, LivingEntity target, EntityDamageByEntityEvent event)
{
if(Math.random() * 100 > 75)
{
event.setDamage(event.getDamage()+2);
target.setVelocity(attacker.getLocation().getDirection().normalize().multiply(1.5D));
attacker.sendMessage(mcLocale.getString("Axes.GreaterImpactOnEnemy"));
}
}
public static void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
{
int targets = 0;
int dmgAmount = (event.getDamage()/2);
//Setup minimum damage
if(dmgAmount < 1)
dmgAmount = 1;
if(event.getEntity() instanceof LivingEntity)
{
LivingEntity x = (LivingEntity) event.getEntity();
targets = m.getTier(attacker);
for(Entity derp : x.getWorld().getEntities())
{
if(m.getDistance(x.getLocation(), derp.getLocation()) < 5)
{
//Make sure the Wolf is not friendly
if(derp instanceof Wolf)
for(Entity derp : x.getNearbyEntities(2.5, 2.5, 2.5))
{
//Make sure the Wolf is not friendly
if(derp instanceof Wolf)
{
Wolf hurrDurr = (Wolf)derp;
if(hurrDurr.getOwner() instanceof Player)
{
Player owner = (Player) hurrDurr.getOwner();
if(owner == attacker)
return;
if(Party.getInstance().inSameParty(attacker, owner))
return;
}
}
//Damage nearby LivingEntities
if(derp instanceof LivingEntity && targets >= 1)
{
if(derp instanceof Player)
{
Wolf hurrDurr = (Wolf)derp;
if(Taming.getOwner(hurrDurr, pluginx) == attacker)
continue;
if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx)))
continue;
}
//Damage nearby LivingEntities
if(derp instanceof LivingEntity && targets >= 1)
{
if(derp instanceof Player)
{
Player target = (Player)derp;
if(Users.getProfile(target).getGodMode())
continue;
Player target = (Player)derp;
if(Users.getProfile(target).getGodMode())
continue;
if(target.getName().equals(attacker.getName()))
continue;
if(Party.getInstance().inSameParty(attacker, target))
continue;
if(targets >= 1 && derp.getWorld().getPVP())
{
Combat.dealDamage(target, event.getDamage() / 2, attacker);
target.sendMessage(ChatColor.DARK_RED+"Struck by CLEAVE!");
targets--;
continue;
}
}
else
{
LivingEntity target = (LivingEntity)derp;
Combat.dealDamage(target, event.getDamage() / 2, attacker);
targets--;
}
if(target.getName().equals(attacker.getName()))
continue;
if(Party.getInstance().inSameParty(attacker, target))
continue;
if(target.isDead())
continue;
if(targets >= 1 && derp.getWorld().getPVP())
{
Combat.dealDamage(target, dmgAmount, attacker);
target.sendMessage(mcLocale.getString("Axes.HitByCleave"));
targets--;
continue;
}
}
}
}
else
{
LivingEntity target = (LivingEntity)derp;
Combat.dealDamage(target, dmgAmount, attacker);
targets--;
}
}
}
}
}
}
}

View File

@@ -0,0 +1,281 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.skills;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
public class BlastMining{
public static void explosionBlockDrops(Block block, Location loc)
{
int id = block.getTypeId();
ItemStack item = new ItemStack(id, 1);
switch (id){
//GLOWSTONE
case 89:
item = new ItemStack(348, 1);
m.mcDropItems(loc, item, 2);
m.mcRandomDropItems(loc, item, 50, 2);
break;
//REDSTONE
case 73:
item = new ItemStack(331, 1);
m.mcDropItems(loc, item, 4);
m.mcRandomDropItem(loc, item, 50);
break;
case 74:
item = new ItemStack(331, 1);
m.mcDropItems(loc, item, 4);
m.mcRandomDropItem(loc, item, 50);
break;
//LAPIS
case 21:
item = new ItemStack(351, 1, (byte)0,(byte)0x4);
m.mcDropItems(loc, item, 4);
m.mcRandomDropItems(loc, item, 50, 4);
break;
//DIAMOND
case 56:
item = new ItemStack(264, 1);
m.mcDropItem(loc, item);
break;
//STONE
case 1:
item = new ItemStack(4, 1);
m.mcDropItem(loc, item);
break;
//COAL
case 16:
item = new ItemStack(263, 1);
m.mcDropItem(loc, item);
break;
default:
m.mcDropItem(loc, item);
break;
}
}
public static List<Block> explosionYields(List<Block> ores, List<Block> debris, float yield, float oreBonus, float debrisReduction, Location location, int extraDrops)
{
Iterator<Block> iterator2 = ores.iterator();
List<Block> blocksDropped = new ArrayList<Block>();
while(iterator2.hasNext())
{
Block temp = iterator2.next();
if((float)Math.random() < (yield + oreBonus))
{
blocksDropped.add(temp);
explosionBlockDrops(temp, location);
if(extraDrops == 2)
blocksDropped.add(temp);
explosionBlockDrops(temp, location);
if(extraDrops == 3)
blocksDropped.add(temp);
explosionBlockDrops(temp, location);
}
}
if(yield - debrisReduction != 0)
{
Iterator<Block> iterator3 = debris.iterator();
while(iterator3.hasNext())
{
Block temp = iterator3.next();
if((float)Math.random() < (yield - debrisReduction))
explosionBlockDrops(temp, location);
}
}
return blocksDropped;
}
/*
* Process the drops from the explosion
*/
public static void dropProcessing(Player player, EntityExplodeEvent event, mcMMO plugin)
{
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
float yield = event.getYield();
Location location = event.getLocation();
List<Block> blocks = event.blockList();
Iterator<Block> iterator = blocks.iterator();
List<Block> ores = new ArrayList<Block>();
List<Block> debris = new ArrayList<Block>();
List<Block> xp = new ArrayList<Block>();
while(iterator.hasNext())
{
Block temp = iterator.next();
if(temp.getData() != 5 && !plugin.misc.blockWatchList.contains(temp))
{
if(m.isOre(temp))
ores.add(temp);
else
debris.add(temp);
}
}
//Normal explosion
if(skillLevel < 125)
return;
event.setYield(0);
//+35% ores, -10% debris
if(skillLevel >= 125 && skillLevel < 250)
xp = explosionYields(ores, debris, yield, .35f, .10f, location, 1);
//+40% ores, -20% debris
if(skillLevel >= 250 && skillLevel < 375)
xp = explosionYields(ores, debris, yield, .40f, .20f, location, 1);
//No debris, +45% ores
if(skillLevel >= 375 && skillLevel < 500)
xp = explosionYields(ores, debris, yield, .45f, .30f, location, 1);
//No debris, +50% ores
if(skillLevel >= 500 && skillLevel < 625)
xp = explosionYields(ores, debris, yield, .50f, .30f, location, 1);
//Double Drops, No Debris, +55% ores
if(skillLevel >= 625 && skillLevel < 750)
xp = explosionYields(ores, debris, yield, .55f, .30f, location, 2);
//Double Drops, No Debris, +60% ores
if(skillLevel >= 750 && skillLevel < 875)
xp = explosionYields(ores, debris, yield, .60f, .30f, location, 2);
//Triple Drops, No debris, +65% ores
if(skillLevel >= 875 && skillLevel < 1000)
xp = explosionYields(ores, debris, yield, .65f, .30f, location, 3);
//Triple Drops, No debris, +70% ores
if(skillLevel >= 1000)
xp = explosionYields(ores, debris, yield, .70f, .30f, location, 3);
for(Block block : xp)
{
blastMiningXP(player, block, plugin);
}
}
/*
* Bigger Bombs (Unlocked at Mining 250)
*
* Increases radius of explosion by 1 at 250.
* Increases radius of explosion by 2 at 500.
* Increases radius of explosion by 3 at 750.
* Increases radius of explosion by 4 at 1000.
*/
public static void biggerBombs(Player player, ExplosionPrimeEvent event)
{
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
float radius = event.getRadius();
if(skillLevel < 250)
return;
if(skillLevel >= 250)
radius++;
if(skillLevel >= 500)
radius++;
if(skillLevel >= 750)
radius++;
if(skillLevel >= 1000)
radius++;
event.setRadius(radius);
}
/*
* Demolitions Expertise (Unlocked at Mining 500)
*
* Reduces explosion damage to 1/4 of normal at 500.
* Reduces explosion damage to 1/2 of normal at 750.
* Reduces explosion damage to 0 at 1000.
*/
public static void demolitionsExpertise(Player player, EntityDamageEvent event)
{
int skill = Users.getProfile(player).getSkillLevel(SkillType.MINING);
int damage = event.getDamage();
if(skill < 500)
return;
if(skill >= 500 && skill < 750)
damage = damage/4;
if(skill >= 750 && skill < 1000)
damage = damage/2;
if(skill >= 1000)
damage = 0;
event.setDamage(damage);
}
public static void blastMiningXP(Player player, Block block, mcMMO plugin)
{
PlayerProfile PP = Users.getProfile(player);
if(plugin.misc.blockWatchList.contains(block) || block.getData() == (byte) 5)
return;
int xp = 0;
switch (block.getType()) {
//COAL
case COAL_ORE:
xp += LoadProperties.mcoal;
break;
//GOLD
case GOLD_ORE:
xp += LoadProperties.mgold;
break;
//DIAMOND
case DIAMOND_ORE:
xp += LoadProperties.mdiamond;
break;
//IRON
case IRON_ORE:
xp += LoadProperties.miron;
break;
//REDSTONE
case REDSTONE_ORE:
xp += LoadProperties.mredstone;
break;
//LAPIS
case LAPIS_ORE:
xp += LoadProperties.mlapis;
break;
}
PP.addXP(SkillType.MINING, xp, player);
Skills.XpCheckSkill(SkillType.MINING, player);
}
}

View File

@@ -1,5 +0,0 @@
package com.gmail.nossr50.skills;
public class Enchanting {
}

View File

@@ -17,229 +17,147 @@
package com.gmail.nossr50.skills;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.locale.mcLocale;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.player.PlayerAnimationEvent;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.LoadTreasures;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
import org.getspout.spoutapi.sound.SoundEffect;
public class Excavation
{
public static void gigaDrillBreakerActivationCheck(Player player, Block block)
{
PlayerProfile PP = Users.getProfile(player);
if(m.isShovel(player.getItemInHand()))
{
if(block != null)
{
if(!m.abilityBlockCheck(block))
return;
}
if(PP.getShovelPreparationMode())
{
PP.setShovelPreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.EXCAVATION);
while(x >= 50)
{
x-=50;
ticks++;
}
if(!PP.getGigaDrillBreakerMode() && PP.getGigaDrillBreakerDeactivatedTimeStamp() < System.currentTimeMillis())
{
player.sendMessage(mcLocale.getString("Skills.GigaDrillBreakerOn"));
for(Player y : player.getWorld().getPlayers())
{
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.GigaDrillBreakerPlayer", new Object[] {player.getName()}));
}
PP.setGigaDrillBreakerActivatedTimeStamp(System.currentTimeMillis());
PP.setGigaDrillBreakerDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setGigaDrillBreakerMode(true);
}
}
}
public static boolean canBeGigaDrillBroken(Block block)
{
Material t = block.getType();
return t == Material.DIRT || t == Material.GRASS || t == Material.SAND || t == Material.GRAVEL || t == Material.CLAY || t == Material.MYCEL || t == Material.SOUL_SAND;
switch(block.getType()){
case CLAY:
case DIRT:
case GRASS:
case GRAVEL:
case MYCEL:
case SAND:
case SOUL_SAND:
return true;
}
return false;
}
public static void excavationProcCheck(byte data, Material type, Location loc, Player player)
public static void excavationProcCheck(Block block, Player player)
{
if(LoadProperties.excavationRequiresShovel && !m.isShovel(player.getItemInHand()))
return;
Material type = block.getType();
Location loc = block.getLocation();
PlayerProfile PP = Users.getProfile(player);
int skillLevel = PP.getSkillLevel(SkillType.EXCAVATION);
ArrayList<ItemStack> is = new ArrayList<ItemStack>();
int xp = 0;
int xp = LoadProperties.mbase;
switch(type)
{
case GRASS:
if(skillLevel >= 250)
case DIRT:
for(ExcavationTreasure treasure : LoadTreasures.excavationFromDirt)
{
//CHANCE TO GET EGGS
if(LoadProperties.eggs && Math.random() * 100 > 99)
{
xp+= LoadProperties.meggs;
is.add(new ItemStack(Material.EGG, 1, (byte)0, (byte)0));
}
//CHANCE TO GET APPLES
if(LoadProperties.apples && Math.random() * 100 > 99)
{
xp+= LoadProperties.mapple;
is.add(new ItemStack(Material.APPLE, 1, (byte)0, (byte)0));
}
if(skillLevel >= treasure.getDropLevel())
{
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
break;
case GRASS:
for(ExcavationTreasure treasure : LoadTreasures.excavationFromGrass)
{
if(skillLevel >= treasure.getDropLevel())
{
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
break;
case SAND:
for(ExcavationTreasure treasure : LoadTreasures.excavationFromSand)
{
if(skillLevel >= treasure.getDropLevel())
{
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
break;
case GRAVEL:
//CHANCE TO GET NETHERRACK
if(LoadProperties.netherrack && skillLevel >= 850 && Math.random() * 200 > 199)
for(ExcavationTreasure treasure : LoadTreasures.excavationFromGravel)
{
xp+= LoadProperties.mnetherrack;
is.add(new ItemStack(Material.NETHERRACK, 1, (byte)0, (byte)0));
}
//CHANCE TO GET SULPHUR
if(LoadProperties.sulphur && skillLevel >= 75 && Math.random() * 10 > 9)
{
xp+= LoadProperties.msulphur;
is.add(new ItemStack(Material.SULPHUR, 1, (byte)0, (byte)0));
}
//CHANCE TO GET BONES
if(LoadProperties.bones && skillLevel >= 175 && Math.random() * 10 > 9)
{
xp+= LoadProperties.mbones;
is.add(new ItemStack(Material.BONE, 1, (byte)0, (byte)0));
}
break;
case SAND:
//CHANCE TO GET GLOWSTONE
if(LoadProperties.glowstone && skillLevel >= 50 && Math.random() * 100 > 95)
{
xp+= LoadProperties.mglowstone2;
is.add(new ItemStack(Material.GLOWSTONE_DUST, 1, (byte)0, (byte)0));
}
//CHANCE TO GET SOUL SAND
if(LoadProperties.slowsand && skillLevel >= 650 && Math.random() * 200 > 199)
{
xp+= LoadProperties.mslowsand;
is.add(new ItemStack(Material.SOUL_SAND, 1, (byte)0, (byte)0));
if(skillLevel >= treasure.getDropLevel())
{
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
break;
case CLAY:
//CHANCE TO GET SLIMEBALLS
if(LoadProperties.slimeballs && skillLevel >= 50 && Math.random() * 20 > 19)
for(ExcavationTreasure treasure : LoadTreasures.excavationFromClay)
{
xp+= LoadProperties.mslimeballs;
is.add(new ItemStack(Material.SLIME_BALL, 1, (byte)0, (byte)0));
}
//CHANCE TO GET STRING
if(LoadProperties.string && skillLevel >= 250 && Math.random() * 20 > 19)
{
xp+= LoadProperties.mstring;
is.add(new ItemStack(Material.STRING, 1, (byte)0, (byte)0));
}
if(skillLevel >= 500)
{
//CHANCE TO GET CLOCK
if(LoadProperties.watch && Math.random() * 100 > 99)
{
xp+= LoadProperties.mwatch;
is.add(new ItemStack(Material.WATCH, 1, (byte)0));
}
//CHANCE TO GET BUCKET
if(LoadProperties.bucket && Math.random() * 100 > 99)
{
xp+= LoadProperties.mbucket;
is.add(new ItemStack(Material.BUCKET, 1, (byte)0, (byte)0));
}
}
//CHANCE TO GET COBWEB
if(LoadProperties.web && skillLevel >= 750 && Math.random() * 20 > 19)
{
xp+= LoadProperties.mweb;
is.add(new ItemStack(Material.WEB, 1, (byte)0, (byte)0));
if(skillLevel >= treasure.getDropLevel())
{
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
break;
}
//ALL MATERIALS
if(type == Material.GRASS || type == Material.DIRT || type == Material.GRAVEL || type == Material.SAND || type == Material.CLAY || type == Material.MYCEL || type == Material.SOUL_SAND)
{
xp+= LoadProperties.mbase;
//CHANCE TO GET CAKE
if(LoadProperties.cake && skillLevel >= 750 && Math.random() * 2000 > 1999)
{
xp+= LoadProperties.mcake;
is.add(new ItemStack(Material.CAKE, 1, (byte)0, (byte)0));
}
if(skillLevel >= 350)
case MYCEL:
for(ExcavationTreasure treasure : LoadTreasures.excavationFromMycel)
{
//CHANCE TO GET DIAMOND
if(LoadProperties.diamond && Math.random() * 750 > 749)
if(skillLevel >= treasure.getDropLevel())
{
xp+= LoadProperties.mdiamond2;
is.add(new ItemStack(Material.DIAMOND, 1, (byte)0, (byte)0));
}
//CHANCE TO GET GREEN MUSIC
if(LoadProperties.music && Math.random() * 2000 > 1999)
{
xp+= LoadProperties.mmusic;
is.add(new ItemStack(Material.GREEN_RECORD, 1, (byte)0, (byte)0));
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
//CHANCE TO GET YELLOW MUSIC
if(LoadProperties.music && skillLevel >= 250 && Math.random() * 2000 > 1999)
{
xp+= LoadProperties.mmusic;
is.add(new ItemStack(Material.GOLD_RECORD, 1, (byte)0, (byte)0));
}
}
//GRASS OR DIRT OR MYCEL
if(type == Material.DIRT || type == Material.GRASS || type == Material.MYCEL)
{
//CHANCE FOR COCOA BEANS
if(LoadProperties.cocoabeans && skillLevel >= 50 && Math.random() * 75 > 74)
break;
case SOUL_SAND:
for(ExcavationTreasure treasure : LoadTreasures.excavationFromSoulSand)
{
xp+= LoadProperties.mcocoa;
is.add(new ItemStack(Material.getMaterial(351), 1, (byte)0, (byte)3));
}
//CHANCE FOR SHROOMS
if(LoadProperties.mushrooms && skillLevel >= 500 && Math.random() * 200 > 199)
{
xp+= LoadProperties.mmushroom2;
switch((int)(Math.random() * 2))
if(skillLevel >= treasure.getDropLevel())
{
case 0:
is.add(new ItemStack(Material.BROWN_MUSHROOM, 1, (byte)0, (byte)0));
break;
case 1:
is.add(new ItemStack(Material.RED_MUSHROOM, 1, (byte)0, (byte)0));
break;
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
{
xp += treasure.getXp();
is.add(treasure.getDrop());
}
}
}
//CHANCE TO GET GLOWSTONE
if(LoadProperties.glowstone && skillLevel >= 25 && Math.random() * 100 > 95)
{
xp+= LoadProperties.mglowstone2;
is.add(new ItemStack(Material.GLOWSTONE_DUST, 1, (byte)0, (byte)0));
}
break;
}
//Drop items
@@ -253,4 +171,29 @@ public class Excavation
PP.addXP(SkillType.EXCAVATION, xp, player);
Skills.XpCheckSkill(SkillType.EXCAVATION, player);
}
public static void gigaDrillBreaker(Player player, Block block)
{
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
{
short durability = player.getItemInHand().getDurability();
durability += LoadProperties.abilityDurabilityLoss;
player.getItemInHand().setDurability(durability);
}
}
if(block.getData() != (byte)5)
{
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
Excavation.excavationProcCheck(block, player);
Excavation.excavationProcCheck(block, player);
Excavation.excavationProcCheck(block, player);
}
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,7 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
@@ -23,132 +24,70 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
public class Herbalism
{
public static void greenTerraCheck(Player player, Block block)
{
PlayerProfile PP = Users.getProfile(player);
if(m.isHoe(player.getItemInHand()))
{
if(block != null)
{
if(!m.abilityBlockCheck(block))
return;
}
if(PP.getHoePreparationMode())
{
PP.setHoePreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.HERBALISM);
while(x >= 50)
{
x-=50;
ticks++;
}
if(!PP.getGreenTerraMode() && Skills.cooldownOver(player, PP.getGreenTerraDeactivatedTimeStamp(), LoadProperties.greenTerraCooldown))
{
player.sendMessage(mcLocale.getString("Skills.GreenTerraOn"));
for(Player y : player.getWorld().getPlayers())
{
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.GreenTerraPlayer", new Object[] {player.getName()}));
}
PP.setGreenTerraActivatedTimeStamp(System.currentTimeMillis());
PP.setGreenTerraDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setGreenTerraMode(true);
}
}
}
public static void greenTerraWheat(Player player, Block block, BlockBreakEvent event, mcMMO plugin)
{
if(block.getType() == Material.WHEAT && block.getData() == (byte) 0x07)
{
event.setCancelled(true);
PlayerProfile PP = Users.getProfile(player);
Material mat = Material.getMaterial(296);
Location loc = block.getLocation();
ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0);
PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player);
m.mcDropItem(loc, is);
//DROP SOME SEEDS
mat = Material.SEEDS;
is = new ItemStack(mat, 1, (byte)0, (byte)0);
m.mcDropItem(loc, is);
herbalismProcCheck(block, player, event, plugin);
herbalismProcCheck(block, player, event, plugin);
block.setData((byte) 0x03);
}
}
{
public static void greenTerra(Player player, Block block){
PlayerInventory inventory = player.getInventory();
boolean hasSeeds = inventory.contains(Material.SEEDS);
if(block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT){
if(!hasSeeds(player))
if(!hasSeeds)
player.sendMessage("You need more seeds to spread Green Terra");
if(hasSeeds(player) && block.getType() != Material.WHEAT)
if(hasSeeds && block.getType() != Material.WHEAT)
{
removeSeeds(player);
if(block.getType() == Material.SMOOTH_BRICK)
block.setData((byte)1);
if(block.getType() == Material.DIRT)
block.setType(Material.GRASS);
if(LoadProperties.enableCobbleToMossy && block.getType() == Material.COBBLESTONE)
block.setType(Material.MOSSY_COBBLESTONE);
inventory.removeItem(new ItemStack(Material.SEEDS, 1));
player.updateInventory();
if(LoadProperties.enableSmoothToMossy && block.getType() == Material.SMOOTH_BRICK)
block.setData((byte)1);
if(LoadProperties.enableDirtToGrass && block.getType() == Material.DIRT)
block.setType(Material.GRASS);
if(LoadProperties.enableCobbleToMossy && block.getType() == Material.COBBLESTONE)
block.setType(Material.MOSSY_COBBLESTONE);
}
}
}
public static Boolean canBeGreenTerra(Block block){
int t = block.getTypeId();
return t == 103 || t == 4 || t == 3 || t == 59 || t == 81 || t == 83 || t == 91 || t == 86 || t == 39 || t == 46 || t == 37 || t == 38;
}
public static boolean hasSeeds(Player player){
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x != null && x.getTypeId() == 295){
return true;
}
switch(block.getType()){
case BROWN_MUSHROOM:
case CACTUS:
case COBBLESTONE:
case CROPS:
case DIRT:
case JACK_O_LANTERN:
case MELON_BLOCK:
case PUMPKIN:
case RED_MUSHROOM:
case RED_ROSE:
case SMOOTH_BRICK:
case SUGAR_CANE_BLOCK:
case VINE:
case WATER_LILY:
case YELLOW_FLOWER:
return true;
}
return false;
}
public static void removeSeeds(Player player){
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x != null && x.getTypeId() == 295){
if(x.getAmount() == 1){
x.setTypeId(0);
x.setAmount(0);
player.getInventory().setContents(inventory);
} else{
x.setAmount(x.getAmount() - 1);
player.getInventory().setContents(inventory);
}
return;
}
}
}
public static void herbalismProcCheck(Block block, Player player, BlockBreakEvent event, mcMMO plugin)
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin)
{
PlayerProfile PP = Users.getProfile(player);
final PlayerProfile PP = Users.getProfile(player);
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
int type = block.getTypeId();
Location loc = block.getLocation();
ItemStack is = null;
Material mat = null;
PlayerInventory inventory = player.getInventory();
boolean hasSeeds = inventory.contains(Material.SEEDS);
if(plugin.misc.blockWatchList.contains(block))
{
@@ -158,63 +97,59 @@ public class Herbalism
//Wheat
if(type == 59 && block.getData() == (byte) 0x7)
{
mat = Material.getMaterial(296);
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(Material.WHEAT, 1);
PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player);
if(player != null)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
//GREEN THUMB
if((Math.random() * 1500 <= herbLevel) || herbLevel > 1500)
if(hasSeeds && PP.getGreenTerraMode() || hasSeeds && (herbLevel >= 1500 || (Math.random() * 1500 <= herbLevel)))
{
event.setCancelled(true);
m.mcDropItem(loc, is);
//DROP SOME SEEDS
mat = Material.SEEDS;
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(Material.SEEDS, 1);
m.mcDropItem(loc, is);
block.setData((byte) 0x1); //Change it to first stage
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
public void run() {
block.setType(Material.CROPS);
//This replants the wheat at a certain stage in development based on Herbalism Skill
if(!PP.getGreenTerraMode())
{
if (PP.getSkillLevel(SkillType.HERBALISM) >= 600)
block.setData((byte) 0x4);
else if (PP.getSkillLevel(SkillType.HERBALISM) >= 400)
block.setData((byte) 0x3);
else if (PP.getSkillLevel(SkillType.HERBALISM) >= 200)
block.setData((byte) 0x2);
else
block.setData((byte) 0x1);
} else
block.setData((byte) 0x4);
}
}, 1);
//Setup the bonuses
int bonus = 0;
if(PP.getSkillLevel(SkillType.HERBALISM) >= 200)
bonus++;
if(PP.getSkillLevel(SkillType.HERBALISM) >= 400)
bonus++;
if(PP.getSkillLevel(SkillType.HERBALISM) >= 600)
bonus++;
//Change wheat to be whatever stage based on the bonus
if(bonus == 1)
block.setData((byte) 0x2);
if(bonus == 2)
block.setData((byte) 0x3);
if(bonus == 3)
block.setData((byte) 0x4);
inventory.removeItem(new ItemStack(Material.SEEDS, 1));
player.updateInventory();
}
}
//Nether Wart
if(type == 115 && block.getData() == (byte) 0x3)
{
mat = Material.getMaterial(372);
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(Material.NETHER_STALK, 1);
PP.addXP(SkillType.HERBALISM, LoadProperties.mnetherwart, player);
if(player != null)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{
m.mcDropItem(loc, is);
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
m.mcDropItems(loc, is, 2);
m.mcRandomDropItems(loc, is, 50, 3);
}
}
}
@@ -248,10 +183,10 @@ public class Herbalism
{
if(materialArray[x] == Material.CACTUS)
{
is = new ItemStack(Material.CACTUS, 1, (byte)0, (byte)0);
is = new ItemStack(Material.CACTUS, 1);
if(byteArray[x] != (byte) 5)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{
m.mcDropItem(target.getLocation(), is);
}
@@ -286,11 +221,11 @@ public class Herbalism
{
if(materialArray[x] == Material.SUGAR_CANE_BLOCK)
{
is = new ItemStack(Material.SUGAR_CANE, 1, (byte)0, (byte)0);
is = new ItemStack(Material.SUGAR_CANE, 1);
//Check for being placed by the player
if(byteArray[x] != (byte) 5)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{
m.mcDropItem(target.getLocation(), is);
}
@@ -305,10 +240,10 @@ public class Herbalism
if((type == 91 || type == 86))
{
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(mat, 1);
if(player != null)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{
m.mcDropItem(loc, is);
}
@@ -318,23 +253,13 @@ public class Herbalism
//Melon
if(type == 103)
{
mat = Material.getMaterial(360);
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(Material.MELON, 1);
if(player != null)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{
m.mcDropItem(loc, is);
m.mcDropItem(loc, is);
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, is);
m.mcDropItems(loc, is, 3);
m.mcRandomDropItems(loc, is, 50, 4);
}
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mmelon, player);
@@ -343,10 +268,10 @@ public class Herbalism
if(type == 39 || type == 40)
{
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(mat, 1);
if(player != null)
{
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{
m.mcDropItem(loc, is);
}
@@ -356,9 +281,9 @@ public class Herbalism
//Flower
if(type == 37 || type == 38){
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(mat, 1);
if(player != null){
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mflower, player);
@@ -366,20 +291,18 @@ public class Herbalism
//Lily Pads
if(type == 111)
{
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(Material.WATER_LILY, 1);
if(player != null){
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mlilypad, player);
}
//Vines
if(type == 106){
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0);
is = new ItemStack(Material.VINE, 1, (byte)0, (byte)0);
if(player != null){
if((Math.random() * 1000 <= herbLevel) || herbLevel > 1000)
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mvines, player);

View File

@@ -16,15 +16,14 @@
*/
package com.gmail.nossr50.skills;
import net.minecraft.server.Enchantment;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Statistic;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.sound.SoundEffect;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.player.PlayerAnimationEvent;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
@@ -33,64 +32,19 @@ import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
public class Mining
{
public static void superBreakerCheck(Player player, Block block)
{
PlayerProfile PP = Users.getProfile(player);
if(m.isMiningPick(player.getItemInHand()))
{
if(block != null)
{
if(!m.abilityBlockCheck(block))
return;
}
if(PP.getPickaxePreparationMode())
{
PP.setPickaxePreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.MINING);
while(x >= 50)
{
x-=50;
ticks++;
}
if(!PP.getSuperBreakerMode() && Skills.cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)){
player.sendMessage(mcLocale.getString("Skills.SuperBreakerOn"));
for(Player y : player.getWorld().getPlayers())
{
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.SuperBreakerPlayer", new Object[] {player.getName()}));
}
PP.setSuperBreakerActivatedTimeStamp(System.currentTimeMillis());
PP.setSuperBreakerDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setSuperBreakerMode(true);
}
}
}
public static void blockProcSimulate(Block block, Player player)
{
Location loc = block.getLocation();
int id = block.getTypeId();
Material mat = Material.getMaterial(id);
byte damage = 0;
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
if(id != 89 && id != 73 && id != 74 && id != 56 && id != 21 && id != 1 && id != 16 && id != 112 && id != 121 && id != 48) {
m.mcDropItem(loc, item);
return;
}
ItemStack item = new ItemStack(id, 1);
//Drop natural block with Silk Touch
if(player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH)){
if(player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)){
m.mcDropItem(loc, item);
return;
}
@@ -98,69 +52,43 @@ public class Mining
switch (id){
//GLOWSTONE
case 89:
mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
item = new ItemStack(348, 1);
m.mcDropItems(loc, item, 2);
m.mcRandomDropItems(loc, item, 50, 2);
break;
//REDSTONE
case 73:
mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
item = new ItemStack(331, 1);
m.mcDropItems(loc, item, 4);
m.mcRandomDropItem(loc, item, 50);
break;
case 74:
mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
item = new ItemStack(331, 1);
m.mcDropItems(loc, item, 4);
m.mcRandomDropItem(loc, item, 50);
break;
//LAPIS
case 21:
mat = Material.getMaterial(351);
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
item = new ItemStack(351, 1, (byte)0,(byte)0x4);
m.mcDropItems(loc, item, 4);
m.mcRandomDropItems(loc, item, 50, 4);
break;
//DIAMOND
case 56:
mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage);
item = new ItemStack(264, 1);
m.mcDropItem(loc, item);
break;
//STONE
case 1:
mat = Material.getMaterial(4);
item = new ItemStack(mat, 1, (byte)0, damage);
item = new ItemStack(4, 1);
m.mcDropItem(loc, item);
break;
//COAL
case 16:
mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage);
item = new ItemStack(263, 1);
m.mcDropItem(loc, item);
break;
default:
m.mcDropItem(loc, item);
break;
}
@@ -168,13 +96,10 @@ public class Mining
public static void blockProcCheck(Block block, Player player)
{
PlayerProfile PP = Users.getProfile(player);
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
if((Math.random() * 1000 <= PP.getSkillLevel(SkillType.MINING)) || PP.getSkillLevel(SkillType.MINING) > 1000)
{
if(skillLevel > 1000 || (Math.random() * 1000 <= skillLevel))
blockProcSimulate(block, player);
return;
}
}
public static void miningBlockCheck(Player player, Block block, mcMMO plugin)
@@ -233,10 +158,6 @@ public class Mining
case 21:
xp += LoadProperties.mlapis;
break;
//NETHER BRICK
case 112:
xp += LoadProperties.mnetherbrick;
break;
//END STONE
case 121:
xp += LoadProperties.mendstone;
@@ -245,10 +166,6 @@ public class Mining
case 48:
xp += LoadProperties.mmossstone;
break;
//STONE BRICK
case 98:
xp += LoadProperties.mstonebrick;
break;
}
if(canBeSuperBroken(block))
@@ -262,8 +179,24 @@ public class Mining
*/
public static Boolean canBeSuperBroken(Block block)
{
int id = block.getTypeId();
return id == 1 || id == 14 || id == 15 || id == 16 || id == 21 || id == 24 || id == 49 || id == 56 || id == 73 || id == 74 || id == 87 || id == 89 || id == 112 || id == 121 || id == 48 || id == 98;
switch(block.getType()){
case COAL_ORE:
case DIAMOND_ORE:
case ENDER_STONE:
case GLOWING_REDSTONE_ORE:
case GLOWSTONE:
case GOLD_ORE:
case IRON_ORE:
case LAPIS_ORE:
case MOSSY_COBBLESTONE:
case NETHERRACK:
case OBSIDIAN:
case REDSTONE_ORE:
case SANDSTONE:
case STONE:
return true;
}
return false;
}
public static void SuperBreakerBlockCheck(Player player, Block block, mcMMO plugin)
@@ -271,262 +204,123 @@ public class Mining
PlayerProfile PP = Users.getProfile(player);
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY))
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
{
short durability = player.getItemInHand().getDurability();
durability += LoadProperties.abilityDurabilityLoss;
player.getItemInHand().setDurability(durability);
}
}
//Pre-processing
Location loc = block.getLocation();
int id = block.getTypeId();
Material mat = Material.getMaterial(id);
int xp = 0;
byte damage = 0;
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
boolean silkTouch = player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH);
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
//STONE
if(id == 1)
if(id == 1 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5)
{
xp += LoadProperties.mstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(!silkTouch)
{
mat = Material.getMaterial(4);
item = new ItemStack(mat, 1, (byte)0, damage);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//SANDSTONE
else if(id == 24)
else if(id == 24 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5)
{
xp += LoadProperties.msandstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.msandstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//NETHERRACK
else if(id == 87)
else if(id == 87 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.mnetherrack;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mnetherrack;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//GLOWSTONE
else if(id == 89)
else if(id == 89 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.mglowstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(!silkTouch)
{
mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
}
else
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mglowstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//COAL
else if(id == 16)
else if(id == 16 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.mcoal;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(!silkTouch)
{
mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mcoal;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//GOLD
else if(id == 14 && m.getTier(player) >= 3)
else if(id == 14 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.mgold;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mgold;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//OBSIDIAN
else if(id == 49 && m.getTier(player) >= 4)
else if(id == 49 && m.getTier(player) >= 4 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.mobsidian;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mobsidian;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//DIAMOND
else if(id == 56 && m.getTier(player) >= 3)
else if(id == 56 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.mdiamond;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(!silkTouch)
{
mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mdiamond;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//IRON
else if(id == 15 && m.getTier(player) >= 2)
else if(id == 15 && m.getTier(player) >= 2 && block.getData() != (byte) 5)
{
if(block.getData() != (byte) 5){
xp += LoadProperties.miron;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.miron;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//REDSTONE
else if((id == 73 || id == 74) && m.getTier(player) >= 3)
else if((id == 73 || id == 74) && m.getTier(player) >= 3 && !plugin.misc.blockWatchList.contains(block))
{
if(!plugin.misc.blockWatchList.contains(block))
{
xp += LoadProperties.mredstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(!silkTouch)
{
mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
}
else
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mredstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//LAPIS
else if(id == 21 && m.getTier(player) >= 3){
if(block.getData() != (byte) 5){
xp += LoadProperties.mlapis;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(!silkTouch)
{
mat = Material.getMaterial(351);
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
if(Math.random() * 10 > 5)
m.mcDropItem(loc, item);
}
else
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
}
//NETHER BRICK
else if(id == 112){
if(block.getData() != (byte) 5){
xp += LoadProperties.mnetherbrick;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
else if(id == 21 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mlapis;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//END STONE
else if(id == 121){
if(block.getData() != (byte) 5){
xp += LoadProperties.mendstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
else if(id == 121 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mendstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//MOSS STONE
else if(id == 48){
if(block.getData() != (byte) 5){
xp += LoadProperties.mmossstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
else if(id == 48 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mmossstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//STONE BRICK
else if(id == 98){
if(!plugin.misc.blockWatchList.contains(block)){
xp += LoadProperties.mstonebrick;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR);
}
if(!plugin.misc.blockWatchList.contains(block) && block.getData() != (byte) 5)
PP.addXP(SkillType.MINING, xp, player);
if(LoadProperties.spoutEnabled)

View File

@@ -16,12 +16,14 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.Material;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcPermissions;
@@ -34,9 +36,6 @@ import com.gmail.nossr50.locale.mcLocale;
public class Repair {
/*
* Repair requirements for each material
*/
private static int rGold = LoadProperties.rGold;
private static String nGold = LoadProperties.nGold;
private static int rStone = LoadProperties.rStone;
@@ -51,13 +50,19 @@ public class Repair {
private static String nString = LoadProperties.nString;
private static int rLeather = LoadProperties.rLeather;
private static String nLeather = LoadProperties.nLeather;
private static int dLevel = LoadProperties.repairdiamondlevel;
private static int iLevel = LoadProperties.repairIronLevel;
private static int gLevel = LoadProperties.repairGoldLevel;
private static int sLevel = LoadProperties.repairStoneLevel;
private static boolean spout = LoadProperties.spoutEnabled;
public static void repairCheck(Player player, ItemStack is, Block block){
PlayerProfile PP = Users.getProfile(player);
short durabilityBefore = player.getItemInHand().getDurability();
short durabilityAfter = 0;
short dif = 0;
short durabilityBefore = is.getDurability();
PlayerInventory inventory = player.getInventory();
int skillLevel = PP.getSkillLevel(SkillType.REPAIR);
//Stuff for keeping enchants
Enchantment[] enchants = new Enchantment[is.getEnchantments().size()];
int[] enchantsLevel = new int[is.getEnchantments().size()];
@@ -71,71 +76,39 @@ public class Repair {
}
if(block != null && mcPermissions.getInstance().repair(player)){
if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){
if(durabilityBefore > 0 && is.getAmount() < 2){
/*
* REPAIR ARMOR
*/
if(isArmor(is)){
if(isArmor(is) && LoadProperties.repairArmor){
//DIAMOND ARMOR
if(isDiamondArmor(is) && hasItem(player, rDiamond) && PP.getSkillLevel(SkillType.REPAIR) >= LoadProperties.repairdiamondlevel){
removeItem(player, rDiamond);
if(isDiamondArmor(is) && inventory.contains(rDiamond) && skillLevel >= dLevel){
inventory.removeItem(new ItemStack(rDiamond, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 6); //Boost XP
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 6, true);
}
//IRON ARMOR
else if (isIronArmor(is) && hasItem(player, rIron)){
removeItem(player, rIron);
else if (isIronArmor(is) && inventory.contains(rIron) && skillLevel >= iLevel){
inventory.removeItem(new ItemStack(rIron, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 2); //Boost XP
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 2, true);
}
//GOLD ARMOR
else if (isGoldArmor(is) && hasItem(player, rGold)){
removeItem(player, rGold);
else if (isGoldArmor(is) && inventory.contains(rGold) && skillLevel >= gLevel){
inventory.removeItem(new ItemStack(rGold, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 4); //Boost XP
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 4, true);
}
//LEATHER ARMOR
else if (isLeatherArmor(is) && hasItem(player, rLeather)){
removeItem(player, rLeather);
else if (isLeatherArmor(is) && inventory.contains(rLeather)){
inventory.removeItem(new ItemStack(rLeather, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 1); //Boost XP
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
//UNABLE TO REPAIR
@@ -147,127 +120,48 @@ public class Repair {
/*
* REPAIR TOOLS
*/
if(isTools(is)){
if(isTools(is) && LoadProperties.repairTools){
//STONE TOOLS
if(isStoneTools(is) && hasItem(player, rStone)){
removeItem(player, rStone);
if(isStoneTools(is) && inventory.contains(rStone) && skillLevel >= sLevel){
inventory.removeItem(new ItemStack(rStone, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is))
dif = (short) (dif / 3);
if(m.isSwords(is))
dif = (short) (dif / 2);
if(m.isHoe(is))
dif = (short) (dif / 2);
//STONE NERF
dif = (short) (dif / 2);
PP.addXP(SkillType.REPAIR, dif*10, player);
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
//WOOD TOOLS
else if(isWoodTools(is) && hasItem(player,rWood)){
removeItem(player,rWood);
else if(isWoodTools(is) && inventory.contains(rWood)){
inventory.removeItem(new ItemStack(rWood, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is))
dif = (short) (dif / 3);
if(m.isSwords(is))
dif = (short) (dif / 2);
if(m.isHoe(is))
dif = (short) (dif / 2);
//WOOD NERF
dif = (short) (dif / 2);
PP.addXP(SkillType.REPAIR, dif*10, player);
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
//IRON TOOLS
else if(isIronTools(is) && hasItem(player, rIron)){
removeItem(player, rIron);
else if(isIronTools(is) && inventory.contains(rIron) && skillLevel >= iLevel){
inventory.removeItem(new ItemStack(rIron, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is))
dif = (short) (dif / 3);
if(m.isSwords(is))
dif = (short) (dif / 2);
if(m.isHoe(is))
dif = (short) (dif / 2);
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
//DIAMOND TOOLS
else if (isDiamondTools(is) && hasItem(player, rDiamond) && PP.getSkillLevel(SkillType.REPAIR) >= LoadProperties.repairdiamondlevel){
removeItem(player, rDiamond);
else if (isDiamondTools(is) && inventory.contains(rDiamond) && skillLevel >= dLevel){
inventory.removeItem(new ItemStack(rDiamond, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is))
dif = (short) (dif / 3);
if(m.isSwords(is))
dif = (short) (dif / 2);
if(m.isHoe(is))
dif = (short) (dif / 2);
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
//GOLD TOOLS
else if(isGoldTools(is) && hasItem(player, rGold)){
removeItem(player, rGold);
else if(isGoldTools(is) && inventory.contains(rGold) && skillLevel >= gLevel){
inventory.removeItem(new ItemStack(rGold, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 7.6); //Boost XP for Gold to that of around Iron
if(m.isShovel(is))
dif = (short) (dif / 3);
if(m.isSwords(is))
dif = (short) (dif / 2);
if(m.isHoe(is))
dif = (short) (dif / 2);
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 8, true);
}
//BOW
else if(isBow(is) && hasItem(player, rString)){
removeItem(player, rString);
else if(isBow(is) && inventory.contains(rString)){
inventory.removeItem(new ItemStack(rString, 1));
repairItem(player, enchants, enchantsLevel);
durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
//STRING NERF
dif = (short) (dif / 2);
PP.addXP(SkillType.REPAIR, dif*10, player);
//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
//UNABLE TO REPAIR
@@ -288,22 +182,46 @@ public class Repair {
}
}
public static int getArcaneForgingRank(PlayerProfile PP){
int rank = 0;
if(PP.getSkillLevel(SkillType.REPAIR) >= 750)
rank = 4;
public static void xpHandler(Player player, PlayerProfile PP, ItemStack is, short durabilityBefore, int modify, boolean boost)
{
short durabilityAfter = is.getDurability();
short dif = (short) (durabilityBefore - durabilityAfter);
if(boost)
dif = (short) (dif * modify);
if(!boost)
dif = (short) (dif / modify);
if(m.isShovel(is))
dif = (short) (dif / 3);
if(m.isSwords(is))
dif = (short) (dif / 2);
if(m.isHoe(is))
dif = (short) (dif / 2);
else if (PP.getSkillLevel(SkillType.REPAIR) >= 500)
rank = 3;
PP.addXP(SkillType.REPAIR, dif*10, player);
else if(PP.getSkillLevel(SkillType.REPAIR) >= 250)
rank = 2;
//CLANG CLANG
if(spout)
SpoutStuff.playRepairNoise(player);
}
/**
* Get current Arcane Forging rank.
*
* @param skillLevel The skill level of the player whose rank is being checked
* @return The player's current Arcane Forging rank
*/
public static int getArcaneForgingRank(int skillLevel)
{
if(skillLevel >= LoadProperties.arcaneRank4)
return 4;
if (skillLevel >= LoadProperties.arcaneRank3)
return 3;
if(skillLevel >= LoadProperties.arcaneRank2)
return 2;
if (skillLevel >= LoadProperties.arcaneRank1)
return 1;
else if (PP.getSkillLevel(SkillType.REPAIR) >= 100)
rank = 1;
return rank;
return 0;
}
public static void addEnchants(ItemStack is, Enchantment[] enchants, int[] enchantsLvl, PlayerProfile PP, Player player){
@@ -311,7 +229,7 @@ public class Repair {
return;
int pos = 0;
int rank = getArcaneForgingRank(PP);
int rank = getArcaneForgingRank(PP.getSkillLevel(SkillType.REPAIR));
if(rank == 0)
{
@@ -374,7 +292,15 @@ public class Repair {
player.sendMessage(mcLocale.getString("Repair.Downgraded"));
}
}
public static int getEnchantChance(int rank){
/**
* Gets chance of keeping enchantment during repair.
*
* @param rank Arcane Forging rank
* @return The chance of keeping the enchantment
*/
public static int getEnchantChance(int rank)
{
switch(rank)
{
case 4:
@@ -389,6 +315,13 @@ public class Repair {
return 0;
}
}
/**
* Gets chance of enchantment being downgraded during repair.
*
* @param rank Arcane Forging rank
* @return The chance of the enchantment being downgraded
*/
public static int getDowngradeChance(int rank)
{
switch(rank)
@@ -405,357 +338,253 @@ public class Repair {
return 100;
}
}
public static boolean isArmor(ItemStack is){
return is.getTypeId() == 306 || is.getTypeId() == 307 ||is.getTypeId() == 308 ||is.getTypeId() == 309 || //IRON
is.getTypeId() == 310 ||is.getTypeId() == 311 ||is.getTypeId() == 312 ||is.getTypeId() == 313 || //DIAMOND
is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317 || //GOLD
is.getTypeId() == 298 || is.getTypeId() == 299 || is.getTypeId() == 300 || is.getTypeId() == 301; //LEATHER
return isLeatherArmor(is) || isGoldArmor(is) || isIronArmor(is) || isDiamondArmor(is);
}
public static boolean isLeatherArmor(ItemStack is){
return is.getTypeId() == 298 || is.getTypeId() == 299 || is.getTypeId() == 300 || is.getTypeId() == 301;
}
public static boolean isGoldArmor(ItemStack is){
return is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317;
}
public static boolean isIronArmor(ItemStack is){
return is.getTypeId() == 306 || is.getTypeId() == 307 || is.getTypeId() == 308 || is.getTypeId() == 309;
}
public static boolean isDiamondArmor(ItemStack is){
return is.getTypeId() == 310 || is.getTypeId() == 311 || is.getTypeId() == 312 || is.getTypeId() == 313;
}
public static boolean isTools(ItemStack is)
{
return is.getTypeId() == 359 || is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292 || //IRON
is.getTypeId() == 276 || is.getTypeId() == 277 || is.getTypeId() == 278 || is.getTypeId() == 279 || is.getTypeId() == 293 || //DIAMOND
is.getTypeId() == 283 || is.getTypeId() == 285 || is.getTypeId() == 286 || is.getTypeId() == 284 || is.getTypeId() == 294 || //GOLD
is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290 ||//WOOD
is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275|| is.getTypeId() == 291 || //STONE
is.getTypeId() == 261; //BOW
}
public static boolean isStoneTools(ItemStack is){
return is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275 || is.getTypeId() == 291;
}
public static boolean isWoodTools(ItemStack is){
return is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290;
}
public static boolean isGoldTools(ItemStack is){
return is.getTypeId() == 283 || is.getTypeId() == 285 || is.getTypeId() == 286 || is.getTypeId() == 284 || is.getTypeId() == 294;
}
public static boolean isIronTools(ItemStack is){
return is.getTypeId() == 359 || is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292;
}
public static boolean isDiamondTools(ItemStack is){
return is.getTypeId() == 276 || is.getTypeId() == 277 || is.getTypeId() == 278 || is.getTypeId() == 279 || is.getTypeId() == 293;
}
public static boolean isBow(ItemStack is){
return is.getTypeId() == 261;
}
public static void removeItem(Player player, int typeid)
{
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x != null && x.getTypeId() == typeid){
if(x.getAmount() == 1){
x.setTypeId(0);
x.setAmount(0);
player.getInventory().setContents(inventory);
} else{
x.setAmount(x.getAmount() - 1);
player.getInventory().setContents(inventory);
}
return;
}
}
}
public static boolean hasItem(Player player, int typeid){
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x != null && x.getTypeId() == typeid){
return true;
}
switch(is.getType()){
case LEATHER_BOOTS:
case LEATHER_CHESTPLATE:
case LEATHER_HELMET:
case LEATHER_LEGGINGS:
return true;
}
return false;
}
public static boolean isGoldArmor(ItemStack is){
switch(is.getType()){
case GOLD_BOOTS:
case GOLD_CHESTPLATE:
case GOLD_HELMET:
case GOLD_LEGGINGS:
return true;
}
return false;
}
public static boolean isIronArmor(ItemStack is){
switch(is.getType()){
case IRON_BOOTS:
case IRON_CHESTPLATE:
case IRON_HELMET:
case IRON_LEGGINGS:
return true;
}
return false;
}
public static boolean isDiamondArmor(ItemStack is){
switch(is.getType()){
case DIAMOND_BOOTS:
case DIAMOND_CHESTPLATE:
case DIAMOND_HELMET:
case DIAMOND_LEGGINGS:
return true;
}
return false;
}
public static boolean isTools(ItemStack is)
{
return isStoneTools(is) || isWoodTools(is) || isGoldTools(is) || isIronTools(is) || isDiamondTools(is) || isBow(is);
}
public static boolean isStoneTools(ItemStack is){
switch(is.getType()){
case STONE_AXE:
case STONE_HOE:
case STONE_PICKAXE:
case STONE_SPADE:
case STONE_SWORD:
return true;
}
return false;
}
public static boolean isWoodTools(ItemStack is){
switch(is.getType()){
case WOOD_AXE:
case WOOD_HOE:
case WOOD_PICKAXE:
case WOOD_SPADE:
case WOOD_SWORD:
return true;
}
return false;
}
public static boolean isGoldTools(ItemStack is){
switch(is.getType()){
case GOLD_AXE:
case GOLD_HOE:
case GOLD_PICKAXE:
case GOLD_SPADE:
case GOLD_SWORD:
return true;
}
return false;
}
public static boolean isIronTools(ItemStack is){
switch(is.getType()){
case IRON_AXE:
case IRON_HOE:
case IRON_PICKAXE:
case IRON_SPADE:
case IRON_SWORD:
case SHEARS:
return true;
}
return false;
}
public static boolean isDiamondTools(ItemStack is){
switch(is.getType()){
case DIAMOND_AXE:
case DIAMOND_HOE:
case DIAMOND_PICKAXE:
case DIAMOND_SPADE:
case DIAMOND_SWORD:
return true;
}
return false;
}
public static boolean isBow(ItemStack is){
return is.getType() == Material.BOW;
}
/**
* Computes repair bonuses.
*
* @param player The player repairing an item
* @param durability The durability of the item being repaired
* @param ramt The base amount of durability repaired to the item
* @return The final amount of durability repaired to the item
*/
public static short repairCalculate(Player player, short durability, int ramt){
PlayerProfile PP = Users.getProfile(player);
float bonus = (float)(PP.getSkillLevel(SkillType.REPAIR)) / 500;
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
float bonus = (float)(skillLevel/500);
bonus = (ramt * bonus);
ramt+=bonus;
if(checkPlayerProcRepair(player)){
if(checkPlayerProcRepair(player))
ramt = (short) (ramt * 2);
}
durability-=ramt;
if(durability < 0){
if(durability < 0)
durability = 0;
}
return durability;
}
/**
* Gets the base durability amount to repair an item.
*
* @param is The item being repaired
* @param player The player repairing the item
* @return The final amount of durability repaired to the item
*/
public static short getRepairAmount(ItemStack is, Player player){
short durability = is.getDurability();
short maxDurability = is.getType().getMaxDurability();
int ramt = 0;
switch(is.getTypeId())
{
/*
* TOOLS
*/
//SHEARS
case 359:
ramt = Material.SHEARS.getMaxDurability() / 2;
break;
//BOW
case 261:
ramt = Material.BOW.getMaxDurability() / 3;
break;
/* WOOD TOOLS */
//WOOD SWORD
case 268:
ramt = Material.WOOD_SWORD.getMaxDurability() / 2;
break;
//WOOD SHOVEL
case 269:
ramt = Material.WOOD_SPADE.getMaxDurability();
break;
//WOOD PICKAXE
case 270:
ramt = Material.WOOD_PICKAXE.getMaxDurability() / 3;
break;
//WOOD AXE
case 271:
ramt = Material.WOOD_AXE.getMaxDurability() / 3;
break;
//WOOD HOE
case 290:
ramt = Material.WOOD_HOE.getMaxDurability() / 2;
break;
/* STONE TOOLS */
//STONE SWORD
case 272:
ramt = Material.STONE_SWORD.getMaxDurability() / 2;
break;
//STONE SHOVEL
case 273:
ramt = Material.STONE_SPADE.getMaxDurability();
break;
//STONE PICKAXE
case 274:
ramt = Material.STONE_PICKAXE.getMaxDurability() / 3;
break;
//STONE AXE
case 275:
ramt = Material.STONE_AXE.getMaxDurability() / 3;
break;
//STONE HOE
case 291:
ramt = Material.STONE_HOE.getMaxDurability() / 2;
break;
/* IRON TOOLS */
//IRON SWORD
case 267:
ramt = Material.IRON_SWORD.getMaxDurability() / 2;
break;
//IRON SHOVEL
case 256:
ramt = Material.IRON_SPADE.getMaxDurability();
break;
//IRON PICK
case 257:
ramt = Material.IRON_PICKAXE.getMaxDurability() / 3;
break;
//IRON AXE
case 258:
ramt = Material.IRON_AXE.getMaxDurability() / 3;
break;
//IRON HOE
case 292:
ramt = Material.IRON_HOE.getMaxDurability() / 2;
break;
/* DIAMOND TOOLS */
//DIAMOND SWORD
case 276:
ramt = Material.DIAMOND_SWORD.getMaxDurability() / 2;
break;
//DIAMOND SHOVEL
case 277:
ramt = Material.DIAMOND_SPADE.getMaxDurability();
break;
//DIAMOND PICK
case 278:
ramt = Material.DIAMOND_PICKAXE.getMaxDurability() / 3;
break;
//DIAMOND AXE
case 279:
ramt = Material.DIAMOND_AXE.getMaxDurability() / 3;
break;
//DIAMOND HOE
case 293:
ramt = Material.DIAMOND_HOE.getMaxDurability() / 2;
break;
/* GOLD TOOLS */
//GOLD SWORD
case 283:
ramt = Material.GOLD_SWORD.getMaxDurability() / 2;
break;
//GOLD SHOVEL
case 284:
ramt = Material.GOLD_SPADE.getMaxDurability();
break;
//GOLD PICK
case 285:
ramt = Material.GOLD_PICKAXE.getMaxDurability() / 3;
break;
//GOLD AXE
case 286:
ramt = Material.GOLD_AXE.getMaxDurability() / 3;
break;
//GOLD HOE
case 294:
ramt = Material.GOLD_HOE.getMaxDurability() / 2;
break;
/*
* ARMOR
*/
/* IRON ARMOR */
//IRON HELMET
case 306:
ramt = Material.IRON_HELMET.getMaxDurability() / 5;
break;
//IRON CHESTPLATE
case 307:
ramt = Material.IRON_CHESTPLATE.getMaxDurability() / 8;
break;
//IRON LEGGINGS
case 308:
ramt = Material.IRON_LEGGINGS.getMaxDurability() / 7;
break;
//IRON BOOTS
case 309:
ramt = Material.IRON_BOOTS.getMaxDurability() / 4;
break;
/* DIAMOND ARMOR */
//DIAMOND HELMET
case 310:
ramt = Material.DIAMOND_HELMET.getMaxDurability() / 5;
break;
//DIAMOND CHESTPLATE
case 311:
ramt = Material.DIAMOND_CHESTPLATE.getMaxDurability() / 8;
break;
//DIAMOND LEGGINGS
case 312:
ramt = Material.DIAMOND_LEGGINGS.getMaxDurability() / 7;
break;
//DIAMOND BOOTS
case 313:
ramt = Material.DIAMOND_BOOTS.getMaxDurability() / 4;
break;
/* GOLD ARMOR */
//GOLD HELMET
case 314:
ramt = Material.GOLD_HELMET.getMaxDurability() / 5;
break;
//GOLD CHESTPLATE
case 315:
ramt = Material.GOLD_CHESTPLATE.getMaxDurability() / 8;
break;
//GOLD LEGGINGS
case 316:
ramt = Material.GOLD_LEGGINGS.getMaxDurability() / 7;
break;
//GOLD BOOTS
case 317:
ramt = Material.GOLD_BOOTS.getMaxDurability() / 4;
break;
/* LEATHER ARMOR */
//LEATHER HELMET
case 298:
ramt = Material.LEATHER_HELMET.getMaxDurability() / 5;
break;
//LEATHER CHESTPLATE
case 299:
ramt = Material.LEATHER_CHESTPLATE.getMaxDurability() / 8;
break;
//LEATHER LEGGINGS
case 300:
ramt = Material.LEATHER_LEGGINGS.getMaxDurability() / 7;
break;
//LEATHER BOOTS
case 301:
ramt = Material.LEATHER_BOOTS.getMaxDurability() / 4;
break;
}
if(m.isShovel(is))
ramt = maxDurability;
else if(m.isHoe(is) || m.isSwords(is) || is.getTypeId() == 359)
ramt = maxDurability / 2;
else if(m.isAxes(is) || m.isMiningPick(is) || isBow(is))
ramt = maxDurability / 3;
else if(m.isBoots(is))
ramt = maxDurability / 4;
else if(m.isHelmet(is))
ramt = maxDurability / 5;
else if(m.isPants(is))
ramt = maxDurability / 7;
else if(m.isChestplate(is))
ramt = maxDurability / 8;
return repairCalculate(player, durability, ramt);
}
/**
* Informs a player that the repair has failed.
*
* @param is The item being repaired
* @param player The player repairing the item
*/
public static void needMoreVespeneGas(ItemStack is, Player player)
{
PlayerProfile PP = Users.getProfile(player);
if ((isDiamondTools(is) || isDiamondArmor(is)) && PP.getSkillLevel(SkillType.REPAIR) < LoadProperties.repairdiamondlevel)
{
player.sendMessage(mcLocale.getString("Skills.AdeptDiamond"));
} else if (isDiamondTools(is) && !hasItem(player, rDiamond) || isIronTools(is) && !hasItem(player, rIron) || isGoldTools(is) && !hasItem(player, rGold)){
if(isDiamondTools(is) && !hasItem(player, rDiamond))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.BLUE+ nDiamond);
if(isIronTools(is) && !hasItem(player, rIron))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GRAY+ nIron);
if(isGoldTools(is) && !hasItem(player, rGold))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GOLD+nGold);
if(isWoodTools(is) && !hasItem(player,rWood))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.DARK_GREEN+ nWood);
if(isStoneTools(is) && !hasItem(player, rStone))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GRAY+nStone);
} else if (isDiamondArmor(is) && !hasItem(player, rDiamond)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.BLUE+ nDiamond);
} else if (isIronArmor(is) && !hasItem(player, rIron)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GRAY+ nIron);
} else if (isGoldArmor(is) && !hasItem(player, rGold)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GOLD+ nGold);
} else if (isLeatherArmor(is) && !hasItem(player, rLeather)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.YELLOW+ nLeather);
} else if (isBow(is) && !hasItem(player, rString)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.YELLOW+ nString);
} else if (is.getAmount() > 1)
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
if(is.getAmount() > 1)
player.sendMessage(mcLocale.getString("Skills.StackedItems"));
else
{
if(isDiamondTools(is) || isDiamondArmor(is))
{
if(skillLevel < LoadProperties.repairdiamondlevel)
player.sendMessage(mcLocale.getString("Skills.AdeptDiamond"));
else
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.BLUE+ nDiamond);
}
else if(isIronTools(is) || isIronArmor(is))
{
if(skillLevel < LoadProperties.repairIronLevel)
player.sendMessage(mcLocale.getString("Skills.AdeptIron"));
else
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GRAY+ nIron);
}
else if(isGoldTools(is) || isGoldArmor(is))
{
if(skillLevel < LoadProperties.repairGoldLevel)
player.sendMessage(mcLocale.getString("Skills.AdeptGold"));
else
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GOLD+nGold);
}
else if(isStoneTools(is))
{
if(skillLevel < LoadProperties.repairStoneLevel)
player.sendMessage(mcLocale.getString("Skills.AdeptStone"));
else
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GRAY+nStone);
}
else if(isWoodTools(is))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.DARK_GREEN+ nWood);
else if (isLeatherArmor(is))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.YELLOW+ nLeather);
else if (isBow(is))
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.YELLOW+ nString);
}
}
/**
* Checks for Super Repair bonus.
*
* @param player The player repairing an item.
* @return true if bonus granted, false otherwise
*/
public static boolean checkPlayerProcRepair(Player player)
{
PlayerProfile PP = Users.getProfile(player);
if(player != null)
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
if(skillLevel > 1000 || (Math.random() * 1000 <= skillLevel))
{
if((Math.random() * 1000 <= PP.getSkillLevel(SkillType.REPAIR)) || PP.getSkillLevel(SkillType.REPAIR) > 1000)
{
player.sendMessage(mcLocale.getString("Skills.FeltEasy"));
return true;
}
player.sendMessage(mcLocale.getString("Skills.FeltEasy"));
return true;
}
return false;
}
/**
* Repairs an item.
*
* @param player The player repairing an item
* @param enchants The enchantments on the item
* @param enchantsLevel The level of the enchantments on the item
*/
public static void repairItem(Player player, Enchantment[] enchants, int[] enchantsLevel)
{
PlayerProfile PP = Users.getProfile(player);
ItemStack is = player.getItemInHand();
//Handle the enchantments
addEnchants(player.getItemInHand(), enchants, enchantsLevel, PP, player);
player.getItemInHand().setDurability(getRepairAmount(is, player));
addEnchants(is, enchants, enchantsLevel, PP, player);
is.setDurability(getRepairAmount(is, player));
}
}

View File

@@ -20,285 +20,116 @@ import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer;
import com.gmail.nossr50.Leaderboard;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.PlayerStat;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.datatypes.ToolType;
import com.gmail.nossr50.events.McMMOPlayerLevelUpEvent;
import com.gmail.nossr50.locale.mcLocale;
public class Skills
{
protected static final Logger log = Logger.getLogger("Minecraft");
public void updateSQLfromFile(Player player){
}
public static boolean cooldownOver(Player player, long oldTime, int cooldown){
long currentTime = System.currentTimeMillis();
if(currentTime - oldTime >= (cooldown * 1000)){
if(currentTime - oldTime >= (cooldown * 1000))
return true;
} else {
else
return false;
}
}
public boolean hasArrows(Player player){
for(ItemStack x : player.getInventory().getContents()){
if (x.getTypeId() == 262){
return true;
}
}
return false;
}
public void addArrows(Player player){
for(ItemStack x : player.getInventory().getContents()){
if (x.getTypeId() == 262){
x.setAmount(x.getAmount() + 1);
return;
}
}
}
public static int calculateTimeLeft(Player player, long deactivatedTimeStamp, int cooldown)
{
return (int) (((deactivatedTimeStamp + (cooldown * 1000)) - System.currentTimeMillis())/1000);
}
public static void watchCooldowns(Player player, PlayerProfile PP, long curTime){
if(!PP.getGreenTerraInformed() && curTime - (PP.getGreenTerraDeactivatedTimeStamp()*1000) >= (LoadProperties.greenTerraCooldown * 1000)){
PP.setGreenTerraInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourGreenTerra"));
}
if(!PP.getTreeFellerInformed() && curTime - (PP.getTreeFellerDeactivatedTimeStamp()*1000) >= (LoadProperties.greenTerraCooldown * 1000)){
PP.setTreeFellerInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourTreeFeller"));
}
if(!PP.getSuperBreakerInformed() && curTime - (PP.getSuperBreakerDeactivatedTimeStamp()*1000) >= (LoadProperties.superBreakerCooldown * 1000)){
PP.setSuperBreakerInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourSuperBreaker"));
}
if(!PP.getSerratedStrikesInformed() && curTime - (PP.getSerratedStrikesDeactivatedTimeStamp()*1000) >= (LoadProperties.serratedStrikeCooldown * 1000)){
PP.setSerratedStrikesInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourSerratedStrikes"));
}
if(!PP.getBerserkInformed() && curTime - (PP.getBerserkDeactivatedTimeStamp()*1000) >= (LoadProperties.berserkCooldown * 1000)){
PP.setBerserkInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourBerserk"));
}
if(!PP.getSkullSplitterInformed() && curTime - (PP.getSkullSplitterDeactivatedTimeStamp()*1000) >= (LoadProperties.skullSplitterCooldown * 1000)){
PP.setSkullSplitterInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourSkullSplitter"));
}
if(!PP.getGigaDrillBreakerInformed() && curTime - (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000) >= (LoadProperties.gigaDrillBreakerCooldown * 1000)){
PP.setGigaDrillBreakerInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourGigaDrillBreaker"));
public static void watchCooldown(Player player, PlayerProfile PP, long curTime, AbilityType ability)
{
if(!ability.getInformed(PP) && curTime - (PP.getSkillDATS(ability) * 1000) >= (ability.getCooldown() * 1000))
{
ability.setInformed(PP, true);
player.sendMessage(ability.getAbilityRefresh());
}
}
public static void hoeReadinessCheck(Player player)
public static void activationCheck(Player player, SkillType skill)
{
if(LoadProperties.enableOnlyActivateWhenSneaking && !player.isSneaking())
return;
PlayerProfile PP = Users.getProfile(player);
if(mcPermissions.getInstance().herbalismAbility(player) && m.isHoe(player.getItemInHand()) && !PP.getHoePreparationMode()){
if(!PP.getGreenTerraMode() && !cooldownOver(player, (PP.getGreenTerraDeactivatedTimeStamp()*1000), LoadProperties.greenTerraCooldown)){
player.sendMessage(mcLocale.getString("Skills.TooTired")
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getGreenTerraDeactivatedTimeStamp()*1000), LoadProperties.greenTerraCooldown)+"s)");
return;
}
if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyHoe"));
PP.setHoePreparationATS(System.currentTimeMillis());
PP.setHoePreparationMode(true);
}
}
public static void monitorSkills(Player player, PlayerProfile PP) {
monitorSkills(player, PP, System.currentTimeMillis());
}
public static void monitorSkills(Player player, PlayerProfile PP, long curTime){
if(PP.getHoePreparationMode() && curTime - (PP.getHoePreparationATS()*1000) >= 4000){
PP.setHoePreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerHoe"));
}
if(PP.getAxePreparationMode() && curTime - (PP.getAxePreparationATS()*1000) >= 4000){
PP.setAxePreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerAxe"));
}
if(PP.getPickaxePreparationMode() && curTime - (PP.getPickaxePreparationATS()*1000) >= 4000){
PP.setPickaxePreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerPickAxe"));
}
if(PP.getSwordsPreparationMode() && curTime - (PP.getSwordsPreparationATS()*1000) >= 4000){
PP.setSwordsPreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerSword"));
}
if(PP.getFistsPreparationMode() && curTime - (PP.getFistsPreparationATS()*1000) >= 4000){
PP.setFistsPreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerFists"));
}
if(PP.getShovelPreparationMode() && curTime - (PP.getShovelPreparationATS()*1000) >= 4000){
PP.setShovelPreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerShovel"));
}
/*
* HERBALISM ABILITY
*/
if(mcPermissions.getInstance().herbalismAbility(player)){
if(PP.getGreenTerraMode() && (PP.getGreenTerraDeactivatedTimeStamp()*1000) <= curTime){
PP.setGreenTerraMode(false);
PP.setGreenTerraInformed(false);
player.sendMessage(mcLocale.getString("Skills.GreenTerraOff"));
}
}
/*
* AXES ABILITY
*/
if(mcPermissions.getInstance().axesAbility(player)){
if(PP.getSkullSplitterMode() && (PP.getSkullSplitterDeactivatedTimeStamp()*1000) <= curTime){
PP.setSkullSplitterMode(false);
PP.setSkullSplitterInformed(false);
player.sendMessage(mcLocale.getString("Skills.SkullSplitterOff"));
}
}
/*
* WOODCUTTING ABILITY
*/
if(mcPermissions.getInstance().woodCuttingAbility(player)){
if(PP.getTreeFellerMode() && (PP.getTreeFellerDeactivatedTimeStamp()*1000) <= curTime){
PP.setTreeFellerMode(false);
PP.setTreeFellerInformed(false);
player.sendMessage(mcLocale.getString("Skills.TreeFellerOff"));
}
}
/*
* MINING ABILITY
*/
if(mcPermissions.getInstance().miningAbility(player)){
if(PP.getSuperBreakerMode() && (PP.getSuperBreakerDeactivatedTimeStamp()*1000) <= curTime){
PP.setSuperBreakerMode(false);
PP.setSuperBreakerInformed(false);
player.sendMessage(mcLocale.getString("Skills.SuperBreakerOff"));
}
}
/*
* EXCAVATION ABILITY
*/
if(mcPermissions.getInstance().excavationAbility(player)){
if(PP.getGigaDrillBreakerMode() && (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000) <= curTime){
PP.setGigaDrillBreakerMode(false);
PP.setGigaDrillBreakerInformed(false);
player.sendMessage(mcLocale.getString("Skills.GigaDrillBreakerOff"));
}
}
/*
* SWORDS ABILITY
*/
if(mcPermissions.getInstance().swordsAbility(player)){
if(PP.getSerratedStrikesMode() && (PP.getSerratedStrikesDeactivatedTimeStamp()*1000) <= curTime){
PP.setSerratedStrikesMode(false);
PP.setSerratedStrikesInformed(false);
player.sendMessage(mcLocale.getString("Skills.SerratedStrikesOff"));
}
}
/*
* UNARMED ABILITY
*/
if(mcPermissions.getInstance().unarmedAbility(player)){
if(PP.getBerserkMode() && (PP.getBerserkDeactivatedTimeStamp()*1000) <= curTime){
PP.setBerserkMode(false);
PP.setBerserkInformed(false);
player.sendMessage(mcLocale.getString("Skills.BerserkOff"));
}
}
}
public static void abilityActivationCheck(Player player)
{
if(LoadProperties.enableOnlyActivateWhenSneaking && !player.isSneaking())
return;
PlayerProfile PP = Users.getProfile(player);
if(PP != null)
AbilityType ability = skill.getAbility();
ToolType tool = skill.getTool();
if(!PP.getAbilityUse() || PP.getSuperBreakerMode() || PP.getSerratedStrikesMode() || PP.getTreeFellerMode() || PP.getGreenTerraMode() || PP.getBerserkMode() || PP.getGigaDrillBreakerMode())
return;
//Woodcutting & Axes need to be treated differently
//Basically the tool always needs to ready and we check to see if the cooldown is over when the user takes action
if(skill == SkillType.WOODCUTTING || skill == SkillType.AXES)
{
if(!PP.getAbilityUse() || PP.getSuperBreakerMode() || PP.getSerratedStrikesMode() || PP.getTreeFellerMode() || PP.getGreenTerraMode() || PP.getBerserkMode() || PP.getGigaDrillBreakerMode())
return;
if(mcPermissions.getInstance().miningAbility(player) && m.isMiningPick(player.getItemInHand()) && !PP.getPickaxePreparationMode())
{
if(!PP.getSuperBreakerMode() && !cooldownOver(player, (PP.getSuperBreakerDeactivatedTimeStamp()*1000), LoadProperties.superBreakerCooldown))
{
player.sendMessage(mcLocale.getString("Skills.TooTired")
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getSuperBreakerDeactivatedTimeStamp()*1000), LoadProperties.superBreakerCooldown)+"s)");
return;
}
if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyPickAxe"));
PP.setPickaxePreparationATS(System.currentTimeMillis());
PP.setPickaxePreparationMode(true);
}
if(mcPermissions.getInstance().excavationAbility(player) && m.isShovel(player.getItemInHand()) && !PP.getShovelPreparationMode())
{
if(!PP.getGigaDrillBreakerMode() && !cooldownOver(player, (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000), LoadProperties.gigaDrillBreakerCooldown))
{
player.sendMessage(mcLocale.getString("Skills.TooTired")
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000), LoadProperties.gigaDrillBreakerCooldown)+"s)");
return;
}
if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyShovel"));
PP.setShovelPreparationATS(System.currentTimeMillis());
PP.setShovelPreparationMode(true);
}
if(mcPermissions.getInstance().swordsAbility(player) && m.isSwords(player.getItemInHand()) && !PP.getSwordsPreparationMode())
{
if(!PP.getSerratedStrikesMode() && !cooldownOver(player, (PP.getSerratedStrikesDeactivatedTimeStamp()*1000), LoadProperties.serratedStrikeCooldown))
{
player.sendMessage(mcLocale.getString("Skills.TooTired")
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getSerratedStrikesDeactivatedTimeStamp()*1000), LoadProperties.serratedStrikeCooldown)+"s)");
return;
}
if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadySword"));
PP.setSwordsPreparationATS(System.currentTimeMillis());
PP.setSwordsPreparationMode(true);
}
if(mcPermissions.getInstance().unarmedAbility(player) && player.getItemInHand().getTypeId() == 0 && !PP.getFistsPreparationMode())
{
if(!PP.getBerserkMode() && !cooldownOver(player, (PP.getBerserkDeactivatedTimeStamp()*1000), LoadProperties.berserkCooldown))
{
player.sendMessage(mcLocale.getString("Skills.TooTired")
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getBerserkDeactivatedTimeStamp()*1000), LoadProperties.berserkCooldown)+"s)");
return;
}
if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyFists"));
PP.setFistsPreparationATS(System.currentTimeMillis());
PP.setFistsPreparationMode(true);
}
if((mcPermissions.getInstance().axesAbility(player) || mcPermissions.getInstance().woodCuttingAbility(player)) && !PP.getAxePreparationMode())
{
if(m.isAxes(player.getItemInHand()))
{
if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyAxe"));
PP.setAxePreparationATS(System.currentTimeMillis());
PP.setAxePreparationMode(true);
}
}
if(tool.inHand(player.getItemInHand()) && !tool.getToolMode(PP))
{
if(LoadProperties.enableAbilityMessages)
player.sendMessage(tool.getRaiseTool());
tool.setToolATS(PP, System.currentTimeMillis());
tool.setToolMode(PP, true);
}
} else if(ability.getPermissions(player) && tool.inHand(player.getItemInHand()) && !tool.getToolMode(PP))
{
if(!ability.getMode(PP) && !cooldownOver(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()))
{
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()) + "s)");
return;
}
if(LoadProperties.enableAbilityMessages)
player.sendMessage(tool.getRaiseTool());
tool.setToolATS(PP, System.currentTimeMillis());
tool.setToolMode(PP, true);
}
}
public static void monitorSkill(Player player, PlayerProfile PP, long curTime, SkillType skill)
{
ToolType tool = skill.getTool();
AbilityType ability = skill.getAbility();
if(tool.getToolMode(PP) && curTime - (tool.getToolATS(PP) * 1000) >= 4000)
{
tool.setToolMode(PP, false);
player.sendMessage(tool.getLowerTool());
}
if(ability.getPermissions(player))
{
if(ability.getMode(PP) && (PP.getSkillDATS(ability) * 1000) <= curTime)
{
ability.setMode(PP, false);
ability.setInformed(PP, false);
player.sendMessage(ability.getAbilityOff());
for(Player y : player.getWorld().getPlayers())
{
if(y != player && m.isNear(player.getLocation(), y.getLocation(), 10))
y.sendMessage(ability.getAbilityPlayerOff(player));
}
}
}
}
public static void ProcessLeaderboardUpdate(SkillType skillType, Player player)
{
@@ -315,11 +146,6 @@ public class Skills
public static void XpCheckSkill(SkillType skillType, Player player)
{
if(skillType == SkillType.ALL) {
XpCheckAll(player);
return;
}
PlayerProfile PP = Users.getProfile(player);
if(PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType))
@@ -328,14 +154,18 @@ public class Skills
while(PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType))
{
if(getSkillMaxLevel(skillType) >= PP.getSkillLevel(skillType) + 1) {
if(skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1)
{
skillups++;
PP.removeXP(skillType, PP.getXpToLevel(skillType));
PP.skillUp(skillType, 1);
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
Bukkit.getPluginManager().callEvent(eventToFire);
} else
{
PP.removeXP(skillType, PP.getXpToLevel(skillType));
}
PP.removeXP(skillType, PP.getXpToLevel(skillType));
}
if(!LoadProperties.useMySQL)
@@ -383,36 +213,7 @@ public class Skills
XpCheckSkill(x, player);
}
}
public static int getSkillMaxLevel(SkillType skillType) {
switch(skillType) {
case ACROBATICS:
return (LoadProperties.levelCapAcrobatics > 0) ? LoadProperties.levelCapAcrobatics : Integer.MAX_VALUE;
case ARCHERY:
return (LoadProperties.levelCapArchery > 0) ? LoadProperties.levelCapArchery : Integer.MAX_VALUE;
case AXES:
return (LoadProperties.levelCapAxes > 0) ? LoadProperties.levelCapAxes : Integer.MAX_VALUE;
case EXCAVATION:
return (LoadProperties.levelCapExcavation > 0) ? LoadProperties.levelCapExcavation : Integer.MAX_VALUE;
case FISHING:
return (LoadProperties.levelCapFishing > 0) ? LoadProperties.levelCapFishing : Integer.MAX_VALUE;
case HERBALISM:
return (LoadProperties.levelCapHerbalism > 0) ? LoadProperties.levelCapHerbalism : Integer.MAX_VALUE;
case MINING:
return (LoadProperties.levelCapMining > 0) ? LoadProperties.levelCapMining : Integer.MAX_VALUE;
case REPAIR:
return (LoadProperties.levelCapRepair > 0) ? LoadProperties.levelCapRepair : Integer.MAX_VALUE;
case SWORDS:
return (LoadProperties.levelCapSwords > 0) ? LoadProperties.levelCapSwords : Integer.MAX_VALUE;
case TAMING:
return (LoadProperties.levelCapTaming > 0) ? LoadProperties.levelCapTaming : Integer.MAX_VALUE;
case UNARMED:
return (LoadProperties.levelCapUnarmed > 0) ? LoadProperties.levelCapUnarmed : Integer.MAX_VALUE;
case WOODCUTTING:
return (LoadProperties.levelCapWoodcutting > 0) ? LoadProperties.levelCapWoodcutting : Integer.MAX_VALUE;
default:
return Integer.MAX_VALUE;
}
}
public static SkillType getSkillType(String skillName)
{
for(SkillType x : SkillType.values())
@@ -422,6 +223,7 @@ public class Skills
}
return null;
}
public static boolean isSkill(String skillname){
skillname = skillname.toUpperCase();
for(SkillType x : SkillType.values())
@@ -431,19 +233,8 @@ public class Skills
}
return false;
}
public static void arrowRetrievalCheck(Entity entity, mcMMO plugin)
{
if(plugin.misc.arrowTracker.containsKey(entity))
{
Integer x = 0;
while(x < plugin.misc.arrowTracker.get(entity))
{
m.mcDropItem(entity.getLocation(), 262);
x++;
}
}
plugin.misc.arrowTracker.remove(entity);
}
//We should probably rework this - it's a fairly ugly way to do this, compared to our other command formatting.
public static String getSkillStats(String skillname, Integer level, Integer XP, Integer XPToLevel)
{
ChatColor parColor = ChatColor.DARK_AQUA;
@@ -453,6 +244,7 @@ public class Skills
return skillColor+skillname+LvlColor+level+parColor+" XP"+"("+xpColor+XP+parColor+"/"+xpColor+XPToLevel+parColor+")";
}
public static boolean hasCombatSkills(Player player)
{
if(mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().archery(player) || mcPermissions.getInstance().swords(player) || mcPermissions.getInstance().taming(player) || mcPermissions.getInstance().unarmed(player))
@@ -460,13 +252,15 @@ public class Skills
else
return false;
}
public static boolean hasGatheringSkills(Player player)
{
if(mcPermissions.getInstance().excavation(player) || mcPermissions.getInstance().herbalism(player) || mcPermissions.getInstance().mining(player) || mcPermissions.getInstance().woodcutting(player))
if(mcPermissions.getInstance().excavation(player) || mcPermissions.getInstance().fishing(player) || mcPermissions.getInstance().herbalism(player) || mcPermissions.getInstance().mining(player) || mcPermissions.getInstance().woodcutting(player))
return true;
else
return false;
}
public static boolean hasMiscSkills(Player player)
{
if(mcPermissions.getInstance().acrobatics(player) || mcPermissions.getInstance().repair(player))
@@ -474,4 +268,44 @@ public class Skills
else
return false;
}
/**
* Check to see if an ability can be activated.
*
* @param player The player activating the ability
* @param type The skill the ability is based on
*/
public static void abilityCheck(Player player, SkillType type)
{
PlayerProfile PP = Users.getProfile(player);
AbilityType ability = type.getAbility();
if(type.getTool().inHand(player.getItemInHand()))
{
if(type.getTool().getToolMode(PP))
type.getTool().setToolMode(PP, false);
//Axes and Woodcutting are odd because they share the same tool so we show them the too tired message when they take action
if(type == SkillType.WOODCUTTING || type == SkillType.AXES)
{
if(!ability.getMode(PP) && !cooldownOver(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()))
{
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()) + "s)");
return;
}
}
int ticks = 2 + (PP.getSkillLevel(type) / 50);
if(!ability.getMode(PP) && cooldownOver(player, PP.getSkillDATS(ability), ability.getCooldown()))
{
player.sendMessage(ability.getAbilityOn());
for(Player y : player.getWorld().getPlayers())
{
if(y != player && m.isNear(player.getLocation(), y.getLocation(), 10))
y.sendMessage(ability.getAbilityPlayer(player));
}
PP.setSkillDATS(ability, System.currentTimeMillis()+(ticks*1000));
ability.setMode(PP, true);
}
}
}
}

View File

@@ -16,8 +16,6 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.ChatColor;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@@ -35,38 +33,6 @@ import com.gmail.nossr50.party.Party;
public class Swords
{
public static void serratedStrikesActivationCheck(Player player){
PlayerProfile PP = Users.getProfile(player);
if(m.isSwords(player.getItemInHand()))
{
if(PP.getSwordsPreparationMode())
{
PP.setSwordsPreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.SWORDS);
while(x >= 50)
{
x-=50;
ticks++;
}
if(!PP.getSerratedStrikesMode() && PP.getSerratedStrikesDeactivatedTimeStamp() < System.currentTimeMillis())
{
player.sendMessage(mcLocale.getString("Skills.SerratedStrikesOn"));
for(Player y : player.getWorld().getPlayers())
{
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.SerratedStrikesPlayer", new Object[] {player.getName()}));
}
PP.setSerratedStrikesActivatedTimeStamp(System.currentTimeMillis());
PP.setSerratedStrikesDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setSerratedStrikesMode(true);
}
}
}
public static void bleedCheck(Player attacker, LivingEntity x, mcMMO pluginx)
{
PlayerProfile PPa = Users.getProfile(attacker);
@@ -74,18 +40,19 @@ public class Swords
if(x instanceof Wolf)
{
Wolf wolf = (Wolf)x;
if(Taming.getOwner(wolf, pluginx) != null)
if(wolf.getOwner() instanceof Player)
{
if(Taming.getOwner(wolf, pluginx) == attacker)
Player owner = (Player) wolf.getOwner();
if(owner == attacker)
return;
if(Party.getInstance().inSameParty(attacker, Taming.getOwner(wolf, pluginx)))
if(Party.getInstance().inSameParty(attacker, owner))
return;
}
}
if(mcPermissions.getInstance().swords(attacker) && m.isSwords(attacker.getItemInHand())){
if(PPa.getSkillLevel(SkillType.SWORDS) >= 750)
{
if(Math.random() * 1000 >= 750)
if(Math.random() * 1000 <= 750)
{
if(!(x instanceof Player))
pluginx.misc.addToBleedQue(x);
@@ -94,7 +61,7 @@ public class Swords
Player target = (Player)x;
Users.getProfile(target).addBleedTicks(3);
}
attacker.sendMessage(ChatColor.GREEN+"**ENEMY BLEEDING**");
attacker.sendMessage(mcLocale.getString("Swords.EnemyBleeding"));
}
}
else if (Math.random() * 1000 <= PPa.getSkillLevel(SkillType.SWORDS))
@@ -106,7 +73,7 @@ public class Swords
Player target = (Player)x;
Users.getProfile(target).addBleedTicks(2);
}
attacker.sendMessage(ChatColor.GREEN+"**ENEMY BLEEDING**");
attacker.sendMessage(mcLocale.getString("Swords.EnemyBleeding"));
}
}
}
@@ -114,72 +81,77 @@ public class Swords
{
int targets = 0;
int dmgAmount = (event.getDamage()/4);
//Setup minimum damage
if(dmgAmount < 1)
dmgAmount = 1;
if(event.getEntity() instanceof LivingEntity)
{
LivingEntity x = (LivingEntity) event.getEntity();
targets = m.getTier(attacker);
for(Entity derp : x.getWorld().getEntities())
for(Entity derp : x.getNearbyEntities(2.5, 2.5, 2.5))
{
if(m.getDistance(x.getLocation(), derp.getLocation()) < 5)
{
//Make sure the Wolf is not friendly
if(derp instanceof Wolf)
//Make sure the Wolf is not friendly
if(derp instanceof Wolf)
{
Wolf hurrDurr = (Wolf)derp;
if(hurrDurr.getOwner() instanceof Player)
{
Player owner = (Player) hurrDurr.getOwner();
if(owner == attacker)
return;
if(Party.getInstance().inSameParty(attacker, owner))
return;
}
}
//Damage nearby LivingEntities
if(derp instanceof LivingEntity && targets >= 1)
{
if(derp instanceof Player)
{
Wolf hurrDurr = (Wolf)derp;
if(Taming.getOwner(hurrDurr, pluginx) == attacker)
continue;
if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx)))
continue;
}
//Damage nearby LivingEntities
if(derp instanceof LivingEntity && targets >= 1)
Player target = (Player)derp;
if(target.getName().equals(attacker.getName()))
continue;
if(Users.getProfile(target).getGodMode())
continue;
if(Party.getInstance().inSameParty(attacker, target))
continue;
if(targets >= 1 && derp.getWorld().getPVP())
{
Combat.dealDamage(target, dmgAmount, attacker);
target.sendMessage(mcLocale.getString("Swords.HitBySerratedStrikes"));
Users.getProfile(target).addBleedTicks(5);
targets--;
continue;
}
}
else
{
if(derp instanceof Player)
{
Player target = (Player)derp;
if(target.getName().equals(attacker.getName()))
continue;
if(Users.getProfile(target).getGodMode())
continue;
if(Party.getInstance().inSameParty(attacker, target))
continue;
if(targets >= 1 && derp.getWorld().getPVP())
{
Combat.dealDamage(target, event.getDamage() / 4, attacker);
target.sendMessage(ChatColor.DARK_RED+"Struck by Serrated Strikes!");
Users.getProfile(target).addBleedTicks(5);
targets--;
continue;
}
}
else
{
if(!pluginx.misc.bleedTracker.contains(derp))
pluginx.misc.addToBleedQue((LivingEntity)derp);
LivingEntity target = (LivingEntity)derp;
Combat.dealDamage(target, event.getDamage() / 4, attacker);
targets--;
}
if(!pluginx.misc.bleedTracker.contains(derp))
pluginx.misc.addToBleedQue((LivingEntity)derp);
LivingEntity target = (LivingEntity)derp;
Combat.dealDamage(target, dmgAmount, attacker);
targets--;
}
}
}
}
}
}
}
}
public static void counterAttackChecks(EntityDamageByEntityEvent event)
{
//Don't want to counter attack arrows
//Don't want to counter attack stuff not alive
if(event.getDamager() instanceof Arrow)
if(!(event.getDamager() instanceof LivingEntity))
return;
if(event instanceof EntityDamageByEntityEvent)
{
Entity f = ((EntityDamageByEntityEvent) event).getDamager();
@@ -194,22 +166,23 @@ public class Swords
if(Math.random() * 2000 <= 600)
{
Combat.dealDamage((LivingEntity) f, event.getDamage() / 2);
defender.sendMessage(ChatColor.GREEN+"**COUNTER-ATTACKED**");
defender.sendMessage(mcLocale.getString("Swords.CounterAttacked"));
if(f instanceof Player)
((Player) f).sendMessage(ChatColor.DARK_RED+"Hit with counterattack!");
((Player) f).sendMessage(mcLocale.getString("Swords.HitByCounterAttack"));
}
}
else if (Math.random() * 2000 <= PPd.getSkillLevel(SkillType.SWORDS))
{
Combat.dealDamage((LivingEntity) f, event.getDamage() / 2);
defender.sendMessage(ChatColor.GREEN+"**COUNTER-ATTACKED**");
defender.sendMessage(mcLocale.getString("Swords.CounterAttacked"));
if(f instanceof Player)
((Player) f).sendMessage(ChatColor.DARK_RED+"Hit with counterattack!");
((Player) f).sendMessage(mcLocale.getString("Swords.HitByCounterAttack"));
}
}
}
}
}
public static void bleedSimulate(mcMMO plugin)
{
//Add items from Que list to BleedTrack list
@@ -236,9 +209,7 @@ public class Swords
//Bleed monsters/animals
for(LivingEntity x : plugin.misc.bleedTracker)
{
if(x == null){continue;}
if(x.getHealth() <= 0)
if(x == null || x.isDead())
{
plugin.misc.addToBleedRemovalQue(x);
continue;

View File

@@ -1,60 +1,100 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.skills;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Wolf;
import org.bukkit.plugin.Plugin;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
public class Taming
{
public static boolean ownerOnline(Wolf theWolf, Plugin pluginx)
public static void rewardXp(EntityDamageEvent event, mcMMO pluginx, Player master)
{
for(Player x : pluginx.getServer().getOnlinePlayers())
Entity entity = event.getEntity();
if(!pluginx.misc.mobSpawnerList.contains(entity.getEntityId()))
{
if(x instanceof AnimalTamer)
int xp = Combat.getXp(entity, event.getDamage());
Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master);
if(entity instanceof Player)
{
AnimalTamer tamer = (AnimalTamer)x;
if(theWolf.getOwner() == tamer)
return true;
xp = (event.getDamage() * 2);
Users.getProfile(master).addXP(SkillType.TAMING, (int)((xp*10)*1.5), master);
}
Skills.XpCheckSkill(SkillType.TAMING, master);
}
return false;
}
public static Player getOwner(Entity wolf, Plugin pluginx)
public static void fastFoodService(PlayerProfile PPo, Wolf theWolf, EntityDamageEvent event)
{
if(wolf instanceof Wolf)
int health = theWolf.getHealth();
int maxHealth = theWolf.getMaxHealth();
int damage = event.getDamage();
if(PPo.getSkillLevel(SkillType.TAMING) >= 50)
{
Wolf theWolf = (Wolf)wolf;
for(Player x : pluginx.getServer().getOnlinePlayers())
if(health < maxHealth)
{
if(x instanceof AnimalTamer && x.isOnline())
if(Math.random() * 10 > 5)
{
AnimalTamer tamer = (AnimalTamer)x;
if(theWolf.getOwner() == tamer)
return x;
if(health + damage <= maxHealth)
theWolf.setHealth(health + damage);
else
theWolf.setHealth(maxHealth);
}
}
return null;
}
return null;
}
public static void sharpenedClaws(PlayerProfile PPo, EntityDamageEvent event)
{
if(PPo.getSkillLevel(SkillType.TAMING) >= 750)
{
event.setDamage(event.getDamage() + 2);
}
}
public static void gore(PlayerProfile PPo, EntityDamageEvent event, Player master, mcMMO pluginx)
{
if(Math.random() * 1000 <= PPo.getSkillLevel(SkillType.TAMING))
{
Entity entity = event.getEntity();
event.setDamage(event.getDamage() * 2);
if(entity instanceof Player)
{
Player target = (Player)entity;
target.sendMessage(mcLocale.getString("Combat.StruckByGore")); //$NON-NLS-1$
Users.getProfile(target).setBleedTicks(2);
}
else
pluginx.misc.addToBleedQue((LivingEntity)entity);
master.sendMessage(mcLocale.getString("Combat.Gore")); //$NON-NLS-1$
}
}
public static String getOwnerName(Wolf theWolf)
@@ -64,13 +104,56 @@ public class Taming
if (theWolf.getOwner() instanceof Player)
{
owner = (Player)theWolf.getOwner();
}
if(owner != null)
{
return owner.getName();
}
else
return "Offline Master";
}
public static void preventDamage(EntityDamageEvent event, mcMMO plugin)
{
DamageCause cause = event.getCause();
Wolf wolf = (Wolf) event.getEntity();
Player master = (Player) wolf.getOwner();
int skillLevel = Users.getProfile(master).getSkillLevel(SkillType.TAMING);
switch(cause)
{
//Environmentally Aware
case CONTACT:
case LAVA:
case FIRE:
if(skillLevel >= 100)
{
if(event.getDamage() >= wolf.getHealth())
return;
wolf.teleport(master.getLocation());
master.sendMessage(mcLocale.getString("mcEntityListener.WolfComesBack")); //$NON-NLS-1$
}
break;
case FALL:
if(skillLevel >= 100)
event.setCancelled(true);
break;
//Thick Fur
case FIRE_TICK:
if(skillLevel >= 250)
wolf.setFireTicks(0);
break;
case ENTITY_ATTACK:
case PROJECTILE:
if(skillLevel >= 250)
event.setDamage(event.getDamage() / 2);
break;
//Shock Proof
case ENTITY_EXPLOSION:
case BLOCK_EXPLOSION:
if(skillLevel >= 500)
event.setDamage(event.getDamage() / 6);
break;
}
}
}

View File

@@ -16,96 +16,55 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
public class Unarmed {
public static void berserkActivationCheck(Player player)
{
PlayerProfile PP = Users.getProfile(player);
if(player.getItemInHand().getTypeId() == 0)
{
if(PP.getFistsPreparationMode())
{
PP.setFistsPreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.UNARMED);
while(x >= 50){
x-=50;
ticks++;
}
if(!PP.getBerserkMode() && Skills.cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown))
{
player.sendMessage(mcLocale.getString("Skills.BerserkOn"));
for(Player y : player.getWorld().getPlayers())
{
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.BerserkPlayer", new Object[] {player.getName()}));
}
PP.setBerserkActivatedTimeStamp(System.currentTimeMillis());
PP.setBerserkDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setBerserkMode(true);
}
}
}
public static void unarmedBonus(Player attacker, EntityDamageByEntityEvent event)
{
PlayerProfile PPa = Users.getProfile(attacker);
int bonus = 0;
if (PPa.getSkillLevel(SkillType.UNARMED) >= 250)
bonus+=2;
if (PPa.getSkillLevel(SkillType.UNARMED) >= 500)
bonus+=4;
event.setDamage(event.getDamage()+bonus);
int bonus = 3;
//Add 1 DMG for every 50 skill levels
bonus += Users.getProfile(attacker).getSkillLevel(SkillType.UNARMED)/50;
if(bonus > 8)
bonus = 8;
event.setDamage(event.getDamage() + bonus);
}
public static void disarmProcCheck(Player attacker, Player defender)
{
PlayerProfile PP = Users.getProfile(attacker);
if(attacker.getItemInHand().getTypeId() == 0)
int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.UNARMED);
if(defender.getItemInHand() != null && defender.getItemInHand().getType() != Material.AIR)
{
if(PP.getSkillLevel(SkillType.UNARMED) >= 1000)
if(skillLevel >= 1000)
{
if(Math.random() * 4000 <= 1000)
{
Location loc = defender.getLocation();
if(defender.getItemInHand() != null && defender.getItemInHand().getTypeId() != 0)
{
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
ItemStack item = defender.getItemInHand();
if(item != null)
{
m.mcDropItem(loc, item);
ItemStack itemx = null;
defender.setItemInHand(itemx);
}
}
}
} else {
if(Math.random() * 4000 <= PP.getSkillLevel(SkillType.UNARMED)){
Location loc = defender.getLocation();
if(defender.getItemInHand() != null && defender.getItemInHand().getTypeId() != 0)
{
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
ItemStack item = defender.getItemInHand();
if(item != null)
{
m.mcDropItem(loc, item);
ItemStack itemx = null;
defender.setItemInHand(itemx);
}
}
}
}
if(Math.random() * 3000 <= 1000)
{
ItemStack item = defender.getItemInHand();
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
m.mcDropItem(defender.getLocation(), item);
defender.setItemInHand(null);
}
}
else
{
if(Math.random() * 3000 <= skillLevel)
{
ItemStack item = defender.getItemInHand();
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
m.mcDropItem(defender.getLocation(), item);
defender.setItemInHand(null);
}
}
}
}
}
}

View File

@@ -18,26 +18,211 @@ package com.gmail.nossr50.skills;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.Bukkit;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.config.*;
import org.getspout.spoutapi.sound.SoundEffect;
public class WoodCutting
{
static int w = 0;
private static boolean isdone = false;
public static void treeFeller(BlockBreakEvent event, mcMMO plugin)
{
//Setup vars
Player player = event.getPlayer();
Block firstBlock = event.getBlock();
PlayerProfile PP = Users.getProfile(player);
World world = firstBlock.getWorld();
//Prepare array
ArrayList<Block> toBeFelled = new ArrayList<Block>();
//NOTE: Tree Feller will cut upwards like how you actually fell trees
processTreeFelling(firstBlock, world, toBeFelled, plugin);
removeBlocks(toBeFelled, player, PP, plugin);
}
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile PP, mcMMO plugin)
{
if(toBeFelled.size() > LoadProperties.treeFellerThreshold)
{
player.sendMessage(mcLocale.getString("Skills.Woodcutting.TreeFellerThreshold"));
return;
}
int durabilityLoss = toBeFelled.size(), xp = 0;
//Damage the tool
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability()+durabilityLoss));
//This is to prevent using wood axes everytime you tree fell
if((player.getItemInHand().getDurability() + durabilityLoss >= player.getItemInHand().getType().getMaxDurability())
|| player.getItemInHand().getType() == Material.AIR || player.getItemInHand() == null)
{
player.sendMessage(mcLocale.getString("TreeFeller.AxeSplinters"));
if(player.getHealth() >= 2)
Combat.dealDamage(player, (int)(Math.random() * (player.getHealth()-1)));
return;
}
//Prepare ItemStacks
ItemStack item;
ItemStack oak = new ItemStack(Material.LOG, 1, (byte)0, (byte)0);
ItemStack spruce = new ItemStack(Material.LOG, 1, (byte)0, (byte)1);
ItemStack birch = new ItemStack(Material.LOG, 1, (byte)0, (byte)2);
ItemStack jungle = new ItemStack(Material.LOG, 1, (byte)0, (byte)3);
for(Block x : toBeFelled)
{
if(m.blockBreakSimulate(x, player, true))
{
if(x.getType() == Material.LOG)
{
switch(x.getData())
{
case 0:
item = oak;
break;
case 1:
item = spruce;
break;
case 2:
item = birch;
break;
case 3:
item = jungle;
break;
default:
item = oak;
break;
}
//ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type);
if(!plugin.misc.blockWatchList.contains(x))
{
WoodCutting.woodCuttingProcCheck(player, x);
switch(x.getData())
{
case 0:
xp += LoadProperties.moak;
break;
case 1:
xp += LoadProperties.mspruce;
break;
case 2:
xp += LoadProperties.mbirch;
break;
case 3:
xp += LoadProperties.mjungle/4;
break;
}
}
//Remove the block
x.setData((byte) 0);
x.setType(Material.AIR);
//Drop the block
m.mcDropItem(x.getLocation(), item);
} else if(x.getType() == Material.LEAVES)
{
Material mat = Material.SAPLING;
item = new ItemStack(mat, 1, (short)0, (byte)(x.getData()-8));
//90% chance to drop sapling
if(Math.random() * 10 > 9)
m.mcRandomDropItem(x.getLocation(), item, 90);
//Remove the block
x.setData((byte) 0);
x.setType(Material.AIR);
}
}
}
PP.addXP(SkillType.WOODCUTTING, xp, player); //Tree Feller gives nerf'd XP
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
{
short durability = player.getItemInHand().getDurability();
durability += (LoadProperties.abilityDurabilityLoss * durabilityLoss);
player.getItemInHand().setDurability(durability);
}
}
}
private static boolean treeFellerCompatible(Block block)
{
return block.getType() == Material.LOG || block.getType() == Material.LEAVES || block.getType() == Material.AIR;
}
private static void processTreeFelling(Block currentBlock, World world, ArrayList<Block> toBeFelled, mcMMO plugin)
{
int x = currentBlock.getX(), y = currentBlock.getY(), z = currentBlock.getZ();
if(currentBlock.getType() == Material.LOG || currentBlock.getType() == Material.LEAVES)
toBeFelled.add(currentBlock);
//These 2 are to make sure that Tree Feller isn't so aggressive
boolean isAirOrLeaves = currentBlock.getType() == Material.LEAVES || currentBlock.getType() == Material.AIR;
Block xPositive = world.getBlockAt(x+1, y, z);
Block xNegative = world.getBlockAt(x-1, y, z);
Block zPositive = world.getBlockAt(x, y, z+1);
Block zNegative = world.getBlockAt(x, y, z-1);
if(!plugin.misc.blockWatchList.contains(currentBlock) &&
!isTooAgressive(isAirOrLeaves, xPositive) && treeFellerCompatible(xPositive) && !toBeFelled.contains(xPositive))
processTreeFelling(xPositive, world, toBeFelled, plugin);
if(!plugin.misc.blockWatchList.contains(currentBlock) &&
!isTooAgressive(isAirOrLeaves, xNegative) && treeFellerCompatible(xNegative) && !toBeFelled.contains(xNegative))
processTreeFelling(xNegative, world, toBeFelled, plugin);
if(!plugin.misc.blockWatchList.contains(currentBlock) &&
!isTooAgressive(isAirOrLeaves, zPositive) && treeFellerCompatible(zPositive) && !toBeFelled.contains(zPositive))
processTreeFelling(zPositive, world, toBeFelled, plugin);
if(!plugin.misc.blockWatchList.contains(currentBlock) &&
!isTooAgressive(isAirOrLeaves, zNegative) && treeFellerCompatible(zNegative) && !toBeFelled.contains(zNegative))
processTreeFelling(zNegative, world, toBeFelled, plugin);
//Finally go Y+
Block yPositive = world.getBlockAt(x, y+1, z);
if(treeFellerCompatible(yPositive))
{
if(!plugin.misc.blockWatchList.contains(currentBlock) && !toBeFelled.contains(yPositive))
{
processTreeFelling(yPositive, world, toBeFelled, plugin);
}
}
}
private static boolean isTooAgressive(boolean bool, Block block)
{
return bool && (block.getType() == Material.AIR || block.getType() == Material.LEAVES);
}
public static void woodCuttingProcCheck(Player player, Block block)
{
PlayerProfile PP = Users.getProfile(player);
@@ -45,125 +230,63 @@ public class WoodCutting
Material mat = Material.getMaterial(block.getTypeId());
if(player != null)
{
if((Math.random() * 1000 <= PP.getSkillLevel(SkillType.WOODCUTTING)) || PP.getSkillLevel(SkillType.WOODCUTTING) > 1000)
if(PP.getSkillLevel(SkillType.WOODCUTTING) > 1000 || (Math.random() * 1000 <= PP.getSkillLevel(SkillType.WOODCUTTING)))
{
ItemStack item = new ItemStack(mat, 1, (short) 0, type);
m.mcDropItem(block.getLocation(), item);
}
}
}
public static void treeFellerCheck(Player player, Block block)
public static void woodcuttingBlockCheck(Player player, Block block, mcMMO plugin)
{
PlayerProfile PP = Users.getProfile(player);
if(m.isAxes(player.getItemInHand()))
PlayerProfile PP = Users.getProfile(player);
int xp = 0;
byte data = block.getData();
if(plugin.misc.blockWatchList.contains(block))
return;
switch(data)
{
if(block != null)
{
if(!m.abilityBlockCheck(block))
return;
}
/*
* CHECK FOR AXE PREP MODE
*/
if(PP.getAxePreparationMode())
{
PP.setAxePreparationMode(false);
}
int ticks = 2;
int x = PP.getSkillLevel(SkillType.WOODCUTTING);
while(x >= 50)
{
x-=50;
ticks++;
}
if(!PP.getTreeFellerMode() && Skills.cooldownOver(player, (PP.getTreeFellerDeactivatedTimeStamp()*1000), LoadProperties.treeFellerCooldown))
{
player.sendMessage(mcLocale.getString("Skills.TreeFellerOn"));
for(Player y : player.getWorld().getPlayers())
{
if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
y.sendMessage(mcLocale.getString("Skills.TreeFellerPlayer", new Object[] {player.getName()}));
}
PP.setTreeFellerActivatedTimeStamp(System.currentTimeMillis());
PP.setTreeFellerDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000));
PP.setTreeFellerMode(true);
}
if(!PP.getTreeFellerMode() && !Skills.cooldownOver(player, (PP.getTreeFellerDeactivatedTimeStamp()*1000), LoadProperties.treeFellerCooldown)){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
+ChatColor.YELLOW+" ("+Skills.calculateTimeLeft(player, (PP.getTreeFellerDeactivatedTimeStamp()*1000), LoadProperties.treeFellerCooldown)+"s)");
}
case 0:
xp += LoadProperties.moak;
break;
case 1:
xp += LoadProperties.mspruce;
break;
case 2:
xp += LoadProperties.mbirch;
break;
case 3:
xp += LoadProperties.mjungle;
break;
}
if(block.getTypeId() == 17)
{
WoodCutting.woodCuttingProcCheck(player, block);
PP.addXP(SkillType.WOODCUTTING, xp, player);
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
}
}
public static void treeFeller(Block block, Player player, mcMMO plugin){
PlayerProfile PP = Users.getProfile(player);
int radius = 1;
if(PP.getSkillLevel(SkillType.WOODCUTTING) >= 500)
radius++;
if(PP.getSkillLevel(SkillType.WOODCUTTING) >= 950)
radius++;
ArrayList<Block> blocklist = new ArrayList<Block>();
ArrayList<Block> toAdd = new ArrayList<Block>();
if(block != null)
blocklist.add(block);
while(isdone == false){
addBlocksToTreeFelling(blocklist, toAdd, radius);
}
//This needs to be a hashmap too!
isdone = false;
/*
* Add blocks from the temporary 'toAdd' array list into the 'treeFeller' array list
* We use this temporary list to prevent concurrent modification exceptions
*/
for(Block x : toAdd)
{
if(!plugin.misc.treeFeller.contains(x))
plugin.misc.treeFeller.add(x);
}
toAdd.clear();
}
public static void addBlocksToTreeFelling(ArrayList<Block> blocklist, ArrayList<Block> toAdd, Integer radius)
{
int u = 0;
for (Block x : blocklist)
{
u++;
if(toAdd.contains(x))
continue;
w = 0;
Location loc = x.getLocation();
int vx = x.getX();
int vy = x.getY();
int vz = x.getZ();
/*
* Run through the blocks around the broken block to see if they qualify to be 'felled'
*/
for (int cx = -radius; cx <= radius; cx++) {
for (int cy = -radius; cy <= radius; cy++) {
for (int cz = -radius; cz <= radius; cz++) {
Block blocktarget = loc.getWorld().getBlockAt(vx + cx, vy + cy, vz + cz);
if (!blocklist.contains(blocktarget) && !toAdd.contains(blocktarget) && (blocktarget.getTypeId() == 17 || blocktarget.getTypeId() == 18)) {
toAdd.add(blocktarget);
w++;
}
}
}
}
}
/*
* Add more blocks to blocklist so they can be 'felled'
*/
for(Block xx : toAdd)
{
if(!blocklist.contains(xx))
blocklist.add(xx);
}
if(u >= blocklist.size())
{
isdone = true;
} else {
isdone = false;
}
public static void leafBlower(Player player, Block block){
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
{
short durability = player.getItemInHand().getDurability();
durability += LoadProperties.abilityDurabilityLoss;
player.getItemInHand().setDurability(durability);
}
}
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
}

View File

@@ -125,7 +125,7 @@ public class SpoutStuff
for(SkillType y : SkillType.values())
{
if(y == SkillType.ALL || y == SkillType.ENCHANTING || y == SkillType.ALCHEMY)
if(y == SkillType.ALL)
continue;
String theFileNameA = m.getCapitalized(y.toString())+".png";
@@ -189,7 +189,7 @@ public class SpoutStuff
//Standard XP Icons
for(SkillType y : SkillType.values())
{
if(y == SkillType.ALL || y == SkillType.ENCHANTING || y == SkillType.ALCHEMY)
if(y == SkillType.ALL)
continue;
files.add(new File(dir+"HUD/Standard/"+m.getCapitalized(y.toString())+".png"));
files.add(new File(dir+"HUD/Retro/"+m.getCapitalized(y.toString())+"_r.png"));

View File

@@ -1,269 +0,0 @@
/*
* This file is from mmoMinecraft (http://code.google.com/p/mmo-minecraft/).
*
* mmoMinecraft is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.spout;
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Tameable;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.entity.*;
import org.getspout.spoutapi.gui.Container;
import org.getspout.spoutapi.gui.GenericContainer;
import org.getspout.spoutapi.gui.Widget;
import org.getspout.spoutapi.gui.WidgetAnchor;
import org.getspout.spoutapi.player.SpoutPlayer;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.spout.util.GenericLivingEntity;
public class mmoHelper
{
/**
* A map of player containers, each container is their party bar
*/
public static HashMap<Player, GenericContainer> containers = new HashMap<Player, GenericContainer>();
/**
* Get the percentage health of a Player.
* @param player The Player we're interested in
* @return The percentage of max health
*/
public static int getHealth(Entity player) {
if (player != null && player instanceof LivingEntity) {
try {
return Math.min(((LivingEntity) player).getHealth() * 5, 100);
} catch (Exception e) {
}
}
return 0;
}
/**
* Get the colour of a LivingEntity target from a player's point of view.
* @param player The player viewing the target
* @param target The target to name
* @return The name to use
*/
public static String getColor(Player player, LivingEntity target) {
if (target instanceof Player) {
if (((Player) target).isOp()) {
return ChatColor.GOLD.toString();
}
return ChatColor.YELLOW.toString();
} else {
if (target instanceof Monster) {
if (player != null && player.equals(((Monster) target).getTarget())) {
return ChatColor.RED.toString();
} else {
return ChatColor.YELLOW.toString();
}
} else if (target instanceof WaterMob) {
return ChatColor.GREEN.toString();
} else if (target instanceof Flying) {
return ChatColor.YELLOW.toString();
} else if (target instanceof Animals) {
if (player != null && player.equals(((Animals) target).getTarget())) {
return ChatColor.RED.toString();
} else if (target instanceof Tameable) {
Tameable pet = (Tameable) target;
if (pet.isTamed()) {
return ChatColor.GREEN.toString();
} else {
return ChatColor.YELLOW.toString();
}
} else {
return ChatColor.GRAY.toString();
}
} else {
return ChatColor.GRAY.toString();
}
}
}
/**
* Get the percentage armour of a Player.
* @param player The Player we're interested in
* @return The percentage of max armour
*/
public static int getArmor(Entity player) {
if (player != null && player instanceof Player) {
int armor = 0, max, multi[] = {15, 30, 40, 15};
ItemStack inv[] = ((Player) player).getInventory().getArmorContents();
for (int i = 0; i < inv.length; i++) {
max = inv[i].getType().getMaxDurability();
if (max >= 0) {
armor += multi[i] * (max - inv[i].getDurability()) / max;
}
}
return armor;
}
return 0;
}
public static String getSimpleName(LivingEntity target, boolean showOwner) {
String name = "";
if (target instanceof Player) {
if (LoadProperties.showDisplayName) {
name += ((Player) target).getName();
} else {
name += ((Player) target).getDisplayName();
}
} else if (target instanceof HumanEntity) {
name += ((HumanEntity) target).getName();
} else {
if (target instanceof Tameable) {
if (((Tameable) target).isTamed()) {
if (showOwner && ((Tameable) target).getOwner() instanceof Player) {
if (LoadProperties.showDisplayName) {
name += ((Player) ((Tameable) target).getOwner()).getName() + "'s ";
} else {
name += ((Player) ((Tameable) target).getOwner()).getDisplayName() + "'s ";
}
} else {
name += "Pet ";
}
}
}
if (target instanceof Chicken) {
name += "Chicken";
} else if (target instanceof Cow) {
name += "Cow";
} else if (target instanceof Creeper) {
name += "Creeper";
} else if (target instanceof Ghast) {
name += "Ghast";
} else if (target instanceof Giant) {
name += "Giant";
} else if (target instanceof Pig) {
name += "Pig";
} else if (target instanceof PigZombie) {
name += "PigZombie";
} else if (target instanceof Sheep) {
name += "Sheep";
} else if (target instanceof Slime) {
name += "Slime";
} else if (target instanceof Skeleton) {
name += "Skeleton";
} else if (target instanceof Spider) {
name += "Spider";
} else if (target instanceof Squid) {
name += "Squid";
} else if (target instanceof Wolf) {
name += "Wolf";
} else if (target instanceof Zombie) {
name += "Zombie";
} else if (target instanceof Monster) {
name += "Monster";
} else if (target instanceof Creature) {
name += "Creature";
} else {
name += "Unknown";
}
}
return name;
}
public static LivingEntity[] getPets(HumanEntity player) {
ArrayList<LivingEntity> pets = new ArrayList<LivingEntity>();
if (player != null && (!(player instanceof Player) || ((Player) player).isOnline())) {
String name = player.getName();
for (World world : Bukkit.getServer().getWorlds()) {
for (LivingEntity entity : world.getLivingEntities()) {
if (entity instanceof Tameable && ((Tameable) entity).isTamed() && ((Tameable) entity).getOwner() instanceof Player) {
if (name.equals(((Player) ((Tameable) entity).getOwner()).getName())) {
pets.add(entity);
}
}
}
}
}
LivingEntity[] list = new LivingEntity[pets.size()];
pets.toArray(list);
return list;
}
public static void update(Player player)
{
//boolean show_pets = true;
Container container = containers.get(player);
if (container != null)
{
int index = 0;
Widget[] bars = container.getChildren();
for (String name : Party.getInstance().getPartyMembersByName(player).meFirst(player.getName()))
{
GenericLivingEntity bar;
if (index >= bars.length)
{
container.addChild(bar = new GenericLivingEntity());
} else {
bar = (GenericLivingEntity)bars[index];
}
bar.setEntity(name, Party.getInstance().isPartyLeader(name, Users.getProfile(Bukkit.getServer().getPlayer(name)).getParty()) ? ChatColor.GREEN + "@" : "");
//bar.setTargets(show_pets ? getPets(Bukkit.getServer().getPlayer(name)) : null);
index++;
}
while (index < bars.length) {
container.removeChild(bars[index++]);
}
container.updateLayout();
}
}
public static void initialize(SpoutPlayer sPlayer, Plugin plugin)
{
GenericContainer container = new GenericContainer();
container.setAlign(WidgetAnchor.TOP_LEFT)
.setAnchor(WidgetAnchor.TOP_LEFT)
.setX(3)
.setY(3)
.setWidth(427)
.setHeight(240)
.setFixed(true);
mmoHelper.containers.put(sPlayer, container);
sPlayer.getMainScreen().attachWidget(plugin, container);
}
/**
* Update all parties.
*/
public static void updateAll() {
for(Player x : Bukkit.getServer().getOnlinePlayers())
{
if(Users.getProfile(x).inParty())
{
update(x);
}
}
}
}

View File

@@ -1,112 +0,0 @@
/*
* This file is part of mmoMinecraft (http://code.google.com/p/mmo-minecraft/).
*
* mmoMinecraft is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.spout.util;
import java.util.ArrayList;
/**
* Case insensitive ArrayList<String>.
* Overrides the .contains(), .indexOf(), .lastIndexOf() and .remove() methods.
*/
public class ArrayListString extends ArrayList<String> {
private static final long serialVersionUID = -8111006526598412404L;
/**
* Returns true if this list contains the specified string.
* @param o String whose presence in this list is to be tested
* @return true if this list contains the specified string
*/
public boolean contains(String o) {
for (String e : this) {
if (o == null ? e == null : o.equalsIgnoreCase(e)) {
return true;
}
}
return false;
}
/**
* Returns the index of the first occurrence of the specified string in this list, or -1 if this list does not contain the string.
* @param o String to search for
* @return The index of the first occurrence of the specified string in this list, or -1 if this list does not contain the string
*/
public int indexOf(String o) {
for (int i = 0; i < this.size(); i++) {
if (o == null ? get(i) == null : o.equalsIgnoreCase(get(i))) {
return i;
}
}
return -1;
}
/**
* Returns the index of the last occurrence of the specified string in this list, or -1 if this list does not contain the string.
* @param o String to search for
* @return The index of the last occurrence of the specified string in this list, or -1 if this list does not contain the string
*/
public int lastIndexOf(String o) {
for (int i = size() - 1; i >= 0; i--) {
if (o == null ? get(i) == null : o.equalsIgnoreCase(get(i))) {
return i;
}
}
return -1;
}
/**
* Removes the first occurrence of the specified string from this list, if it is present. If the list does not contain the string, it is unchanged.
* @param o String to be removed from this list, if present
* @return true if this list contained the specified string
*/
public boolean remove(String o) {
int i = indexOf(o);
if (i != -1) {
remove(i);
return true;
}
return false;
}
/**
* Returns the element at the specified position in this list.
* This is for finding the correct capitalisation of an element.
* @param index String to search for
* @return the correctly capitalised element
*/
public String get(String index) {
int i = this.indexOf(index);
if (i != -1) {
return this.get(i);
}
return null;
}
public ArrayListString meFirst(String name) {
ArrayListString copy = new ArrayListString();
if (this.contains(name)) {
copy.add(name);
}
for (String next : this) {
if (!next.equalsIgnoreCase(name)) {
copy.add(next);
}
}
return copy;
}
}

View File

@@ -1,65 +0,0 @@
/*
* This file is part of mmoMinecraft (https://github.com/mmoMinecraftDev).
*
* mmoMinecraft is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.spout.util;
import org.getspout.spoutapi.gui.GenericTexture;
import com.gmail.nossr50.config.LoadProperties;
public final class GenericFace extends GenericTexture {
private static String facePath = "http://face.rycochet.net/";
private static int defaultSize = 8;
private String name;
public GenericFace() {
this("", defaultSize);
}
public GenericFace(String name) {
this(name, defaultSize);
}
public GenericFace(String name, int size) {
if (LoadProperties.showFaces) {
this.setWidth(size).setHeight(size).setFixed(true);
setName(name);
} else {
this.setVisible(false);
}
}
public String getName() {
return name;
}
public GenericFace setName(String name) {
if (LoadProperties.showFaces) {
this.name = name == null ? "" : name;
super.setUrl(facePath + this.name + ".png");
super.setDirty(true);
}
return this;
}
public GenericFace setSize(int size) {
if (LoadProperties.showFaces) {
super.setWidth(size).setHeight(size);
}
return this;
}
}

View File

@@ -1,227 +0,0 @@
/*
* This file is part of mmoHelperMinecraft (https://github.com/mmoHelperMinecraftDev).
*
* mmoHelperMinecraft is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.spout.util;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.getspout.spoutapi.gui.*;
import com.gmail.nossr50.spout.mmoHelper;
public class GenericLivingEntity extends GenericContainer {
private Container _space;
private Label _label;
private Gradient _health;
private Gradient _armor;
private GenericFace _face;
private int health = 100;
private int armor = 100;
private int def_width = 80;
private int def_height = 14;
private boolean target = false;
String face = "~";
String label = "";
public GenericLivingEntity() {
super();
Color black = new Color(0, 0, 0, 0.75f);
this.addChildren(
new GenericContainer( // Used for the bar, this.children with an index 1+ are targets
_space = (Container) new GenericContainer()
.setMinWidth(def_width / 4)
.setMaxWidth(def_width / 4)
.setVisible(target),
new GenericContainer(
new GenericGradient()
.setTopColor(black)
.setBottomColor(black)
.setPriority(RenderPriority.Highest),
new GenericContainer(
_health = (Gradient) new GenericGradient(),
_armor = (Gradient) new GenericGradient()
) .setMargin(1)
.setPriority(RenderPriority.High),
new GenericContainer(
_face = (GenericFace) new GenericFace()
.setMargin(3, 0, 3, 3),
_label = (Label) new GenericLabel()
.setMargin(3)
) .setLayout(ContainerType.HORIZONTAL)
) .setLayout(ContainerType.OVERLAY)
) .setLayout(ContainerType.HORIZONTAL)
.setMargin(0, 0, 1, 0)
.setFixed(true)
.setWidth(def_width)
.setHeight(def_height)
) .setAlign(WidgetAnchor.TOP_LEFT)
.setFixed(true)
.setWidth(def_width)
.setHeight(def_height + 1);
this.setHealthColor(new Color(1f, 0, 0, 0.75f));
this.setArmorColor(new Color(0.75f, 0.75f, 0.75f, 0.75f));
}
/**
* Set the display from a possibly offline player
* @param name
* @return
*/
public GenericLivingEntity setEntity(String name) {
return setEntity(name, "");
}
/**
* Set the display from a possibly offline player
* @param name
* @param prefix Place before the name
* @return
*/
public GenericLivingEntity setEntity(String name, String prefix) {
Player player = this.getPlugin().getServer().getPlayer(name);
if (player != null && player.isOnline()) {
return setEntity(player, prefix);
}
setHealth(0);
setArmor(0);
setLabel((!"".equals(prefix) ? prefix : "") + mmoHelper.getColor(screen != null ? screen.getPlayer() : null, null) + name);
setFace("~" + name);
return this;
}
/**
* Set the display from a player or living entity
* @param entity
* @return
*/
public GenericLivingEntity setEntity(LivingEntity entity) {
return setEntity(entity, "");
}
/**
* Set the display from a player or living entity
* @param entity
* @param prefix Place before the name
* @return
*/
public GenericLivingEntity setEntity(LivingEntity entity, String prefix) {
if (entity != null && entity instanceof LivingEntity) {
setHealth(mmoHelper.getHealth(entity)); // Needs a maxHealth() check
setArmor(mmoHelper.getArmor(entity));
setLabel((!"".equals(prefix) ? prefix : "") + mmoHelper.getColor(screen != null ? screen.getPlayer() : null, entity) + mmoHelper.getSimpleName(entity, !target));
setFace(entity instanceof Player ? ((Player)entity).getName() : "+" + mmoHelper.getSimpleName(entity,false).replaceAll(" ", ""));
} else {
setHealth(0);
setArmor(0);
setLabel("");
setFace("");
}
return this;
}
/**
* Set the targets of this entity - either actual targets, or pets etc
* @param targets
* @return
*/
public GenericLivingEntity setTargets(LivingEntity... targets) {
Widget[] widgets = this.getChildren();
if (targets == null) {
targets = new LivingEntity[0]; // zero-length array is easier to handle
}
for (int i=targets.length + 1; i<widgets.length; i++) {
this.removeChild(widgets[i]);
}
for (int i=0; i<targets.length; i++) {
GenericLivingEntity child;
if (widgets.length > i + 1) {
child = (GenericLivingEntity) widgets[i+1];
} else {
this.addChild(child = new GenericLivingEntity());
}
child.setTarget(true);
child.setEntity(targets[i]);
}
setHeight((targets.length + 1) * (def_height + 1));
updateLayout();
return this;
}
public GenericLivingEntity setTarget(boolean target) {
if (this.target != target) {
this.target = target;
_space.setVisible(target);
updateLayout();
}
return this;
}
public GenericLivingEntity setHealth(int health) {
if (this.health != health) {
this.health = health;
updateLayout();
}
return this;
}
public GenericLivingEntity setHealthColor(Color color) {
_health.setTopColor(color).setBottomColor(color);
return this;
}
public GenericLivingEntity setArmor(int armor) {
if (this.armor != armor) {
this.armor = armor;
updateLayout();
}
return this;
}
public GenericLivingEntity setArmorColor(Color color) {
_armor.setTopColor(color).setBottomColor(color);
return this;
}
public GenericLivingEntity setLabel(String label) {
if (!this.label.equals(label)) {
this.label = label;
_label.setText(label).setDirty(true);
updateLayout();
}
return this;
}
public GenericLivingEntity setFace(String name) {
if (!this.face.equals(name)) {
this.face = name;
_face.setVisible(!name.isEmpty());
_face.setName(name);
updateLayout();
}
return this;
}
@Override
public Container updateLayout() {
super.updateLayout();
_armor.setWidth((_armor.getContainer().getWidth() * armor) / 100).setDirty(true);
_health.setWidth((_health.getContainer().getWidth() * health) / 100).setDirty(true);
return this;
}
}

View File

@@ -0,0 +1,101 @@
package com.gmail.nossr50.util;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.m;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
public class Page {
public static int getTotalPageNumber(String address)
{
String[] addressSplit = mcLocale.getString(address).split("\n");
if(addressSplit.length <= 8)
return 1;
else
return (addressSplit.length/8)+1;
}
public static ArrayList<String> grabPageContents(String header, String address, int pagenum)
{
int pageIndexStart = 0;
//Determine what string to start at
if(pagenum > 1)
{
pageIndexStart = 8*(pagenum-1);
}
ArrayList<String> allStrings = new ArrayList<String>();
String split[] = mcLocale.getString(address).split("\n");
allStrings.add(ChatColor.GOLD+"-="+ChatColor.GREEN+header+ChatColor.GOLD+"=-"); //So stylish
//Add targeted strings
while(allStrings.size() < 9)
{
if(pageIndexStart+allStrings.size() > split.length)
allStrings.add("");
else
allStrings.add(split[pageIndexStart+allStrings.size()-1]);
}
allStrings.add("Page "+pagenum+" of "+getTotalPageNumber(address));
return allStrings;
}
public static void clearChat(Player player)
{
for(int x = 0; x < 20; x++)
{
player.sendMessage("");
}
}
public static void grabGuidePageForSkill(SkillType skilltype, Player player, String[] args)
{
String capitalized = m.getCapitalized(skilltype.toString());
player.sendMessage(ChatColor.DARK_AQUA+"Guide for "+capitalized+" available type /"+skilltype.toString().toLowerCase()+" ? [Page#]");
if (args.length >= 1)
{
if(args[0].equals("?"))
{
String address = "Guides."+capitalized;
if(args.length > 1 && m.isInt(args[1]) && m.getInt(args[1]) <= Page.getTotalPageNumber(address))
{
Page.clearChat(player);
for(String target : Page.grabPageContents(capitalized+" Guide", address, m.getInt(args[1])))
{
player.sendMessage(target);
}
} else if(args.length == 1)
{
Page.clearChat(player);
for(String target : Page.grabPageContents(capitalized+" Guide", address, 1))
{
player.sendMessage(target);
}
}
else if(args.length > 1 && m.getInt(args[1]) > Page.getTotalPageNumber(address))
{
player.sendMessage("That page doesn't exist, there are only "+Page.getTotalPageNumber(address)+" total pages");
}
else if(args.length > 1 && !m.isInt(args[1]))
{
player.sendMessage("Not a valid page number!");
}
}
else
{
player.sendMessage(ChatColor.RED + "Usage is /"+skilltype.toString().toLowerCase()+" ? [page]");
}
}
}
}

View File

@@ -1,8 +1,306 @@
#
# mcMMO configuration
# First generated on ${project.version}-b${BUILD_NUMBER}
#
#####
#
# Settings for mcMMO in general
###
General:
Locale: en_us
MOTD:
Enabled: true
#Amount of time (in minutes) to wait between saves of player information
Save_Interval: 10
#Allow mcMMO to report on basic anonymous usage
Stats_Tracking: true
#Allow mcMMO to inform other plugins of damage being dealt
Event_Callback: true
#
# Settings for using a mySQL database
###
MySQL:
Enabled: false
Database:
User:
Name: UserName
Password: UserPassword
Name: DataBaseName
TablePrefix: mcmmo_
Server:
Port: 3306
Address: localhost
#
# Settings for mcMMO items
###
Items:
Chimaera_Wing:
Enabled: true
Feather_Cost: 10
Item_ID: 288
#
# Settings for Arcane Forging
###
Arcane_Forging:
May_Lose_Enchants: true
Rank_Levels:
Rank_1: 100
Rank_2: 250
Rank_3: 500
Rank_4: 750
Keep_Enchants:
Chance:
Rank_4: 40
Rank_3: 30
Rank_2: 20
Rank_1: 10
Downgrades:
Enabled: true
Chance:
Rank_4: 15
Rank_3: 25
Rank_2: 50
Rank_1: 75
#
# Settings for Fishing
###
Fishing:
Drops_Enabled: true
Tier_Levels:
Tier1: 0
Tier2: 200
Tier3: 400
Tier4: 600
Tier5: 800
#
# Settings for Abilities
###
Abilities:
Enabled: true
Messages: true
Activation:
Only_Activate_When_Sneaking: false
Cooldowns:
Blast_Mining: 60
Giga_Drill_Breaker: 240
Berserk: 240
Green_Terra: 240
Skull_Splitter: 240
Serrated_Strikes: 240
Tree_Feller: 240
Super_Breaker: 240
Limits:
Tree_Feller_Threshold: 500
Tools:
Durability_Loss_Enabled: true
Durability_Loss: 2
#
# Settings for Skills
###
Skills:
Acrobatics:
Level_Cap: 0 #Level cap of 0 for no limit
Archery:
Level_Cap: 0
Axes:
Level_Cap: 0
Excavation:
Level_Cap: 0
Requires_Shovel: true
Fishing:
Level_Cap: 0
Herbalism:
Level_Cap: 0
Green_Thumb:
Cobble_To_Mossy: true
SmoothBrick_To_MossyBrick: true
Dirt_To_Grass: true
Hunger_Bonus: true
Mining:
Level_Cap: 0
Requires_Pickaxe: true
Detonator_ID: 259
Repair:
Level_Cap: 0
Anvil_Messages: true
Anvil_ID: 42
Can_Repair_Armor: true
Can_Repair_Tools: true
Leather:
Name: Leather
ID: 334
String:
Name: String
ID: 287
Stone:
Name: Cobblestone
Level_Required: 0
ID: 4
Wood:
Name: Wood Planks
ID: 5
Gold:
Name: Gold Bars
Level_Required: 0
ID: 266
Iron:
Name: Iron Bars
Level_Required: 0
ID: 265
Diamond:
Name: Diamond
Level_Required: 50
ID: 264
Swords:
Level_Cap: 0
Taming:
Level_Cap: 0
Call_Of_The_Wild:
Bones_Required: 10
Unarmed:
Level_Cap: 0
Woodcutting:
Level_Cap: 0
Requires_Axe: true
#
# Settings for XP distribution
###
Experience:
Gains:
Mobspawners:
Enabled: false
Multiplier:
PVP: 1
Global: 1.0
PVP:
Rewards: true
Formula:
Multiplier:
Swords: 1.0
Taming: 1.0
Acrobatics: 1.0
Excavation: 1.0
Herbalism: 1.0
Unarmed: 1.0
Woodcutting: 1.0
Mining: 1.0
Archery: 1.0
Axes: 1.0
Repair: 1.0
Fishing: 1.0
Fishing:
Base: 800
Excavation:
Base: 40
Woodcutting:
Oak: 70
Spruce: 80
Birch: 90
Jungle: 100
Herbalism:
Sugar_Cane: 30
Cactus: 30
Flowers: 100
Pumpkin: 20
Mushrooms: 150
Wheat: 50
Melon: 20
Nether_Wart: 50
Lily_Pads: 100
Vines: 10
Mining:
Sandstone: 30
Glowstone: 30
Lapis: 400
Obsidian: 150
Stone: 30
Netherrack: 30
Gold: 350
Redstone: 150
Coal: 100
Diamond: 750
Iron: 250
End_Stone: 150
Moss_Stone: 30
Taming:
Animal_Taming:
Wolf: 250
Ocelot: 500
Combat:
Multiplier:
Animals: 1.0
Creeper: 4.0
Skeleton: 2.0
Spider: 3.0
Zombie: 2.0
Pig_Zombie: 3.0
Enderman: 2.0
Cave_Spider: 3.0
Silverfish: 3.0
Blaze: 3.0
Magma_Cube: 2.0
Ender_Dragon: 8.0
Slime: 2.0
Ghast: 3.0
#
# Settings for commands
###
Commands:
invite:
Enabled: true
mctop:
Enabled: true
xplock:
Enabled: true
inspect:
Enabled: true
mcc:
Enabled: true
mcremove:
Enabled: true
mmoedit:
Enabled: true
accept:
Enabled: true
mcstats:
Enabled: true
mcability:
Enabled: true
party:
Enabled: true
xprate:
Enabled: true
mcgod:
Enabled: true
mcmmo:
Enabled: true
Donate_Message: true
mcrefresh:
Enabled: true
addxp:
Enabled: true
addlevels:
Enabled: true
ptp:
Enabled: true
p:
Enabled: true
Display_Names: true
a:
Enabled: true
Display_Names: true
#
# Settings for Spout features
###
Spout:
Menu:
Key: KEY_M
@@ -20,8 +318,6 @@ Spout:
Show_Faces: true
Enabled: true
Show_Display_Name: false
Images:
URL_DIR: http://mcmmo.rycochet.net/mcmmo/
HUD:
Default: STANDARD
Retro:
@@ -81,274 +377,4 @@ Spout:
Mining:
BLUE: 0.75
GREEN: 0.3
RED: 0.3
Fishing:
Drops:
Gold_Tools: true
Diamond_Armor: true
Stone_Tools: true
Diamonds: true
Iron_Armor: true
Iron_Tools: true
Diamond_Tools: true
Item_Drops_Enabled: true
Records: true
Blaze_Rod: true
Leather_Armor: true
Drop_Chance:
Tier_1: 20
Tier_2: 25
Tier_3: 30
Tier_4: 35
Tier_5: 40
Gold_Armor: true
Glowstone_Dust: true
Ender_Pearl: true
Wooden_Tools: true
Skills:
Acrobatics:
Level_Cap: 0 #Level cap of 0 for no limit
Archery:
Level_Cap: 0
Axes:
Level_Cap: 0
Excavation:
Level_Cap: 0
Requires_Shovel: true
Fishing:
Level_Cap: 0
Herbalism:
Level_Cap: 0
Green_Thumb:
Cobble_To_Mossy: true
Mining:
Level_Cap: 0
Requires_Pickaxe: true
Repair:
Level_Cap: 0
Leather:
ID: 334
String:
Name: Leather
ID: 287
Stone:
Name: Cobblestone
ID: 4
Wood:
Name: Wood Planks
ID: 5
Gold:
Name: Gold Bars
ID: 266
Anvil_Messages: true
Diamond:
Name: Diamond
Level_Required: 50
ID: 264
Iron:
Name: Iron Bars
ID: 265
Swords:
Level_Cap: 0
Taming:
Level_Cap: 0
Call_Of_The_Wild:
Bones_Required: 10
Unarmed:
Level_Cap: 0
Woodcutting:
Level_Cap: 0
Requires_Axe: true
Experience:
Fishing:
Base: 800
Formula:
Multiplier:
Swords: 1.0
Taming: 1.0
Acrobatics: 1.0
Sorcery: 1.0
Excavation: 1.0
Herbalism: 1.0
Unarmed: 1.0
Woodcutting: 1.0
Mining: 1.0
Archery: 1.0
Axes: 1.0
Repair: 1.0
Gains:
Mobspawners:
Enabled: false
Multiplier:
PVP: 1
Global: 1.0
PVP:
Rewards: true
Excavation:
Base: 40
Cake: 3000
Sulphur: 30
Bones: 30
Map: 200
Slimeballs: 100
Bucket: 100
Apple: 100
Mushroom: 80
Eggs: 100
Slowsand: 80
Watch: 200
Web: 150
String: 200
Glowstone: 80
Music: 3000
Diamond: 1000
Cocoa_Beans: 100
Woodcutting:
Birch: 70
Spruce: 80
Pine: 90
Herbalism:
Sugar_Cane: 30
Cactus: 30
Flowers: 100
Pumpkin: 20
Mushrooms: 150
Wheat: 50
Melon: 20
Nether_Wart: 50
Lily_Pads: 100
Vines: 10
Mining:
Sandstone: 30
Glowstone: 30
Lapis: 400
Obsidian: 150
Stone: 30
Netherrack: 30
Gold: 350
Redstone: 150
Coal: 100
Diamond: 750
lapis: 400
Iron: 250
MySQL:
Enabled: false
Database:
User:
Name: UserName
Password: UserPassword
Name: DataBaseName
TablePrefix: mcmmo_
Server:
Port: 3306
Address: localhost
XP:
Gains:
Mobspawners:
Enabled: false
PVP:
Rewards: true
General:
HP_Regeneration:
Enabled: true
Locale: en_us
MySpawn:
Enabled: true
MOTD:
Enabled: true
Excavation:
Drops:
Cake: true
Sulphur: true
Bones: true
Apples: true
Map: true
Slimeballs: true
Bucket: true
Netherrack: true
Mushrooms: true
Eggs: true
Slowsand: true
Watch: true
Web: true
String: true
Glowstone: true
Music: true
Diamond: true
Cocoa_Beans: true
Arcane_Forging:
Keep_Enchants:
Chance:
Rank_4: 40
Rank_3: 30
Rank_2: 20
Rank_1: 10
May_Lose_Enchants:
Enabled: true
Downgrades:
Enabled: true
Chance:
Rank_4: 15
Rank_3: 25
Rank_2: 50
Rank_1: 75
Abilities:
Activation:
Only_Activate_When_Sneaking: false
Enabled: true
Messages: true
Cooldowns:
Giga_Drill_Breaker: 240
Berserk: 240
Green_Terra: 240
Skull_Splitter: 240
Serrated_Strikes: 240
Tree_Feller: 240
Super_Breaker: 240
Tools:
Durability_Loss: 2
Durability_Loss_Enabled: true
Commands:
invite:
Enabled: true
mctop:
Enabled: true
xplock:
Enabled: true
whois:
Enabled: true
mcc:
Enabled: true
mmoedit:
Enabled: true
accept:
Enabled: true
stats:
Enabled: true
mcability:
Enabled: true
party:
Enabled: true
xprate:
Enabled: true
mcgod:
Enabled: true
mcmmo:
Enabled: true
Donate_Message: true
mcrefresh:
Enabled: true
myspawn:
Enabled: true
addxp:
Enabled: true
clearmyspawn:
Enabled: true
ptp:
Enabled: true
p:
Enabled: true
Display_Names: true
a:
Enabled: true
Display_Names: true
RED: 0.3

View File

@@ -23,11 +23,9 @@ m.mccPartyTeleport=[party member name] [[YELLOW]]- Teleport zu Gruppenmitglied
m.mccOtherCommands=[[DARK_AQUA]]_______[[YELLOW]] ANDERE BEFEHLE [[DARK_AQUA]]_______
m.mccStats=[[YELLOW]]- zeigt deinen Status
m.mccLeaderboards=[[YELLOW]]- Ranglisten
m.mccMySpawn=[[YELLOW]]- Teleport zum Spawnpunkt
m.mccClearMySpawn=[[YELLOW]]- Spawnpunkt loeschen
m.mccToggleAbility=[[YELLOW]]- Faehigkeitsaktivierung mit rechtsklick an/aus schalten
m.mccAdminToggle=[[YELLOW]]- Adminchat aktivieren
m.mccWhois=[[WHITE]][playername] [[YELLOW]]- Detailierte Spielerinfos zeigen
m.mccInspect=[[WHITE]][playername] [[YELLOW]]- Detailierte Spielerinfos zeigen
m.mccMmoedit=[playername] [skill] [newvalue] [[YELLOW]]- Ziel modifizieren
m.mccMcGod=[[YELLOW]]- God Mode
m.mccSkillInfo=[[WHITE]][skillname] [[YELLOW]]- Detailierte Skillinfos zeigen
@@ -40,7 +38,7 @@ m.AbilityBonusTemplate=[[YELLOW]]{0}: [[GREEN]]{1}
m.Effects=EFFEKTE
m.YourStats=[[DARK_AQUA]]_______ [[YELLOW]]DEINE WERTE [[DARK_AQUA]]_______
m.SkillTaming=Bestienkunde (Taming)
m.XPGainTaming=[[YELLOW]]wenn deine Woelfe angreifen
m.XPGainTaming=Animal Taming, or combat w/ your wolves
m.EffectsTaming1_0=[[YELLOW]]Bestienkunde
m.EffectsTaming1_1=[[AQUA]]mit Knochen schlagen inspiziert Woelfe
m.EffectsTaming2_0=[[YELLOW]]Biss
@@ -99,11 +97,19 @@ m.EffectsAxes1_0=[[YELLOW]]Schaedelspalter (Faehigkeit)
m.EffectsAxes1_1=[[AQUA]]Verursacht Flaechenschaden
m.EffectsAxes2_0=[[YELLOW]]Kritischer Schlag
m.EffectsAxes2_1=[[AQUA]]doppelter Schaden
m.EffectsAxes3_0=[[YELLOW]]Axtmeister (500 Skilllevel)
m.EffectsAxes3_1=[[AQUA]]Modifiziert Schaden
m.AbilLockAxes1=[[DARK_AQUA]]gesperrt bis 500+ Skilllevel(Axtmeister)
m.AbilBonusAxes1_0=[[YELLOW]]Axtmeister
m.AbilBonusAxes1_1=[[AQUA]]4 Bonus-Schaden
m.EffectsAxes3_0=Axe Mastery
m.EffectsAxes3_1=Adds bonus DMG
m.EffectsAxes4_0=Impact
m.EffectsAxes4_1=Strike with enough force to shatter armor
m.EffectsAxes5_0=Greater Impact
m.EffectsAxes5_1=Deal bonus damage to unarmored foes
m.AbilLockAxes1=LOCKED UNTIL 500+ SKILL (AXE MASTERY)
m.AbilBonusAxes1_0=Axe Mastery
m.AbilBonusAxes1_1=Bonus {0} damage
m.AbilBonusAxes2_0=Impact
m.AbilBonusAxes2_1=Deal {0} DMG to armor
m.AbilBonusAxes3_0=Greater Impact
m.AbilBonusAxes3_1=Deal {0} Bonus DMG to the unarmored
m.AxesCritChance=[[YELLOW]]Chance fuer kritische Treffer: [[GREEN]]{0}%
m.AxesSkullLength=[[YELLOW]]Schaedelspalter Dauer: [[GREEN]]{0}s
m.SkillSwords=Schwert (Swords)
@@ -161,18 +167,12 @@ m.EffectsUnarmed1_0=[[YELLOW]]Berserker (Faehigkeit)
m.EffectsUnarmed1_1=[[AQUA]]+50% Schaden, bricht weiches Material (Bsp. Erde)
m.EffectsUnarmed2_0=[[YELLOW]]Entwaffnen (Spieler)
m.EffectsUnarmed2_1=[[AQUA]]Droppt Item welches Feind in Hand haelt
m.EffectsUnarmed3_0=[[YELLOW]]Faustkampfmeister
m.EffectsUnarmed3_1=[[AQUA]]grosse Schadenssteigerung
m.EffectsUnarmed4_0=[[YELLOW]]Faustkampflehrling
m.EffectsUnarmed4_1=[[AQUA]]Schadens-Bonus
m.EffectsUnarmed3_0=Iron Arm Style
m.EffectsUnarmed3_1=Hardens your arm over time
m.EffectsUnarmed5_0=[[YELLOW]]Pfeil ablenken
m.EffectsUnarmed5_1=[[AQUA]]wehrt Pfeile ab
m.AbilLockUnarmed1=[[DARK_AQUA]]gesperrt bis 250+ Skilllevel (Faustkampflehrling)
m.AbilLockUnarmed2=[[DARK_AQUA]]gesperrt bis 500+ Skilllevel (Faustkampfmeister)
m.AbilBonusUnarmed1_0=[[YELLOW]]Faustkampflehrling
m.AbilBonusUnarmed1_1=[[AQUA]]+2 Schadens-Bonus
m.AbilBonusUnarmed2_0=[[YELLOW]]Faustkampfmeister
m.AbilBonusUnarmed2_1=[[AQUA]]+4 Schadens-Bonus
m.AbilBonusUnarmed2_0=Iron Arm Style
m.AbilBonusUnarmed2_1=+{0} DMG Upgrade
m.UnarmedArrowDeflectChance=[[YELLOW]]Pfeil ablenken Chance: [[GREEN]]{0}%
m.UnarmedDisarmChance=[[YELLOW]]Entwaffnen Chance: [[GREEN]]{0}%
m.UnarmedBerserkLength=[[YELLOW]]Berserker Dauer: [[GREEN]]{0}s
@@ -184,22 +184,22 @@ m.EffectsHerbalism2_0=[[YELLOW]]Gruener Daumen (Weizen)
m.EffectsHerbalism2_1=[[AQUA]]automatisches neupflanzen nach ernten
m.EffectsHerbalism3_0=[[YELLOW]]Gruener Daumen (Cobble)
m.EffectsHerbalism3_1=[[AQUA]]verwandelt Cobblestone zu Mossy Cobblestone mithilfe von Samen
m.EffectsHerbalism4_0=[[YELLOW]]Nahrung+
m.EffectsHerbalism4_1=[[AQUA]]Modifiziert Heilung von Brot/Suppe
m.EffectsHerbalism4_0=Farmer's Diet
m.EffectsHerbalism4_1=Improves hunger restored from herbalist foods
m.EffectsHerbalism5_0=[[YELLOW]]Doppelte Drops (Alle Kraeuter)
m.EffectsHerbalism5_1=[[AQUA]]doppelte Anzahl Items
m.HerbalismGreenTerraLength=[[YELLOW]]Gruene Welt Dauer: [[GREEN]]{0}s
m.HerbalismGreenThumbChance=[[YELLOW]]Gruener Daumen Chance: [[GREEN]]{0}%
m.HerbalismGreenThumbStage=[[YELLOW]]Gruener Daumen Stufe: [[GREEN]] Getreide waechst auf Stufe {0}
m.HerbalismDoubleDropChance=[[YELLOW]]Doppelte Drop Chance: [[GREEN]]{0}%
m.HerbalismFoodPlus=[[YELLOW]]Nahrung+ (Rang{0}): [[GREEN]]Bonus-Heilung {0}
m.HerbalismFoodPlus=[[RED]]Farmers Diet: [[YELLOW]]Rank {0}
m.SkillExcavation=Graben (Excavation)
m.XPGainExcavation=[[YELLOW]]Graben und Finden von Schaetzen
m.EffectsExcavation1_0=[[YELLOW]]Giga Bohrer (Faehigkeit)
m.EffectsExcavation1_1=[[AQUA]]3x Drop Rate, 3x EXP, +Tempo
m.EffectsExcavation2_0=[[YELLOW]]Schatzjaeger
m.EffectsExcavation2_1=[[AQUA]]Faehigkeit nach Schaetzen zu graben
m.ExcavationGreenTerraLength=[[YELLOW]]Giga Bohrer Dauer: [[GREEN]]{0}s
m.ExcavationGigaDrillBreakerLength=[[YELLOW]]Giga Bohrer Dauer: [[GREEN]]{0}s
mcBlockListener.PlacedAnvil=[[DARK_AQUA]]Du hast einen Ambos platziert, du kannst hier Werkzeuge und Ruestungen reparieren.
mcEntityListener.WolfComesBack=[[DARK_AQUA]]Dein Wolf hastet zurueck zu dir...
mcPlayerListener.AbilitiesOff=Faehigkeiten nutzen (rechtsklick) aus
@@ -306,22 +306,12 @@ Skills.NeedMore=[[DARK_AQUA]]Hierfuer brauchst du mehr [[YELLOW]]
Skills.AdeptDiamond=[[DARK_RED]]Du bist nicht talentiert genug um Diamantwerkzeuge zu reparieren
Skills.FullDurability=[[AQUA]]Dieses Item hat volle Haltbarkeit
Skills.Disarmed=[[DARK_RED]]Du wurdest entwaffnet!
mcPlayerListener.SorcerySkill=Zauberkunst Skill (Sorcery):
m.SkillSorcery=Zauberkunst (Sorcery)
Sorcery.HasCast=[[YELLOW]]**ZAUBERN**[[YELLOW]]
Sorcery.Current_Mana=[[DARK_AQUA]]MP
Sorcery.SpellSelected=[[YELLOW]]-=([[YELLOW]]{0}[[YELLOW]])=- [[RED]]([[AQUA]]{1}[[RED]])
Sorcery.Cost=[[RED]][COST] {0} MP
Sorcery.OOM=[[DARK_AQUA]][[[YELLOW]]{2}[[DARK_AQUA]]][[DARK_AQUA]] Kein Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[AQUA]]{1}[[YELLOW]])
Sorcery.Water.Thunder=GEWITTER
Sorcery.Curative.Self=HEILEN (SELBST)
Sorcery.Curative.Other=HEILEN (ANDERE)
m.LVL=[[AQUA]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]] ([[AQUA]]{1}[[YELLOW]]/[[AQUA]]{2}[[YELLOW]])
Combat.BeastLore=[[YELLOW]]**BESTIENKUNDE**
Combat.BeastLoreOwner=[[DARK_AQUA]]Besitzer ([[RED]]{0}[[DARK_AQUA]])
Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Gesundheit ([[YELLOW]]{0}[[DARK_AQUA]]/20)
Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Gesundheit ([[YELLOW]]{0}[[DARK_AQUA]]/8)
mcMMO.Description=[[DARK_AQUA]]Q: Was ist mcMMO? [[GRAY]]mcMMO is ein Open Source [[GOLD]]RPG Plugin[[GRAY]] fuer,[[GRAY]]Bukkit von [[RED]]nossr50 [[GRAY]]welches Minecraft viele Skills hinzufuegt.,[[GRAY]]Man kann auf vielen Wegen Erfahrung sammeln.,[[GRAY]]Um mehr ueber einen Skill zu erfahren gebe [[GREEN]]/SKILLNAME[[GRAY]] ein.,[[DARK_AQUA]]Q: Was macht es genau? [[GRAY]]Beispiel: Mit [[DARK_AQUA]]Mining[[GRAY]] bekommst du passive,[[GRAY]]Fertigkeiten wie [[RED]]Doppelte Drops[[GRAY]] oder Aktive wie den,[[RED]]Super-Brecher[[GRAY]] welcher dir per Rechtsklick aktiviert erlaubt,[[GRAY]]fuer einige Zeit (basierend auf deinem Lvl) schneller zu Minen[[GRAY]],[[BLUE]]Mining [[GRAY]]zu leveln ist so einfach wie seltene Materialien zu,[[GRAY]]bekommen! [[DARK_AQUA]]Q: Was heisst das? [[GRAY]]Alle Skills von [[GOLD]]mcMMO[[GRAY]] fuegen,[[GRAY]]coole neue Sachen hinzu! [[GRAY]]Du kannst [[GREEN]]/{0}[[GRAY]] eingeben [[GRAY]]um dir die,[[GRAY]]Commands anzeigen zu lassen. [[GRAY]]Das Ziel,[[GRAY]]von [[GOLD]]mcMMO[[GRAY]] ist es dir ein hochwertiges [[GOLD]]RPG-System[[GRAY]] zu bieten.,[[DARK_AQUA]]Q: Wo kann ich neue Ideen vorschlagen?,[[GRAY]]Im mcMMO Thema auf [[AQUA]]dev.bukkit.org[[GRAY]],[[DARK_AQUA]]Q: Wie mache ich dies und das?,[[RED]]Bitte [[GRAY]]schau in das mcMMO WIKI! [[AQUA]]mcmmo.wikia.com,[[DARK_GRAY]]Uebersetzung: Jobsti
mcMMO.Description=mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]TheYeti [[BLUE]](Project Lead & Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Developer),[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Developer & Creator),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]www.mcmmo.org[[GOLD]] Official Website,[[GOLD]] - [[GREEN]]http://bit.ly/x3Yvry[[GOLD]] Bukkit Forum Thread,[[GOLD]] - [[GREEN]]https://twitter.com/#!/mcmmo_dev[[GOLD]] mcMMO Twitter,[[DARK_AQUA]]Donation Info:
Party.IsLocked=[[RED]]Gruppe ist gesperrt.
Party.Locked=[[RED]]Gruppe ist gesperrt, nur der Besitzer kann neue User einladen.
Party.IsntLocked=[[AQUA]]Gruppe ist nicht gesperrt
@@ -356,14 +346,8 @@ Commands.xprate.started2=[[YELLOW]]Die mcMMO XP RATE betraegt nun {0}x!!
Commands.xplock.locked=[[YELLOW]]Deine XP BAR ist nun auf {0} gesperrt!
Commands.xplock.unlocked=[[YELLOW]]Deine XP BAR ist nun wieder [[GREEN]]FREIGEGEBEN[[YELLOW]]!
Commands.xplock.invalid=[[RED]]Dies ist kein gueltiger Skillname! Versuche /xplock mining
m.SkillAlchemy=Alchemie(Alchemy)
m.SkillEnchanting=Verzaubern (Enchanting)
m.SkillFishing=Angeln (Fishing)
mcPlayerListener.AlchemySkill=[[AQUA]]Alchemie Skill [[DARK_AQUA]](Alchemy):
mcPlayerListener.EnchantingSkill=[[AQUA]]Verzauberungs Skill [[DARK_AQUA]](Enchanting):
mcPlayerListener.FishingSkill=[[YELLOW]]Angeln Skill [[DARK_AQUA]](Fishing):
Skills.AlchemyUp=[[AQUA]]Alchemie um [[YELLOW]]{0} erhoeht. Gesamt [[YELLOW]]({1})
Skills.EnchantingUp=[[AQUA]]Verzaubern um [[YELLOW]]{0} erhoeht. Gesamt [[YELLOW]]({1})
Skills.FishingUp=[[AQUA]]Angeln um [[YELLOW]]{0} erhoeht. Gesamt [[YELLOW]]({1})
Repair.LostEnchants=[[YELLOW]]Du hast nicht genug Skill, Verzauberung verloren.
Repair.ArcanePerfect=[[YELLOW]]Du hast die Arkanen Zauber in diesem Gegenstand erhalten.
@@ -374,8 +358,6 @@ m.EffectsRepair5_1=[[AQUA]]Verzauberte Gegenstaende reparieren
m.ArcaneForgingRank=[[YELLOW]]Arkanes Schmieden: [[GREEN]]Rang {0}/4
m.ArcaneEnchantKeepChance=[[AQUA]]AS Erfolgs-Chance: [[GREEN]]{0}%
m.ArcaneEnchantDowngradeChance=[[AQUA]]AS Downgrade-Chance: [[GREEN]]{0}%
m.ArcaneForgingMilestones=[[YELLOW]][TIP]Arkanes Schmieden: [[AQUA]]Rang 1 = 100+, Rang 2 = 250+,
m.ArcaneForgingMilestones2=[[AQUA]] Rang 3 = 500+, Rang 4 = 750+
Fishing.MagicFound=[[AQUA]]Du hast etwas magisches gefunden...
Fishing.ItemFound=[[AQUA]]Du hast einen Schatz gefunden!
m.SkillFishing=Angeln (Fishing)
@@ -394,4 +376,68 @@ m.TamingSummon=[[YELLOW]]Beschwoerung abgeschlossen
m.TamingSummonFailed=[[YELLOW]]Du hast zu viele Woelfe um dich um weitere zu beschwoeren.
m.EffectsTaming7_0=[[YELLOW]]Ruf der Wildniss
m.EffectsTaming7_1=[[AQUA]]Beschwoere einen Wolf auf deine Seite
m.EffectsTaming7_2=[[YELLOW]]Info: [[AQUA]]Ducken und Rechtsklick mit {0} Knochen in der Hand
m.EffectsTaming7_2=[[YELLOW]]Info: [[AQUA]]Ducken und Rechtsklick mit {0} Knochen in der Hand
m.EffectsTaming8_0=Fast Food Service
m.EffectsTaming8_1=Chance for wolves to heal on attack
m.AbilLockTaming5=LOCKED UNTIL 50+ SKILL (FAST FOOD SERVICE)
m.AbilBonusTaming5_0=Fast Food Service
m.AbilBonusTaming5_1=50% Chance for heal on attack
Swords.StoppedBleeding=[[GRAY]]The bleeding has [[GREEN]]stopped[[GRAY]]!
m.EffectsMining3_0=Blast Mining
m.EffectsMining3_1=Bonuses to mining with TNT
m.EffectsMining4_0=Bigger Bombs
m.EffectsMining4_1=Increases TNT explosion radius
m.EffectsMining5_0=Demolitions Expertise
m.EffectsMining5_1=Decreases damage from TNT explosions
m.AbilLockMining1=LOCKED UNTIL 125+ SKILL (BLAST MINING)
m.AbilLockMining2=LOCKED UNTIL 250+ SKILL (BIGGER BOMBS)
m.AbilLockMining3=LOCKED UNTIL 500+ SKILL (DEMOLITIONS EXPERTISE)
m.MiningBiggerBombs=[[RED]]Blast Radius Increase: [[YELLOW]]+{0}
m.MiningDemolitionsExpertDamageDecrease=[[RED]]Demolitions Expert Damage Decrease: [[YELLOW]]{0}%
m.MiningBlastMining=[[RED]]Blast Mining: [[YELLOW]] Rank {0} [[GRAY]]({1})
m.BlastMining1 = +35% ore yield
m.BlastMining2 = +40% ore yield
m.BlastMining3 = +45% ore yield, no debris
m.BlastMining4 = +50% ore yield, no debris
m.BlastMining5 = +55% ore yield, no debris, double drops
m.BlastMining6 = +60% ore yield, no debris, double drops
m.BlastMining7 = +65% ore yield, no debris, triple drops
m.BlastMining8 = +70% ore yield, no debris, triple drops
Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone.
Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron.
Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold.
Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large!
Axes.GreaterImpactOnSelf=[[RED]]**HIT BY GREATER IMPACT**
Axes.GreaterImpactOnEnemy=[[GREEN]]**STRUCK WITH GREAT FORCE**
Skills.BerserkPlayerOff=[[RED]]Berserk[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.GreenTerraPlayerOff=[[RED]]Green Terra[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.TreeFellerPlayerOff=[[RED]]Tree Feller[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SuperBreakerPlayerOff=[[RED]]Super Breaker[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SkullSplitterPlayerOff=[[RED]]Skull Splitter[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.GigaDrillBreakerPlayerOff=[[RED]]Giga Drill Breaker[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SerratedStrikesPlayerOff=[[RED]]Serrated Strikes[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.BlastMiningPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining!
Skills.YourBlastMining=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed!
TreeFeller.AxeSplinters=[[RED]]YOUR AXE SPLINTERS INTO DOZENS OF PIECES
Acrobatics.GracefulRoll=[[GREEN]]**GRACEFUL ROLL**
Acrobatics.Dodge=[[GREEN]]**DODGE**
Acrobatics.Roll=**ROLL**
Axes.HitCritically=[[DARK_RED]]You were CRITICALLY hit!
Axes.CriticalHit=[[RED]]CRITIAL HIT!
Axes.HitByCleave=[[DARK_RED]]Struck by CLEAVE!
Swords.EnemyBleeding=[[GREEN]]**ENEMY BLEEDING**
Swords.HitBySerratedStrikes=[[DARK_RED]]Struck by SERRATED STRIKES!
Swords.CounterAttacked=[[GREEN]]**COUNTER-ATTACKED**
Swords.HitByCounterAttack=[[DARK_RED]]Hit with a counter-attack!
Guides.Acrobatics=[[DARK_AQUA]]About Acrobatics:\n[[YELLOW]]Acrobatics is the art of moving gracefully in mcMMO.\n[[YELLOW]]It provides combat bonuses and environment damage bonuses.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to perform a dodge\n[[YELLOW]]in combat or survive falls from heights that damage you.\n\n[[DARK_AQUA]]How does Rolling work?\n[[YELLOW]]You have a passive chance when you take fall damage\n[[YELLOW]]to negate the damage done. You can hold the sneak button to\n[[YELLOW]]double your chances during the fall.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level\n[[DARK_AQUA]]How does Dodge work?\n[[YELLOW]]Dodge is a passive chance when you are\n[YELLOW]]injured in combat to halve the damage taken.\n[[YELLOW]]It is tied to your skill level.
Guides.Archery=Guide coming soon...
Guides.Axes=Guide coming soon...
Guides.Excavation=[[DARK_AQUA]]About Excavation:\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]By excavating the land you will find treasures.\n[[YELLOW]]The more you do this the more treasures you can find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand.\n[[YELLOW]]Only certain materials can be dug up for treasures and XP.\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand\n\n[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLOW]]With a shovel in hand right click to ready your tool.\n[[YELLOW]]Once in this state you have about 4 seconds to make\n[[YELLOW]]contact with Excavation compatible materials this will\n[[YELLOW]]activate Giga Drill Breaker.\n[[DARK_AQUA]]What is Giga Drill Breaker?\n[[YELLOW]]Giga Drill Breaker is an ability with a cooldown\n[[YELLOW]]tied to Excavation skill. It triples your chance\n[[YELLOW]]of finding treasures and enables instant break\n[[YELLOW]]on Excavation materials.\n\n[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]Every possible treasure for Excavation has its own\n[[YELLOW]]skill level requirement for it to drop, as a result it's\n[[YELLOW]]difficult to say how much it is helping you.\n[[YELLOW]]Just keep in mind that the higher your Excavation skill\n[[YELLOW]]is, the more treasures that can be found.\n[[YELLOW]]And also keep in mind that each type of Excavation\n[[YELLOW]]compatible material has its own unique list of treasures.\n[[YELLOW]]In other words you will find different treasures in Dirt\n[[YELLOW]]than you would in Gravel.\n[[DARK_AQUA]]Notes about Excavation:\n[[YELLOW]]Excavation drops are completely customizeable\n[[YELLOW]]So results vary server to server.
Guides.Fishing=Guide coming soon...
Guides.Herbalism=Guide coming soon...
Guides.Mining=[[DARK_AQUA]]About Mining:\n[[YELLOW]]Mining consists of mining stone and ores. It provides bonuses\n[[YELLOW]]to the amount of materials dropped while mining.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you must mine with a pickaxe in hand.\n[[YELLOW]]Only certain blocks award XP.\n\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Stone, Coal Ore, Iron Ore, Gold Ore, Diamond Ore, Redstone Ore,\n[[YELLOW]]Lapis Ore, Obsidian, Mossy Cobblestone, Ender Stone,\n[[YELLOW]]Glowstone, and Netherrack.\n\n[[DARK_AQUA]]How to use Super Breaker:\n[[YELLOW]]With a pickaxe in your hand, right click to ready your tool.\n[[YELLOW]]Once in this state, you have about 4 seconds to make contact\n[[YELLOW]]with Mining compatible materials, which will activate Super\n[[YELLOW]]Breaker.\n\n[[DARK_AQUA]]What is Super Breaker?\n[[YELLOW]]Super Breaker is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It triples your chance of extra items dropping and\n[[YELLOW]]enables instant break on Mining materials.\n\n[[DARK_AQUA]]How to use Blast Mining:\n[[YELLOW]]With a detonator in hand, which is a flint & steel by default,\n[[YELLOW]]right-click on TNT from a distance. This will cause the TNT\n[[YELLOW]]to instantly explode.\n\n[[DARK_AQUA]]How does Blast Mining work?\n[[YELLOW]]Blast Mining is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It gives bonuses when mining with TNT and allows you\n[[YELLOW]]to remote detonate TNT. There are three parts to Blast Mining.\n[[YELLOW]]The first part is Bigger Bombs, which increases blast radius.\n[[YELLOW]]The second is Demolitions Expert, which decreases damage\n[[YELLOW]]from TNT explosions. The third part simply increases the\n[[YELLOW]]amount of ores dropped from TNT and decreases the\n[[YELLOW]]debris dropped.
Guides.Repair=Guide coming soon...
Guides.Swords=Guide coming soon...
Guides.Taming=Guide coming soon...
Guides.Unarmed=Guide coming soon...
Guides.Woodcutting=Guide coming soon...

View File

@@ -23,11 +23,9 @@ m.mccPartyTeleport=[party member name] [[RED]]- Teleport to party member
m.mccOtherCommands=[[GREEN]]--OTHER COMMANDS--
m.mccStats=- View your mcMMO stats
m.mccLeaderboards=- Leaderboards
m.mccMySpawn=- Teleports to myspawn
m.mccClearMySpawn=- Clears your MySpawn
m.mccToggleAbility=- Toggle ability activation with right click
m.mccAdminToggle=- Toggle admin chat
m.mccWhois=[playername] [[RED]]- View detailed player info
m.mccInspect=[playername] [[RED]]- View detailed player info
m.mccMmoedit=[playername] [skill] [newvalue] [[RED]]- Modify target
m.mccMcGod=- God Mode
m.mccSkillInfo=[skillname] [[RED]]- View detailed information about a skill
@@ -40,7 +38,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1}
m.Effects=EFFECTS
m.YourStats=YOUR STATS
m.SkillTaming=TAMING
m.XPGainTaming=Wolves getting harmed
m.XPGainTaming=Animal Taming, or combat w/ your wolves
m.EffectsTaming1_0=Beast Lore
m.EffectsTaming1_1=Bone-whacking inspects wolves
m.EffectsTaming2_0=Gore
@@ -100,10 +98,18 @@ m.EffectsAxes1_1=Deal AoE Damage
m.EffectsAxes2_0=Critical Strikes
m.EffectsAxes2_1=Double Damage
m.EffectsAxes3_0=Axe Mastery
m.EffectsAxes3_1=Modifies Damage
m.AbilLockAxes1=LOCKED UNTIL 500+ SKILL (AXEMASTERY)
m.EffectsAxes3_1=Adds bonus DMG
m.EffectsAxes4_0=Impact
m.EffectsAxes4_1=Strike with enough force to shatter armor
m.EffectsAxes5_0=Greater Impact
m.EffectsAxes5_1=Deal bonus damage to unarmored foes
m.AbilLockAxes1=LOCKED UNTIL 500+ SKILL (AXE MASTERY)
m.AbilBonusAxes1_0=Axe Mastery
m.AbilBonusAxes1_1=Bonus 4 damage
m.AbilBonusAxes1_1=Bonus {0} damage
m.AbilBonusAxes2_0=Impact
m.AbilBonusAxes2_1=Deal {0} DMG to armor
m.AbilBonusAxes3_0=Greater Impact
m.AbilBonusAxes3_1=Deal {0} Bonus DMG to the unarmored
m.AxesCritChance=[[RED]]Chance to critically strike: [[YELLOW]]{0}%
m.AxesSkullLength=[[RED]]Skull Splitter Length: [[YELLOW]]{0}s
m.SkillSwords=SWORDS
@@ -141,6 +147,8 @@ m.EffectsMining1_0=Super Breaker (ABILITY)
m.EffectsMining1_1=Speed+, Triple Drop Chance
m.EffectsMining2_0=Double Drops
m.EffectsMining2_1=Double the normal loot
m.EffectsMining2_0=Double Drops
m.EffectsMining2_1=Double the normal loot
m.MiningDoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}%
m.MiningSuperBreakerLength=[[RED]]Super Breaker Length: [[YELLOW]]{0}s
m.SkillRepair=REPAIR
@@ -161,18 +169,12 @@ m.EffectsUnarmed1_0=Berserk (ABILITY)
m.EffectsUnarmed1_1=+50% DMG, Breaks weak materials
m.EffectsUnarmed2_0=Disarm (Players)
m.EffectsUnarmed2_1=Drops the foes item held in hand
m.EffectsUnarmed3_0=Unarmed Mastery
m.EffectsUnarmed3_1=Large Damage Upgrade
m.EffectsUnarmed4_0=Unarmed Apprentice
m.EffectsUnarmed4_1=Damage Upgrade
m.EffectsUnarmed3_0=Iron Arm Style
m.EffectsUnarmed3_1=Hardens your arm over time
m.EffectsUnarmed5_0=Arrow Deflect
m.EffectsUnarmed5_1=Deflect arrows
m.AbilLockUnarmed1=LOCKED UNTIL 250+ SKILL (UNARMED APPRENTICE)
m.AbilLockUnarmed2=LOCKED UNTIL 500+ SKILL (UNARMED MASTERY)
m.AbilBonusUnarmed1_0=Unarmed Apprentice
m.AbilBonusUnarmed1_1=+2 DMG Upgrade
m.AbilBonusUnarmed2_0=Unarmed Mastery
m.AbilBonusUnarmed2_1=+4 DMG Upgrade
m.AbilBonusUnarmed2_0=Iron Arm Style
m.AbilBonusUnarmed2_1=+{0} DMG Upgrade
m.UnarmedArrowDeflectChance=[[RED]]Arrow Deflect Chance: [[YELLOW]]{0}%
m.UnarmedDisarmChance=[[RED]]Disarm Chance: [[YELLOW]]{0}%
m.UnarmedBerserkLength=[[RED]]Berserk Length: [[YELLOW]]{0}s
@@ -182,24 +184,24 @@ m.EffectsHerbalism1_0=Green Terra (ABILITY)
m.EffectsHerbalism1_1=Spread the Terra, 3x Drops
m.EffectsHerbalism2_0=Green Thumb (Wheat)
m.EffectsHerbalism2_1=Auto-Plants wheat when harvesting
m.EffectsHerbalism3_0=Green Thumb (Cobble)
m.EffectsHerbalism3_1=Cobblestone -> Mossy w/ Seeds
m.EffectsHerbalism4_0=Food+
m.EffectsHerbalism4_1=Modifies health received from bread/stew
m.EffectsHerbalism3_0=Green Thumb (Cobble/Stone Brick)
m.EffectsHerbalism3_1=Cobblestone/Stone Brick -> Mossy w/ Seeds
m.EffectsHerbalism4_0=Farmer's Diet
m.EffectsHerbalism4_1=Improves hunger restored from herbalist foods
m.EffectsHerbalism5_0=Double Drops (All Herbs)
m.EffectsHerbalism5_1=Double the normal loot
m.HerbalismGreenTerraLength=[[RED]]Green Terra Length: [[YELLOW]]{0}s
m.HerbalismGreenThumbChance=[[RED]]Green Thumb Chance: [[YELLOW]]{0}%
m.HerbalismGreenThumbStage=[[RED]]Green Thumb Stage: [[YELLOW]] Wheat grows in stage {0}
m.HerbalismDoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}%
m.HerbalismFoodPlus=[[RED]]Food+ (Rank{0}): [[YELLOW]]Bonus {0} healing
m.HerbalismFoodPlus=[[RED]]Farmers Diet: [[YELLOW]]Rank {0}
m.SkillExcavation=EXCAVATION
m.XPGainExcavation=Digging and finding treasures
m.EffectsExcavation1_0=Giga Drill Breaker (ABILITY)
m.EffectsExcavation1_1=3x Drop Rate, 3x EXP, +Speed
m.EffectsExcavation2_0=Treasure Hunter
m.EffectsExcavation2_1=Ability to dig for treasure
m.ExcavationGreenTerraLength=[[RED]]Giga Drill Breaker Length: [[YELLOW]]{0}s
m.ExcavationGigaDrillBreakerLength=[[RED]]Giga Drill Breaker Length: [[YELLOW]]{0}s
mcBlockListener.PlacedAnvil=[[DARK_RED]]You have placed an anvil, anvils can repair tools and armor.
mcEntityListener.WolfComesBack=[[DARK_GRAY]]Your wolf scurries back to you...
mcPlayerListener.AbilitiesOff=Ability use toggled off
@@ -303,25 +305,15 @@ Skills.ExcavationUp=[[YELLOW]]Excavation skill increased by {0}. Total ({1})
Skills.FeltEasy=[[GRAY]]That felt easy.
Skills.StackedItems=[[DARK_RED]]You can't repair stacked items
Skills.NeedMore=[[DARK_RED]]You need more
Skills.AdeptDiamond=[[DARK_RED]]You're not skilled enough to repair Diamond
Skills.AdeptDiamond=[[DARK_RED]]You're not skilled enough to repair Diamond.
Skills.FullDurability=[[GRAY]]That is at full durability.
Skills.Disarmed=[[DARK_RED]]You have been disarmed!
mcPlayerListener.SorcerySkill=Sorcery:
m.SkillSorcery=SORCERY
Sorcery.HasCast=[[GREEN]]**CASTING**[[GOLD]]
Sorcery.Current_Mana=[[DARK_AQUA]]MP
Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]])
Sorcery.Cost=[[RED]][COST] {0} MP
Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Out Of Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]])
Sorcery.Water.Thunder=THUNDER
Sorcery.Curative.Self=CURE SELF
Sorcery.Curative.Other=CURE OTHER
m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]])
Combat.BeastLore=[[GREEN]]**BEAST LORE**
Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]])
Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/20)
Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/8)
mcMMO.Description=[[DARK_AQUA]]Q: WHAT IS IT?,[[GOLD]]mcMMO is an [[RED]]OPEN SOURCE[[GOLD]] RPG mod for Bukkit by [[BLUE]]nossr50,[[GOLD]]There are many skills added by mcMMO to Minecraft.,[[GOLD]]You can gain experience in many different ways,[[GOLD]]You will want to type [[GREEN]]/SKILLNAME[[GOLD]] to find out more about a skill.,[[DARK_AQUA]]Q: WHAT DOES IT DO?,[[GOLD]]As an example... in [[DARK_AQUA]]Mining[[GOLD]] you will receive benefits like,[[RED]]Double Drops[[GOLD]] or the ability [[RED]]Super Breaker[[GOLD]] which when,[[GOLD]]activated by right-click allows fast Mining during its duration,[[GOLD]]which is related to your skill level. Leveling [[BLUE]]Mining,[[GOLD]]is as simple as mining precious materials!,[[DARK_AQUA]]Q: WHAT DOES THIS MEAN?,[[GOLD]]Almost all of the skills in [[GREEN]]mcMMO[[GOLD]] add cool new things!.,[[GOLD]]You can also type [[GREEN]]/{0}[[GOLD]] to find out commands,[[GOLD]]The goal of mcMMO is to provide a quality RPG experience.,[[DARK_AQUA]]Q: WHERE DO I SUGGEST NEW STUFF!?,[[GOLD]]On the mcMMO thread in the bukkit forums!,[[DARK_AQUA]]Q: HOW DO I DO THIS AND THAT?,[[RED]]PLEASE [[GOLD]]checkout the wiki! [[DARK_AQUA]]mcmmo.wikia.com
mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]TheYeti [[BLUE]](Project Lead & Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Developer),[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Developer & Creator),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]www.mcmmo.org[[GOLD]] Official Website,[[GOLD]] - [[GREEN]]http://bit.ly/x3Yvry[[GOLD]] Bukkit Forum Thread,[[GOLD]] - [[GREEN]]https://twitter.com/#!/mcmmo_dev[[GOLD]] mcMMO Twitter,[[DARK_AQUA]]Donation Info:
Party.Locked=[[RED]]Party is locked, only party leader may invite.
Party.IsntLocked=[[GRAY]]Party is not locked
Party.Unlocked=[[GRAY]]Party is unlocked
@@ -349,14 +341,8 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
@@ -367,8 +353,6 @@ m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+
Fishing.MagicFound=[[GRAY]]You feel a touch of magic with this catch...
Fishing.ItemFound=[[GRAY]]Treasure found!
m.SkillFishing=FISHING
@@ -387,4 +371,68 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand
m.EffectsTaming8_0=Fast Food Service
m.EffectsTaming8_1=Chance for wolves to heal on attack
m.AbilLockTaming5=LOCKED UNTIL 50+ SKILL (FAST FOOD SERVICE)
m.AbilBonusTaming5_0=Fast Food Service
m.AbilBonusTaming5_1=50% Chance for heal on attack
Swords.StoppedBleeding=[[GRAY]]The bleeding has [[GREEN]]stopped[[GRAY]]!
m.EffectsMining3_0=Blast Mining
m.EffectsMining3_1=Bonuses to mining with TNT
m.EffectsMining4_0=Bigger Bombs
m.EffectsMining4_1=Increases TNT explosion radius
m.EffectsMining5_0=Demolitions Expertise
m.EffectsMining5_1=Decreases damage from TNT explosions
m.AbilLockMining1=LOCKED UNTIL 125+ SKILL (BLAST MINING)
m.AbilLockMining2=LOCKED UNTIL 250+ SKILL (BIGGER BOMBS)
m.AbilLockMining3=LOCKED UNTIL 500+ SKILL (DEMOLITIONS EXPERTISE)
m.MiningBiggerBombs=[[RED]]Blast Radius Increase: [[YELLOW]]+{0}
m.MiningDemolitionsExpertDamageDecrease=[[RED]]Demolitions Expert Damage Decrease: [[YELLOW]]{0}%
m.MiningBlastMining=[[RED]]Blast Mining: [[YELLOW]] Rank {0} [[GRAY]]({1})
m.BlastMining1 = +35% ore yield
m.BlastMining2 = +40% ore yield
m.BlastMining3 = +45% ore yield, no debris
m.BlastMining4 = +50% ore yield, no debris
m.BlastMining5 = +55% ore yield, no debris, double drops
m.BlastMining6 = +60% ore yield, no debris, double drops
m.BlastMining7 = +65% ore yield, no debris, triple drops
m.BlastMining8 = +70% ore yield, no debris, triple drops
Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone.
Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron.
Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold.
Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large!
Axes.GreaterImpactOnSelf=[[RED]]**HIT BY GREATER IMPACT**
Axes.GreaterImpactOnEnemy=[[GREEN]]**STRUCK WITH GREAT FORCE**
Skills.BerserkPlayerOff=[[RED]]Berserk[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.GreenTerraPlayerOff=[[RED]]Green Terra[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.TreeFellerPlayerOff=[[RED]]Tree Feller[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SuperBreakerPlayerOff=[[RED]]Super Breaker[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SkullSplitterPlayerOff=[[RED]]Skull Splitter[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.GigaDrillBreakerPlayerOff=[[RED]]Giga Drill Breaker[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SerratedStrikesPlayerOff=[[RED]]Serrated Strikes[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.BlastMiningPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining!
Skills.YourBlastMining=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed!
TreeFeller.AxeSplinters=[[RED]]YOUR AXE SPLINTERS INTO DOZENS OF PIECES
Acrobatics.GracefulRoll=[[GREEN]]**GRACEFUL ROLL**
Acrobatics.Dodge=[[GREEN]]**DODGE**
Acrobatics.Roll=**ROLL**
Axes.HitCritically=[[DARK_RED]]You were CRITICALLY hit!
Axes.CriticalHit=[[RED]]CRITIAL HIT!
Axes.HitByCleave=[[DARK_RED]]Struck by CLEAVE!
Swords.EnemyBleeding=[[GREEN]]**ENEMY BLEEDING**
Swords.HitBySerratedStrikes=[[DARK_RED]]Struck by SERRATED STRIKES!
Swords.CounterAttacked=[[GREEN]]**COUNTER-ATTACKED**
Swords.HitByCounterAttack=[[DARK_RED]]Hit with a counter-attack!
Guides.Acrobatics=[[DARK_AQUA]]About Acrobatics:\n[[YELLOW]]Acrobatics is the art of moving gracefully in mcMMO.\n[[YELLOW]]It provides combat bonuses and environment damage bonuses.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to perform a dodge\n[[YELLOW]]in combat or survive falls from heights that damage you.\n\n[[DARK_AQUA]]How does Rolling work?\n[[YELLOW]]You have a passive chance when you take fall damage\n[[YELLOW]]to negate the damage done. You can hold the sneak button to\n[[YELLOW]]double your chances during the fall.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level\n[[DARK_AQUA]]How does Dodge work?\n[[YELLOW]]Dodge is a passive chance when you are\n[YELLOW]]injured in combat to halve the damage taken.\n[[YELLOW]]It is tied to your skill level.
Guides.Archery=Guide coming soon...
Guides.Axes=Guide coming soon...
Guides.Excavation=[[DARK_AQUA]]About Excavation:\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]By excavating the land you will find treasures.\n[[YELLOW]]The more you do this the more treasures you can find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand.\n[[YELLOW]]Only certain materials can be dug up for treasures and XP.\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand\n\n[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLOW]]With a shovel in hand right click to ready your tool.\n[[YELLOW]]Once in this state you have about 4 seconds to make\n[[YELLOW]]contact with Excavation compatible materials this will\n[[YELLOW]]activate Giga Drill Breaker.\n[[DARK_AQUA]]What is Giga Drill Breaker?\n[[YELLOW]]Giga Drill Breaker is an ability with a cooldown\n[[YELLOW]]tied to Excavation skill. It triples your chance\n[[YELLOW]]of finding treasures and enables instant break\n[[YELLOW]]on Excavation materials.\n\n[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]Every possible treasure for Excavation has its own\n[[YELLOW]]skill level requirement for it to drop, as a result it's\n[[YELLOW]]difficult to say how much it is helping you.\n[[YELLOW]]Just keep in mind that the higher your Excavation skill\n[[YELLOW]]is, the more treasures that can be found.\n[[YELLOW]]And also keep in mind that each type of Excavation\n[[YELLOW]]compatible material has its own unique list of treasures.\n[[YELLOW]]In other words you will find different treasures in Dirt\n[[YELLOW]]than you would in Gravel.\n[[DARK_AQUA]]Notes about Excavation:\n[[YELLOW]]Excavation drops are completely customizeable\n[[YELLOW]]So results vary server to server.
Guides.Fishing=Guide coming soon...
Guides.Herbalism=Guide coming soon...
Guides.Mining=[[DARK_AQUA]]About Mining:\n[[YELLOW]]Mining consists of mining stone and ores. It provides bonuses\n[[YELLOW]]to the amount of materials dropped while mining.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you must mine with a pickaxe in hand.\n[[YELLOW]]Only certain blocks award XP.\n\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Stone, Coal Ore, Iron Ore, Gold Ore, Diamond Ore, Redstone Ore,\n[[YELLOW]]Lapis Ore, Obsidian, Mossy Cobblestone, Ender Stone,\n[[YELLOW]]Glowstone, and Netherrack.\n\n[[DARK_AQUA]]How to use Super Breaker:\n[[YELLOW]]With a pickaxe in your hand, right click to ready your tool.\n[[YELLOW]]Once in this state, you have about 4 seconds to make contact\n[[YELLOW]]with Mining compatible materials, which will activate Super\n[[YELLOW]]Breaker.\n\n[[DARK_AQUA]]What is Super Breaker?\n[[YELLOW]]Super Breaker is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It triples your chance of extra items dropping and\n[[YELLOW]]enables instant break on Mining materials.\n\n[[DARK_AQUA]]How to use Blast Mining:\n[[YELLOW]]With a detonator in hand, which is a flint & steel by default,\n[[YELLOW]]right-click on TNT from a distance. This will cause the TNT\n[[YELLOW]]to instantly explode.\n\n[[DARK_AQUA]]How does Blast Mining work?\n[[YELLOW]]Blast Mining is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It gives bonuses when mining with TNT and allows you\n[[YELLOW]]to remote detonate TNT. There are three parts to Blast Mining.\n[[YELLOW]]The first part is Bigger Bombs, which increases blast radius.\n[[YELLOW]]The second is Demolitions Expert, which decreases damage\n[[YELLOW]]from TNT explosions. The third part simply increases the\n[[YELLOW]]amount of ores dropped from TNT and decreases the\n[[YELLOW]]debris dropped.
Guides.Repair=Guide coming soon...
Guides.Swords=Guide coming soon...
Guides.Taming=Guide coming soon...
Guides.Unarmed=Guide coming soon...
Guides.Woodcutting=Guide coming soon...

View File

@@ -23,11 +23,9 @@ m.mccPartyTeleport=[party member name] [[RED]]- Teletransportate a un miembro de
m.mccOtherCommands=[[GREEN]]--OTROS COMANDOS--
m.mccStats=- Mira tus estadisticas de McMMO
m.mccLeaderboards=- Ranking de lideres
m.mccMySpawn=- Teletransportate a tu lugar de nacimiento
m.mccClearMySpawn=- Limpia tu lugar de nacimiento
m.mccToggleAbility=- Activa/Desactiva la activacion de la habilidad con el click derecho
m.mccAdminToggle=- Activa/Desactiva el chat de admins
m.mccWhois=[playername] [[RED]]- Mira informacion detallada del jugador
m.mccInspect=[playername] [[RED]]- Mira informacion detallada del jugador
m.mccMmoedit=[playername] [skill] [newvalue] [[RED]]- Modifica el objetivo
m.mccMcGod=- Modo dios
m.mccSkillInfo=[skillname] [[RED]]- Mira informacion detallada sobre una habilidad
@@ -40,7 +38,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1}
m.Effects=EFECTOS
m.YourStats=TUS ESTADISTICAS
m.SkillTaming=DOMADURA
m.XPGainTaming=Lobos siendo lastimados
m.XPGainTaming=Animal Taming, or combat w/ your wolves
m.EffectsTaming1_0=Leyenda de bestias
m.EffectsTaming1_1=Golpear con huesos examina a los lobos
m.EffectsTaming2_0=Sangre
@@ -99,11 +97,19 @@ m.EffectsAxes1_0=Cortador de cabecas (HABILIDAD)
m.EffectsAxes1_1=Causa daños en arena
m.EffectsAxes2_0=Golpes criticos
m.EffectsAxes2_1=Doble de daño
m.EffectsAxes3_0=Maestria de hacha
m.EffectsAxes3_1=Modifica el daño
m.AbilLockAxes1=BLOQUEADO HASTA TENER HABILIDAD +500 (MAESTRIA DE HACHA)
m.AbilBonusAxes1_0=Maestria de hacha
m.AbilBonusAxes1_1=4 de daño de bonus
m.EffectsAxes3_0=Axe Mastery
m.EffectsAxes3_1=Adds bonus DMG
m.EffectsAxes4_0=Impact
m.EffectsAxes4_1=Strike with enough force to shatter armor
m.EffectsAxes5_0=Greater Impact
m.EffectsAxes5_1=Deal bonus damage to unarmored foes
m.AbilLockAxes1=LOCKED UNTIL 500+ SKILL (AXE MASTERY)
m.AbilBonusAxes1_0=Axe Mastery
m.AbilBonusAxes1_1=Bonus {0} damage
m.AbilBonusAxes2_0=Impact
m.AbilBonusAxes2_1=Deal {0} DMG to armor
m.AbilBonusAxes3_0=Greater Impact
m.AbilBonusAxes3_1=Deal {0} Bonus DMG to the unarmored
m.AxesCritChance=[[RED]]Posibilad de golpe critico: [[YELLOW]]{0}%
m.AxesSkullLength=[[RED]]Longitud de Cortador de cabezas: [[YELLOW]]{0}s
m.SkillSwords=ESPADAS
@@ -161,18 +167,12 @@ m.EffectsUnarmed1_0=Enloquecer (HABILIDAD)
m.EffectsUnarmed1_1=+50% daño, Romper materiales fragiles
m.EffectsUnarmed2_0=Desarmar (Jugadores)
m.EffectsUnarmed2_1=Caida del objeto de mano del enemigo
m.EffectsUnarmed3_0=Maestro desarmado
m.EffectsUnarmed3_1=Mejora de grandes daños
m.EffectsUnarmed4_0=Aprendiz desarmado
m.EffectsUnarmed4_1=Mejora de daños
m.EffectsUnarmed3_0=Iron Arm Style
m.EffectsUnarmed3_1=Hardens your arm over time
m.EffectsUnarmed5_0=Desviar flechas
m.EffectsUnarmed5_1=Desviar flechas
m.AbilLockUnarmed1=BLOQUEADO HASTA TENER HABILIDAD +250 (APRENDIZ DESARMADO)
m.AbilLockUnarmed2=BLOQUEADO HASTA TENER HABILIDAD +500 (MAESTRO DESARMADO)
m.AbilBonusUnarmed1_0=Aprendiz desarmado
m.AbilBonusUnarmed1_1=Mejora de +2 de daño
m.AbilBonusUnarmed2_0=Maestro desarmado
m.AbilBonusUnarmed2_1=Mejora de +4 de daño
m.AbilBonusUnarmed2_0=Iron Arm Style
m.AbilBonusUnarmed2_1=+{0} DMG Upgrade
m.UnarmedArrowDeflectChance=[[RED]]Posibilidad de Desviar flechas: [[YELLOW]]{0}%
m.UnarmedDisarmChance=[[RED]]Posibilidad de Desarmar: [[YELLOW]]{0}%
m.UnarmedBerserkLength=[[RED]]Posibilidad de Enloquecer: [[YELLOW]]{0}s
@@ -184,22 +184,22 @@ m.EffectsHerbalism2_0=Dedos verdes (Trigo)
m.EffectsHerbalism2_1=Autoplanta el trigo al recolectarlo
m.EffectsHerbalism3_0=Dedos verdes (Piedras)
m.EffectsHerbalism3_1=Transorma Cobblestone en Moss Stone (usa semillas)
m.EffectsHerbalism4_0=+ Comida
m.EffectsHerbalism4_1=Modifica la vida recivida por el pan/guiso
m.EffectsHerbalism4_0=Farmer's Diet
m.EffectsHerbalism4_1=Improves hunger restored from herbalist foods
m.EffectsHerbalism5_0=Doble beneficio (Todas las hierbas)
m.EffectsHerbalism5_1=Dobla el botin normal
m.HerbalismGreenTerraLength=[[RED]]Duracion de Tierra verde: [[YELLOW]]{0}s
m.HerbalismGreenThumbChance=[[RED]]Posibilidad de Dedos verdes: [[YELLOW]]{0}%
m.HerbalismGreenThumbStage=[[RED]]Etapa de Dedos verdes: [[YELLOW]] El Trigo crece en la etapa {0}
m.HerbalismDoubleDropChance=[[RED]]Posibilidad de Doble beneficio: [[YELLOW]]{0}%
m.HerbalismFoodPlus=[[RED]]+ Comida (Rank{0}): [[YELLOW]]{0} de Bonus de Curacion
m.HerbalismFoodPlus=[[RED]]Farmers Diet: [[YELLOW]]Rank {0}
m.SkillExcavation=EXCAVACION
m.XPGainExcavation=Excavar y encontrar tesoros
m.EffectsExcavation1_0=Ultra perforador (HABILIDAD)
m.EffectsExcavation1_1=Triple beneficio, Triple EXP, + Velocidad
m.EffectsExcavation2_0=Cazatesoros
m.EffectsExcavation2_1=Habilidad para excavar y obtener tesoros
m.ExcavationGreenTerraLength=[[RED]]Duracion de Ultra perforador: [[YELLOW]]{0}s
m.ExcavationGigaDrillBreakerLength=[[RED]]Duracion de Ultra perforador: [[YELLOW]]{0}s
mcBlockListener.PlacedAnvil=[[DARK_RED]]Has establecido un yunque, Los yunques pueden reparar herramientas y armadura.
mcEntityListener.WolfComesBack=[[DARK_GRAY]]El lobo se escabuye hacia ti...
mcPlayerListener.AbilitiesOff=Uso de habilidad desactivada
@@ -306,22 +306,12 @@ Skills.NeedMore=[[DARK_RED]]Necesitas mas
Skills.AdeptDiamond=[[DARK_RED]]No tienes habilidades suficientes para reparar Diamante
Skills.FullDurability=[[GRAY]]Esto esta a su maxima duracion
Skills.Disarmed=[[DARK_RED]]Has sido desarmado!
mcPlayerListener.SorcerySkill=Hechiceria:
m.SkillSorcery=HECHICERIA
Sorcery.HasCast=[[GREEN]]**FUNDICION**[[GOLD]]
Sorcery.Current_Mana=[[DARK_AQUA]]MP
Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]])
Sorcery.Cost=[[RED]][COST] {0} MP
Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Sin Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]])
Sorcery.Water.Thunder=TRUENO
Sorcery.Curative.Self=CURARSE A SI MISMO
Sorcery.Curative.Other=CURAR A OTRO
m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]EXP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]])
Combat.BeastLore=[[GREEN]]**LEYENDA DE BESTIAS**
Combat.BeastLoreOwner=[[DARK_AQUA]]Dueño ([[RED]]{0}[[DARK_AQUA]])
Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Salud ([[GREEN]]{0}[[DARK_AQUA]]/20)
Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Salud ([[GREEN]]{0}[[DARK_AQUA]]/8)
mcMMO.Description=[[DARK_AQUA]]Q: QUE ES ESTO?,[[GOLD]]mcMMO es un MOD de [[RED]]CODIGO LIBRE[[GOLD]] para Bukkit por [[BLUE]]nossr50,[[GOLD]]Hay muchas habilidades añadidas por mcMMO para Minecraft.,[[GOLD]]Puedes ganar experiencia de muchas formas diferentes,[[GOLD]]Tu querras escribir [[GREEN]]/SKILLNAME[[GOLD]] para saber mas sobre una habilidad.,[[DARK_AQUA]]Q: QUE HACE?,[[GOLD]]Por ejemplo... en [[DARK_AQUA]]Mineria[[GOLD]] recibiras recompensas como,[[RED]]Doble beneficio[[GOLD]] o la habilidad [[RED]]Super Rompedor[[GOLD]] que cuando[[GOLD]] se activa con el click derecho permite la Mineria durante su duracion,[[GOLD]]que esta relacionado con tu nivel de habilidad. Subiendo de nivel en [[BLUE]]Mineria,[[GOLD]]es tan sencillo como minar simples materiales!
mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]TheYeti [[BLUE]](Project Lead & Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Developer),[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Developer & Creator),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]www.mcmmo.org[[GOLD]] Official Website,[[GOLD]] - [[GREEN]]http://bit.ly/x3Yvry[[GOLD]] Bukkit Forum Thread,[[GOLD]] - [[GREEN]]https://twitter.com/#!/mcmmo_dev[[GOLD]] mcMMO Twitter,[[DARK_AQUA]]Donation Info:
Party.Locked=[[RED]]La fiesta esta bloqueda, solo el lider puede invitarte
Party.IsntLocked=[[GRAY]]La fiesta no esta bloqueada
Party.Unlocked=[[GRAY]]La fiesta esta desbloqueada
@@ -349,14 +339,8 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE ES AHORA {0}x!!
Commands.xplock.locked=[[GOLD]]Tu BARRA DE EXP esta bloqueada a {0}!
Commands.xplock.unlocked=[[GOLD]]Tu BARRA DE EXP esta ahora [[GREEN]]DESBLOQUEADA[[GOLD]]!
Commands.xplock.invalid=[[RED]]Ese no es un nombre de habilidad valido! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
@@ -367,8 +351,6 @@ m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+
Fishing.MagicFound=[[GRAY]]You feel a touch of magic with this catch...
Fishing.ItemFound=[[GRAY]]Treasure found!
m.SkillFishing=FISHING
@@ -387,4 +369,68 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand
m.EffectsTaming8_0=Fast Food Service
m.EffectsTaming8_1=Chance for wolves to heal on attack
m.AbilLockTaming5=LOCKED UNTIL 50+ SKILL (FAST FOOD SERVICE)
m.AbilBonusTaming5_0=Fast Food Service
m.AbilBonusTaming5_1=50% Chance for heal on attack
Swords.StoppedBleeding=[[GRAY]]The bleeding has [[GREEN]]stopped[[GRAY]]!
m.EffectsMining3_0=Blast Mining
m.EffectsMining3_1=Bonuses to mining with TNT
m.EffectsMining4_0=Bigger Bombs
m.EffectsMining4_1=Increases TNT explosion radius
m.EffectsMining5_0=Demolitions Expertise
m.EffectsMining5_1=Decreases damage from TNT explosions
m.AbilLockMining1=LOCKED UNTIL 125+ SKILL (BLAST MINING)
m.AbilLockMining2=LOCKED UNTIL 250+ SKILL (BIGGER BOMBS)
m.AbilLockMining3=LOCKED UNTIL 500+ SKILL (DEMOLITIONS EXPERTISE)
m.MiningBiggerBombs=[[RED]]Blast Radius Increase: [[YELLOW]]+{0}
m.MiningDemolitionsExpertDamageDecrease=[[RED]]Demolitions Expert Damage Decrease: [[YELLOW]]{0}%
m.MiningBlastMining=[[RED]]Blast Mining: [[YELLOW]] Rank {0} [[GRAY]]({1})
m.BlastMining1 = +35% ore yield
m.BlastMining2 = +40% ore yield
m.BlastMining3 = +45% ore yield, no debris
m.BlastMining4 = +50% ore yield, no debris
m.BlastMining5 = +55% ore yield, no debris, double drops
m.BlastMining6 = +60% ore yield, no debris, double drops
m.BlastMining7 = +65% ore yield, no debris, triple drops
m.BlastMining8 = +70% ore yield, no debris, triple drops
Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone.
Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron.
Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold.
Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large!
Axes.GreaterImpactOnSelf=[[RED]]**HIT BY GREATER IMPACT**
Axes.GreaterImpactOnEnemy=[[GREEN]]**STRUCK WITH GREAT FORCE**
Skills.BerserkPlayerOff=[[RED]]Berserk[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.GreenTerraPlayerOff=[[RED]]Green Terra[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.TreeFellerPlayerOff=[[RED]]Tree Feller[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SuperBreakerPlayerOff=[[RED]]Super Breaker[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SkullSplitterPlayerOff=[[RED]]Skull Splitter[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.GigaDrillBreakerPlayerOff=[[RED]]Giga Drill Breaker[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.SerratedStrikesPlayerOff=[[RED]]Serrated Strikes[[GREEN]] has worn off for [[YELLOW]]{0}
Skills.BlastMiningPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining!
Skills.YourBlastMining=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed!
TreeFeller.AxeSplinters=[[RED]]YOUR AXE SPLINTERS INTO DOZENS OF PIECES
Acrobatics.GracefulRoll=[[GREEN]]**GRACEFUL ROLL**
Acrobatics.Dodge=[[GREEN]]**DODGE**
Acrobatics.Roll=**ROLL**
Axes.HitCritically=[[DARK_RED]]You were CRITICALLY hit!
Axes.CriticalHit=[[RED]]CRITIAL HIT!
Axes.HitByCleave=[[DARK_RED]]Struck by CLEAVE!
Swords.EnemyBleeding=[[GREEN]]**ENEMY BLEEDING**
Swords.HitBySerratedStrikes=[[DARK_RED]]Struck by SERRATED STRIKES!
Swords.CounterAttacked=[[GREEN]]**COUNTER-ATTACKED**
Swords.HitByCounterAttack=[[DARK_RED]]Hit with a counter-attack!
Guides.Acrobatics=[[DARK_AQUA]]About Acrobatics:\n[[YELLOW]]Acrobatics is the art of moving gracefully in mcMMO.\n[[YELLOW]]It provides combat bonuses and environment damage bonuses.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to perform a dodge\n[[YELLOW]]in combat or survive falls from heights that damage you.\n\n[[DARK_AQUA]]How does Rolling work?\n[[YELLOW]]You have a passive chance when you take fall damage\n[[YELLOW]]to negate the damage done. You can hold the sneak button to\n[[YELLOW]]double your chances during the fall.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level\n[[DARK_AQUA]]How does Dodge work?\n[[YELLOW]]Dodge is a passive chance when you are\n[YELLOW]]injured in combat to halve the damage taken.\n[[YELLOW]]It is tied to your skill level.
Guides.Archery=Guide coming soon...
Guides.Axes=Guide coming soon...
Guides.Excavation=[[DARK_AQUA]]About Excavation:\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]By excavating the land you will find treasures.\n[[YELLOW]]The more you do this the more treasures you can find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand.\n[[YELLOW]]Only certain materials can be dug up for treasures and XP.\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand\n\n[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLOW]]With a shovel in hand right click to ready your tool.\n[[YELLOW]]Once in this state you have about 4 seconds to make\n[[YELLOW]]contact with Excavation compatible materials this will\n[[YELLOW]]activate Giga Drill Breaker.\n[[DARK_AQUA]]What is Giga Drill Breaker?\n[[YELLOW]]Giga Drill Breaker is an ability with a cooldown\n[[YELLOW]]tied to Excavation skill. It triples your chance\n[[YELLOW]]of finding treasures and enables instant break\n[[YELLOW]]on Excavation materials.\n\n[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]Every possible treasure for Excavation has its own\n[[YELLOW]]skill level requirement for it to drop, as a result it's\n[[YELLOW]]difficult to say how much it is helping you.\n[[YELLOW]]Just keep in mind that the higher your Excavation skill\n[[YELLOW]]is, the more treasures that can be found.\n[[YELLOW]]And also keep in mind that each type of Excavation\n[[YELLOW]]compatible material has its own unique list of treasures.\n[[YELLOW]]In other words you will find different treasures in Dirt\n[[YELLOW]]than you would in Gravel.\n[[DARK_AQUA]]Notes about Excavation:\n[[YELLOW]]Excavation drops are completely customizeable\n[[YELLOW]]So results vary server to server.
Guides.Fishing=Guide coming soon...
Guides.Herbalism=Guide coming soon...
Guides.Mining=[[DARK_AQUA]]About Mining:\n[[YELLOW]]Mining consists of mining stone and ores. It provides bonuses\n[[YELLOW]]to the amount of materials dropped while mining.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you must mine with a pickaxe in hand.\n[[YELLOW]]Only certain blocks award XP.\n\n[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Stone, Coal Ore, Iron Ore, Gold Ore, Diamond Ore, Redstone Ore,\n[[YELLOW]]Lapis Ore, Obsidian, Mossy Cobblestone, Ender Stone,\n[[YELLOW]]Glowstone, and Netherrack.\n\n[[DARK_AQUA]]How to use Super Breaker:\n[[YELLOW]]With a pickaxe in your hand, right click to ready your tool.\n[[YELLOW]]Once in this state, you have about 4 seconds to make contact\n[[YELLOW]]with Mining compatible materials, which will activate Super\n[[YELLOW]]Breaker.\n\n[[DARK_AQUA]]What is Super Breaker?\n[[YELLOW]]Super Breaker is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It triples your chance of extra items dropping and\n[[YELLOW]]enables instant break on Mining materials.\n\n[[DARK_AQUA]]How to use Blast Mining:\n[[YELLOW]]With a detonator in hand, which is a flint & steel by default,\n[[YELLOW]]right-click on TNT from a distance. This will cause the TNT\n[[YELLOW]]to instantly explode.\n\n[[DARK_AQUA]]How does Blast Mining work?\n[[YELLOW]]Blast Mining is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It gives bonuses when mining with TNT and allows you\n[[YELLOW]]to remote detonate TNT. There are three parts to Blast Mining.\n[[YELLOW]]The first part is Bigger Bombs, which increases blast radius.\n[[YELLOW]]The second is Demolitions Expert, which decreases damage\n[[YELLOW]]from TNT explosions. The third part simply increases the\n[[YELLOW]]amount of ores dropped from TNT and decreases the\n[[YELLOW]]debris dropped.
Guides.Repair=Guide coming soon...
Guides.Swords=Guide coming soon...
Guides.Taming=Guide coming soon...
Guides.Unarmed=Guide coming soon...
Guides.Woodcutting=Guide coming soon...

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