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

Compare commits

...

225 Commits

Author SHA1 Message Date
TfT_02
8f4096cf1d Calculate Alchemy XP based on potion stage
Adds #1926
2014-06-08 23:03:26 +02:00
TfT_02
28a846e0cb Update changelog 2014-06-08 18:23:07 +02:00
TfT_02
0185a30ec9 Fix an IndexOutOfBoundsException: Index: 0
In SaveTimerTask.java

Fixes #2039
2014-06-08 18:21:13 +02:00
TfT_02
38e1947302 Remove PvpLogger checks
No longer needed when testing with Combat Tag v6.1.4, the NPCs have
metadata „NPC”.

Fixes #2017
2014-06-08 18:11:18 +02:00
riking
4fb4d6fc0c Save users asynchronously 2014-06-08 14:12:25 +02:00
TfT_02
6d719988bf Remove this check here, allows Salvage in Adv mode
We’re already checking if the players game mode isn’t CREATIVE, so we
can safely remove this check.

Fixes #2059
2014-06-03 12:23:42 +02:00
TfT_02
b1c1f0e21e Added missing Salvage permissions to plugin.yml 2014-05-25 23:45:20 +02:00
TfT_02
3f34cc7365 Actually fix maximumQuantity reading from config
Now we try to automatically detect the maximum quantity if possible and
fall back to the config if the user has set a value there.

Also fixed the feedback message which said „Minimum quantity” instead
of „Maximum quantity”
2014-05-25 23:20:19 +02:00
TfT_02
3c6c2837bd Check permission before sending anvil messages 2014-05-25 22:46:35 +02:00
TfT_02
4bcef76fd8 Let config key take priority here 2014-05-24 15:42:15 +02:00
TfT_02
2fd5d7aa81 Cleanup RepairConfig leftovers in SalvageConfig
Some copy/pasta I forgot to remove
2014-05-24 15:24:25 +02:00
TfT_02
5080c68dce Fix Maximum Quantity in Salvage configs 2014-05-24 15:23:50 +02:00
TfT_02
3403aef37d Don't display child skills on scoreboards
This fixes an issue where the scoreboard would not display properly
when using /mcstats or /inspect.

Fixes #2037
2014-05-23 17:03:02 +02:00
TfT_02
53a34c12d2 Add SALVAGE to MISC_SKILLS List 2014-05-23 14:23:05 +02:00
TfT_02
59417d6721 Add changelog entry for Salvage child skill
Closes #561
2014-05-19 16:59:28 +02:00
TfT_02
93d63dbca5 Minor cleanup of imports 2014-05-18 17:06:50 +02:00
TfT_02
4643cf1070 A whole bunch of more work to convert Salvage to a child skill 2014-05-18 17:04:39 +02:00
GJ
91bf54019e Convert Salvage to a child skill. 2014-05-18 17:04:38 +02:00
TfT_02
ead716ef0d Fix a NPE when tab completing with /ptp
Fixes #2013
2014-05-11 18:33:50 +02:00
TfT_02
8fec1af257 Fix a bunch of small formatting issues 2014-05-11 15:15:44 +02:00
Sean Porter
99248caba3 Redstone ore now throws events when it flips on or off.
Fixes issue #2021
2014-05-11 01:30:11 -07:00
TfT_02
af64bdf742 Added API to check if an entity is bleeding 2014-05-02 19:41:44 +02:00
TfT_02
66a4925371 Use getAllyName() here instead 2014-05-02 00:53:05 +02:00
TfT_02
8eb6acd60f Add option to prevent hopper transfers of bottles 2014-04-27 15:03:07 +02:00
TfT_02
ce6892f2e6 Update README.md 2014-04-24 16:00:02 +02:00
TfT_02
c14a4e9305 Fix /party teleport command
Why did we use getCommand("ptp").getExecutor() again?

Fixes #1995
2014-04-21 14:54:09 +02:00
TfT_02
5825eb1696 Make sure to shorten long ability and skill names
(cherry picked from commit 236ccd6ebdd0834f87b373794e1597ef36fb2ff6)
2014-04-21 14:09:52 +02:00
TfT_02
bfebbd0095 Fix formatting
(cherry picked from commit 4e36073e6e2dc3aeba087d605cef79fc4a8a9779)
2014-04-21 14:09:41 +02:00
GJ
b204507a82 Use strings instead of OfflinePlayers for scoreboards.
(cherry picked from commit 89b596591ec1974e0201395dc6e76353e4709572)
2014-04-21 14:09:09 +02:00
TfT_02
9f53426511 Added API to XP events to get XP gain reason 2014-04-18 22:32:32 +02:00
Sean Porter
03c2282c3f Fix the calculations for Iron Arm Style in the Unarmed command. 2014-04-18 02:16:35 -07:00
TfT_02
20092d55fd Fix bug where dodge would check the wrong player 2014-04-18 00:49:40 +02:00
TfT_02
69a2a5cfff Check if player has a mcMMOPlayer object
Fixes #1976
2014-04-12 17:06:14 +02:00
TfT_02
618cfad100 Prevent accidentally breaking regrown crops
Adds #828
2014-04-06 14:41:40 +02:00
TfT_02
56e625a9df Added option to open /mcstats after logging in
Added #1033
2014-04-06 13:27:38 +02:00
TfT_02
79a1ef5d3e Players need to be in a party to use /ptp
Fixes #1967
2014-04-06 12:43:42 +02:00
TfT_02
10dd7619bf Support MATERIAL|data format in treasures.yml
Allows users to use the same material type for multiple treasures in
treasures.yml

Fixes #1965
2014-04-05 18:31:01 +02:00
TfT_02
f9dfec5bd0 Check event.getBow() != null
Fixes #1933
2014-04-05 13:55:10 +02:00
TfT_02
a9488bc18b Vanished players no longer get hit by AoE effects
Fixes #1964
2014-04-05 13:12:20 +02:00
TfT_02
f0ee708710 Updater should not be running on the main thread
Fixes #1957
2014-04-05 12:10:02 +02:00
TfT_02
3390a31cc6 Move PlayerUpdateInventoryTask to runnables.player 2014-04-05 11:59:36 +02:00
t00thpick1
0b4b272223 Account for level 0 2014-04-01 14:58:24 -04:00
TfT_02
8d200ea653 Back to active development 2014-03-29 18:28:26 +01:00
TfT_02
eb359c5595 Update pom.xml and changelog.txt for 1.5.00 release 2014-03-29 17:52:08 +01:00
TfT_02
e1b8088c17 Improve holiday manager with 1.7 changes 2014-03-29 17:50:29 +01:00
TfT_02
70a1eea231 Nerf Herbalism XP from Tall Grass 2014-03-29 17:12:55 +01:00
TfT_02
c744974192 Added option to config.yml to override vanilla Minecraft treasures 2014-03-29 17:12:55 +01:00
TfT_02
faa11a87a9 Removed "Treasure found!" message
Because when treasures are found in vanilla Minecraft, there isn’t a
message either
2014-03-29 17:12:55 +01:00
TfT_02
91da5c4ab1 Add option to drop extra fish
Allows enabling of old fishing mechanic where fish was always caught,
even when a treasure was found
2014-03-29 17:12:54 +01:00
GJ
da5e770e06 Add Podzol & Red Sand to Excavation 2014-03-29 17:12:54 +01:00
TfT_02
09557e378b Update to the new ProjectileSource API 2014-03-29 17:12:54 +01:00
TfT_02
72d26fed0f Update version number to 1.5.00 2014-03-29 17:12:54 +01:00
TfT_02
225de799e8 Increase TreasureHunter chances for Luck enchantment
When the player is using a fishing rod with the ”Luck of the Sea”
enchantment, the drop chances will increase with 1% for each level of
the enchantment.
2014-03-29 17:12:36 +01:00
TfT_02
334c44760f Workaround for ClassCastException: MaterialData cannot be cast to Tree 2014-03-29 17:12:36 +01:00
TfT_02
ac7fc1020d Use tree species for Woodcutting double drops in config.yml
Oak is now Generic, and Spruce is now Redwood.
2014-03-29 17:12:36 +01:00
riking
461871327b Include new 1.7 biomes in fishing biome XP boost and Ice Fishing check 2014-03-29 17:12:36 +01:00
GJ
60ddd799de Update mcMMO for Minecraft 1.7.2 2014-03-29 17:12:35 +01:00
GJ
80571fbe8f Remove deprecated permission nodes 2014-03-29 17:12:35 +01:00
TfT_02
d407f85704 Update pom.xml and changelog.txt for 1.4.08 release 2014-03-29 17:06:01 +01:00
TfT_02
458dc7db42 Make database command cooldown configurable 2014-03-29 17:02:08 +01:00
TfT_02
beab794c0e Fixed some issues with the HolidayManager
Was severely lacking more lols
2014-03-29 16:52:41 +01:00
TfT_02
8256f5461c Using an axe is required to earn Woodcutting XP
Not really sure why or when this check had gone missing..
2014-03-26 09:52:59 +01:00
TfT_02
0fe3ad7432 Reworked COTW config options + made COTW item configurable
Adresses #1481 partially
2014-03-23 14:33:57 +01:00
TfT_02
04e5dda127 Actually fix Repair lucky perk with Arcane Forging downgrade chance 2014-03-23 14:33:57 +01:00
TfT_02
f65adea2f9 Added minimum jump strength requirement and config option
for horses summoned with "Call of the Wild"
2014-03-23 13:41:31 +01:00
TfT_02
cdfb0da5c9 Fixed bug where shift right clicking potion ingredients was broken 2014-03-23 12:59:43 +01:00
TfT_02
cfa3d34dff Fix important bug regarding pistons 2014-03-14 15:23:28 +01:00
TfT_02
01b7d4f742 Repair lucky perk should decrease the Arcane Forging downgrade chance,
instead of increasing it.
2014-03-14 15:16:22 +01:00
TfT_02
9a359bf42c We need to use event.getBlock() here
Fix my boo boo from previous commit
2014-03-11 13:33:54 +01:00
TfT_02
ebdf11300b We do need to use a runnable. 2014-03-10 20:51:52 +01:00
TfT_02
e1a8f02bce Make Acrobatics XP prevention cool down, after teleporting configurable
Adds #1906
2014-03-09 15:24:24 +01:00
TfT_02
862d38b587 Clean up all of the imports 2014-03-03 18:27:45 +01:00
GJ
2415767c06 Clean up imports. 2014-03-03 12:22:28 -05:00
GJ
aa59348a94 We only care about blocks that award XP.
Also, this fixes a possible issue where blocks changed by entities other than falling blocks could have been left as tracked even after they were destroyed.
2014-03-03 12:14:01 -05:00
GJ
9c925d3327 We can do this without needing a runnable. 2014-03-03 11:40:36 -05:00
GJ
30f7521a3a Handle healthbars even when skills are disabled. Fixes #1194 2014-03-03 10:29:14 -05:00
GJ
7b3869e385 Use .equals instead of deprecated ID method. 2014-03-03 09:24:24 -05:00
GJ
0e641f7c5b Clean up some of our metadata handling. 2014-03-03 08:48:16 -05:00
GJ
733d16cf35 Don't clone if it's null. Fixes #1894 2014-03-03 08:03:30 -05:00
TfT_02
833bc1b251 Fixed bug where disbanded parties could still see alliance chat 2014-02-28 22:41:47 +01:00
TfT_02
840f3d9382 Fix /party kick command 2014-02-28 22:32:09 +01:00
TfT_02
34d6d867f2 Prevent combat abilities from damaging allied players 2014-02-28 22:08:48 +01:00
TfT_02
e56d5a0454 Exclude vanished players from tab complete list
Part 2 of fixing #1745
2014-02-28 21:56:30 +01:00
TfT_02
53fdf750f4 Pretend like the player is offline when he is vanished
Part 1 of fixing #1745
2014-02-28 21:56:30 +01:00
TfT_02
f096e915cf Changed default amount of XP from mining Quartz Ore
#1886
2014-02-28 19:24:41 +01:00
GJ
ce59488e8e Add FakeEntityTameEvent to match expected behavior for an animal being tamed. 2014-02-28 12:04:00 -05:00
GJ
47db522cc1 Because Bukkit doesn't set this automatically with setTamed. Go figure. Fixes #1888 2014-02-28 11:50:36 -05:00
TfT_02
a2cac82cba Check if player has data key here as well
Fixes #272
2014-02-28 14:45:44 +01:00
GJ
2e74333eb7 Oops. 2014-02-28 08:40:00 -05:00
GJ
0056be2d5f Assorted cleanup. 2014-02-28 08:36:42 -05:00
TfT_02
1d7e034d5e Fix the updater 2014-02-27 22:26:58 +01:00
GJ
8deac175d1 Repair damaged user files. Fixes #1869 2014-02-22 09:52:36 -05:00
GJ
d0b766a2d3 Fixed bug with updating (very) old user data. 2014-02-21 11:38:22 -05:00
GJ
65692f2a83 Fixed bug with checking maximum durability of mod items. Fixes #1634 2014-02-20 12:43:11 -05:00
GJ
d0b0786284 Fixed exploit involving Call of The Wild. Fixes #1877 2014-02-20 11:50:56 -05:00
Luuk Jacobs
87ac1002de Fix potion datavalues for Splash poison II potions 2014-02-18 08:45:44 +01:00
TfT_02
c51fde7f1f Added new permission node to control who can check version number
Negate this permission node to hide the version number from /mcmmo and
motd
2014-02-17 16:31:59 +01:00
TfT_02
0a6735110f Get mod config file resources properly
Fixes #1870 for real
2014-02-16 23:32:14 +01:00
TfT_02
8a284c50a2 Rename mod files to type.default.yml
Fixes #1870
2014-02-16 23:08:22 +01:00
roblikescake
09431ef27c Check durability before repairMaterial 2014-02-16 00:18:27 +01:00
TfT_02
9f9de86d21 The defender isn't necessarily a player here
Besides, the defender doesn’t need to have the player data key anyways
2014-02-16 00:11:15 +01:00
TfT_02
d9c04a09ba No need to clone here and it's not null checked
Fixes #1864
2014-02-15 23:35:14 +01:00
t00thpick1
04a02cfdc8 Store McMMOPlayer objects as metadata 2014-02-15 14:21:25 +01:00
TfT_02
b3a6c32ef6 Skip glass bottles as well
Fixes #1859
2014-02-15 11:18:11 +01:00
TfT_02
254f3b5ac9 Cleanup finishBrewing a bit 2014-02-15 11:17:31 +01:00
TfT_02
7f9ada14c8 Schedule check after putting a new bottle in the brewing stand 2014-02-15 01:37:41 +01:00
TfT_02
f79a4741cc Store Locations, not BlockStates
Fixes #1862
2014-02-15 01:31:13 +01:00
TfT_02
f3fd48d0c0 Don't set potion meta data - for Vanilla potions 2014-02-14 23:58:22 +01:00
GJ
fbee3318bd These go the other way around. 2014-02-12 08:29:14 -05:00
TfT_02
813f807876 Fix remaining potion data values
Fixes #1844
2014-02-12 13:48:24 +01:00
TfT_02
0060a86b20 Compile with 1.6.4-R2.0 2014-02-12 12:00:04 +01:00
TfT_02
15743c5f46 Don't set potion meta data
It causes incompatibilities with other plugins.

Fixes #1849
2014-02-12 11:54:21 +01:00
TfT_02
4b9d472f10 Fix ConcurrentModificationException with alchemyBrewTask.finishImmediately()
Fixes #1848
2014-02-12 11:16:05 +01:00
GJ
988006f913 Alchemy cleanup, part 1. 2014-02-11 16:22:57 -05:00
TfT_02
2f05c472ce Make party names case insensitive
Fixes #1846
2014-02-10 17:14:34 +01:00
TfT_02
5c836cdaaf Check party level before sending party chat
Fixes #1847
2014-02-10 16:07:43 +01:00
TfT_02
9e39c3495d Fix IllegalArgumentException: 1 > 0 2014-02-09 17:15:42 +01:00
TfT_02
b653aa57b7 You can't accept an alliance request when you already have an ally 2014-02-09 16:10:43 +01:00
Sean Porter
2ffdd340af The command is spelled xpshare, not expshare.
Fixes #1841
2014-02-09 12:31:30 +01:00
Sean Porter
d63c3fc6d0 Ensure the FlatFile directory exists.
Fixes #1842
2014-02-09 12:31:29 +01:00
TfT_02
4486261413 Schedule an Alchemy check after using a hotkey to add ingredients
Fixes #1834
2014-02-07 13:39:24 +01:00
TfT_02
a2e32179bb Fix /mcstats command
Fixes #1819
2014-02-05 19:24:14 +01:00
TfT_02
72b106e71f Fix ptp Accept_Required setting
I forgot to change this, oops!
2014-02-05 19:15:39 +01:00
TfT_02
679f1ed629 Use default Vanilla MC potion data values in potions.yml
Fixes #1821
2014-02-04 16:48:10 +01:00
GJ
734815c58d No reason to have our scoreboard stuff in a different listener. 2014-02-04 08:34:17 -05:00
GJ
abfedf381d Allow mod name to go in the middle or at the beginning. 2014-02-04 07:53:54 -05:00
GJ
8e040ae8d9 Refactor to match existing conventions 2014-02-03 14:57:45 -05:00
GJ
0c9836eb03 Made mod config files modular. Addresses #1802 2014-02-03 14:48:43 -05:00
TfT_02
62b13a9a84 Fixed bug where Snow would never drop treasures
Fixes #1820
2014-02-01 00:30:42 +01:00
TfT_02
c48ccae484 Compile with RELEASE to remain 1.6 compatibility for now 2014-02-01 00:30:37 +01:00
TfT_02
6264bfa15f Don't store Block objects, use BlockState
Fixes #1811, Closes #1822
2014-01-30 20:45:21 +01:00
TfT_02
b50ba9c02e Fix wrong data value of Potion of Hunger II
Fixes #1817
2014-01-26 15:13:35 +01:00
GJ
b3474c04c7 Increment SQL query numbers due to addition of Alchemy. Fixes #1803
Thanks to @roastnewt for the help!
2014-01-21 11:16:39 -08:00
TfT_02
a1c1271d21 Fix issues pointed out by the FindBugs plugin 2014-01-20 23:20:51 +01:00
md-5
79155887b0 You can only ever deploy one release.
Use -SNAPSHOT to indicate this is a dev build and not a release.
2014-01-20 23:06:37 +01:00
TfT_02
4178604833 Update pom.xml with md_5 Maven repo settings 2014-01-20 22:48:27 +01:00
TfT_02
d1fcd6958f Check if brewingStand == null
Fixes #1804
2014-01-20 22:38:20 +01:00
TfT_02
f39623c279 Bit of Alchemy cleanup 2014-01-20 22:38:04 +01:00
GJ
520f5cb116 Fix the broken build. Shame on me. 2014-01-20 14:53:31 -08:00
GJ
43e2c813d1 Clean up some of our messes. 2014-01-20 13:58:40 -08:00
TfT_02
c6ea32f0b0 Added Ender Dragon, Wither, and Witch to combat experience multipliers
They do not give any XP by default.

Fixes #1763
2014-01-19 19:40:33 +01:00
TfT_02
976c3b8494 Fix bug which prevented Hoppers from inserting new bottles
Fixes #1801
2014-01-19 15:35:27 +01:00
TfT_02
f3db90b6a9 Fix a couple of typos in plugin.yml
Mulitplies => Multiplies
2014-01-19 01:08:38 +01:00
TfT_02
82509fb476 Added custom XP boost perk 2014-01-19 01:08:38 +01:00
TfT_02
c27d79cf25 Added new XP perk - 10% boost
Adds #1698
2014-01-19 01:08:37 +01:00
TfT_02
de912c1e07 Make sure the player is valid as well 2014-01-19 01:08:37 +01:00
TfT_02
2159aa91ff Add missing alchemy ingredient tiers to ingredient check 2014-01-18 20:28:28 +01:00
TfT_02
748dba41dc Randomize the treasure drop amounts instead of always dropping everything
For example, the guaranteed 5 diamonds will now be a 1-5 diamond drop.
2014-01-18 19:15:38 +01:00
TfT_02
9349416326 Check if brewing stand still exists before processing AlchemyBrewTask 2014-01-18 19:11:15 +01:00
TfT_02
3b794c897d Make sure the party leader is online before attempting to notify 2014-01-18 19:06:20 +01:00
TfT_02
b460f7a564 Add more debug messages in onDisable()
So that we can track down why the disable proces slows down
2014-01-18 16:59:16 +01:00
TfT_02
383b048fef Changed config validation for Rank_Levels, successive Ranks can now be less than or equal to each other
Closes #1790
2014-01-18 12:02:05 +01:00
TfT_02
243a3bfbf6 Remove trailing whitespaces 2014-01-18 12:02:05 +01:00
TfT_02
c108a475e3 Fix a typo in the Alchemy skill guide
Concotions => Concoctions
2014-01-17 19:25:48 +01:00
TfT_02
6b653fa606 Changed appearance of party member list 2014-01-17 18:58:07 +01:00
TfT_02
818962e668 Added party levels
Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
2014-01-17 18:56:27 +01:00
TfT_02
c729297615 Added party alliances
Adds the following commands:
`/party alliance`
`/party alliance invite <target>`
`/party alliance accept`

Allies will share party chat and will not be able to harm eachother.
Item and XP sharing is limitied to a single party. Allowing two parties
to team up without sharing resources and XP.

Closes #1009
2014-01-17 18:55:58 +01:00
TfT_02
e6e90954a9 Changed config validation for UnlockLevels, they can now also be 0
Closes #1790
2014-01-17 15:51:28 +01:00
TfT_02
4e86f60fd2 Replace ingredient strings correctly
Fixes #1789
2014-01-17 14:00:22 +01:00
TfT_02
27ff545d46 Add Alchemy hardcore settings to default config.yml file
These setting were already working, just forgot to add them to the
default file as well.
2014-01-17 00:17:10 +01:00
TfT_02
7c891e9ba8 Optimize imports 2014-01-16 22:32:40 +01:00
TfT_02
6143003516 Update PR to changes in master
- Special thanks, instead of in dev team
- Fix formatting issues
  * Remove trailing whitespaces
  * Rename method names of event listeners
  * Check for negative instead of positive
- Added Alchemy skill guide
2014-01-16 22:32:40 +01:00
Eric Hildebrand
8f83e328b0 Introduction of new Alchemy skill! 2014-01-16 22:32:40 +01:00
TfT_02
9afa8efd7d No need to hardcode the max tier here 2014-01-15 12:20:05 +01:00
TfT_02
393d9ca74e Fixed bug where Hylian Luck was broken
Fixes #1771
2014-01-13 14:18:16 +01:00
nossr50
97c95c1c49 This doesn't belong in the main branch 2014-01-12 14:49:05 -08:00
TfT_02
491df2cc82 Changed the appearance of /mcmmo commands
Closes #978
2014-01-12 13:51:12 +01:00
TfT_02
b4a6ecc58c Abstract HolidayManager a little more
Now we don’t have to manually edit this each year.
2014-01-12 12:08:47 +01:00
TfT_02
103bf593f3 Check null here as well
Fixes #1664
2014-01-12 10:30:04 +01:00
TfT_02
0332c0f5e0 Move this comment up
#1538
2014-01-11 15:14:39 +01:00
TfT_02
a004d6976d We already had a key called Confirm_Required
Another attempt to fix #1583
2014-01-11 14:54:01 +01:00
TfT_02
730f786d5b Fix issue with /ptp command
Fixes #1773
2014-01-11 10:30:12 +01:00
Foxtail
8993c71577 Update extrabiomesxl.blocks.yml
Config file was missing a section of 2x2 trees, called Quarter logs.
Missing logs were added to appropriate divided sections.
2014-01-10 10:56:04 -05:00
Sean Porter
cc524bb2ab Map.remove() can return Null. 2014-01-09 22:52:25 -08:00
TfT_02
2e94eecda0 Fix a small error with the config validation of advanced.yml
Fixes #1769
2014-01-08 13:19:51 +01:00
TfT_02
2466270b22 Removed /stats alias for /mcstats
Closes #1667
2014-01-08 01:10:12 +01:00
TfT_02
54a514edfa Added a LOTR mod config files, made by Dragyn 2014-01-07 23:28:16 +01:00
TfT_02
1336aeaef0 Remove/move more comments on identical keys
#1583
2014-01-07 22:05:18 +01:00
TfT_02
3c078100e8 Another attempt to fix the broken config updater
An attempt to solve #1583
2014-01-07 20:50:48 +01:00
GJ
13a623ea1f Misc was getting crowded again. 2014-01-03 11:07:13 -05:00
GJ
05b21eae5f Clean up our inventory event handling. 2014-01-03 10:41:38 -05:00
GJ
e0358d42d6 Ensure we're not dealing with a fake player. Fixes #1749 2014-01-03 09:19:07 -05:00
GJ
26174d88f4 Remove unused import 2014-01-03 08:30:59 -05:00
Sean Porter
c12d4319ac Don't cancel death message fixes for NPCs. 2013-12-27 15:21:25 -08:00
Sean Porter
a87bd14342 The attack target can still be an NPC without being an instance of Player. 2013-12-27 14:50:01 -08:00
TfT_02
d5990eee71 Added a ton of mod config files, made by Dragyn 2013-12-17 19:36:41 +01:00
TfT_02
f94343f13b Only grant taming XP once when taming a horse
Fixes #1651
2013-12-15 23:36:43 +01:00
TfT_02
ea4c424e0f Added level thresholds to hardcore modes
Players will not lose stats when their level is below the
Level_Threshold.
2013-12-15 23:27:37 +01:00
riking
f99e5e015d Add checks to rectify the potential for negative XP
Fixes #1573
2013-12-15 23:26:57 +01:00
riking
56b57da077 Only call one Death Penalty Event 2013-12-15 23:26:57 +01:00
TfT_02
4b402d9837 Fixed validation feedback message for Chimaera Wing recipe cost
Fixes #1703
2013-12-15 22:25:15 +01:00
TfT_02
6c2b1f555f Improve CleanBackupsTask a bit
* Print proper file names to the console when the date could not be
determined
* Skip all directories
* Skip every file that doesn’t have .zip in the file name
2013-12-13 00:17:56 +01:00
TfT_02
cdcda03e92 Moved repair config classes to the config package 2013-12-12 19:53:27 +01:00
TfT_02
65aa05a660 Fix /addlevels all and /skillreset all commands
Fixes #1675
2013-12-12 16:50:36 +01:00
TfT_02
7c7aa994a5 Added pre-made metallurgy.tools.yml by Skuli 2013-12-11 15:02:25 +01:00
riking
2aec4a69ea Database conversion bug: Integral division in output format 2013-12-10 14:56:07 -08:00
Glitchfinder
06c9ea7068 Minecraft handles block drop chances internally.
Fixes #1678
2013-12-08 12:49:43 -08:00
TfT_02
c88583c1c0 Use Matcher.quoteReplacement here!
Fixes #1676 - for real this time
2013-12-08 17:07:45 +01:00
TfT_02
d2b6838453 Fix config.yml formatting 2013-12-08 11:40:09 +01:00
TfT_02
c9f1f8f662 Fixed bug where party chat broke if the display name contained special characters
Fixes #1676
2013-12-08 11:35:02 +01:00
TfT_02
7a08343304 Actually keep all weeks, not just from the past year
Week numbers are obviously the same every year, we need to check the
year as well as the week number to determine if we should keep the
backup file or not.
2013-12-07 13:18:14 +01:00
riking
3b1bb3e08a Minor changes to Tree Feller - use a HashSet, move comment
LinkedHashSet doesn't actually do anything for us - we were never using the consistent ordering it promises, and openjdk-7 doesn't even provide that consistent ordering. Better to just not use it.
2013-12-06 23:55:26 -08:00
TfT_02
07cafd4866 Fixed bug where disabling hardcore mode for specific skills didn't work
Fixes #1661
2013-12-03 22:15:23 +01:00
GJ
48821a710f Fixed bug with cooldown donor perks 2013-12-02 08:30:45 -05:00
GJ
30a1b333b9 Need a space here. 2013-12-02 08:18:28 -05:00
GJ
696bf71962 Remove unused import 2013-12-02 08:13:53 -05:00
t00thpick1
2d577e92f1 AntiTheft option for Disarm Ability 2013-12-01 19:08:22 -05:00
Luuk Jacobs
86b92b5b30 add alias to mcscoreboard 2013-11-27 00:35:58 +01:00
GJ
24c1dec046 Fix missing import & broken build.
That's what I get for editing through Github's web UI...
2013-11-25 09:32:16 -05:00
GJ
6c478a26c4 Fix issue with custom axes not working with Tree Feller.
Most custom materials don't properly report their max durability, so we need to use our repairable manager to handle them instead.
2013-11-25 09:29:41 -05:00
t00thpick1
2d3da6daf8 Space not underscore 2013-11-24 18:01:05 -05:00
t00thpick1
de3b2b8024 Damage should probably actually be fatal I would think. 2013-11-23 12:34:14 -05:00
t00thpick1
02a064ffc6 These need spaces to be called pretty 2013-11-23 00:45:12 -05:00
t00thpick1
cb5303ce4d These strings return with Spaces, not underscores 2013-11-23 00:42:43 -05:00
t00thpick1
c0dee19cb0 Missed a refactor :P Also, javadoc event 2013-11-22 12:48:53 -05:00
t00thpick1
870987bba7 SecondaryAbility's API additions 2013-11-22 12:32:23 -05:00
riking
5d63a4b910 Run PlayerProfileSaveTask async, as intended 2013-11-21 12:41:26 -08:00
riking
3236ee5ec9 Harden save() method by making a defensive copy 2013-11-21 11:17:24 -08:00
riking
12ed2ac07b Have ExperienceCommand and SkillresetCommand explicitly handle 'all' 2013-11-19 18:56:47 -08:00
t00thpick1
729f3b1df9 There is no usage of this method in which "all" will not cause NPE's 2013-11-19 21:00:29 -05:00
TfT_02
ee1be3599c .length doesn't start at 0 2013-11-18 21:01:41 +01:00
TfT_02
12a6aca8cd Assume that block data = 0 if there isn't one in the config 2013-11-18 20:48:37 +01:00
TfT_02
2b81b8daeb Fix Commands.Scoreboard.Timer locale string
Closes #1626
2013-11-18 19:56:29 +01:00
GJ
5edbdec151 Actually fix broken locale string. 2013-11-15 07:25:50 -05:00
GJ
eaa38c11b8 Fix broken locale string.
Fixes #1615
2013-11-13 09:47:13 -05:00
262 changed files with 15123 additions and 3218 deletions

View File

@@ -7,19 +7,92 @@ Key:
! Change
- Removal
Version 1.4.08-dev
Version 1.5.01-dev
+ Added new child skill; Salvage
+ Added new feature to Herbalism. Instantly-regrown crops are protected from being broken for 1 second
+ Added option to config.yml to show the /mcstats scoreboard automatically after logging in
+ Added option to config.yml for Alchemy. Skills.Alchemy.Prevent_Hopper_Transfer_Bottles
+ Added support for `MATERIAL|data` format in treasures.yml
+ Added API to experience events to get XP gain reason
+ Added API to check if an entity is bleeding
= Fixed bug where the Updater was running on the main thread.
= Fixed bug when players would use /ptp without being in a party
= Fixed bug where player didn't have a mcMMOPlayer object in AsyncPlayerChatEvent
= Fixed bug where dodge would check the wrong player skill level
= Fixed bug which causes /party teleport to stop working
= Fixed bug where SaveTimerTask would produce an IndexOutOfBoundsException
! Changed player data saving. Save tasks are now asynchronous
! Vanished players no longer get hit by AoE effects
! Changed Alchemy config option 'Prevent_Hopper_Transfer' renamed to 'Prevent_Hopper_Transfer_Ingredients'
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
- Removed salvage ability from Repair, salvage has it's own (child) skill now
Version 1.5.00
+ Added Podzol & Red Sand to Excavation
+ Added Hardened Clay, Stained Clay, and Packed Ice to Mining blocks
+ Added Acacia and Dark Oak to Woodcutting blocks
+ Added Salmon, Clownfish, and Pufferfish to Fishing XP
+ Added new flowers and grasses to Herbalism XP
+ Added option to config.yml which allows players to always catch fish, even when a treasure is found
+ Added option to config.yml to override vanilla Minecraft treasures
! Fishing XP now depends on the type of fish.
! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood.
! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly.
- Removed deprecated permission nodes
- Removed "Treasure found!" message
Version 1.4.08
+ Added a new skill; Alchemy. Special thanks to EasyMFnE for creating this!
+ Added SecondaryAbilityType enum, and new SecondaryAbilityWeightedActivationCheckEvent, fired when a secondary ability checkes its activation chances
+ Added the possibility to gain experience when using Fishing "Shake"
+ Added config options to disable various sound effects
+ Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
+ Added automatic cleanup of backups folder.
+ Added bypass permission for finding Fishing traps
+ Added level threshold settings to hardcore modes. When a players skill level is below this threshold, they will not lose any stats
+ Added party alliances, two parties can now team up. Allies share party chat and cannot harm each other.
+ Added new experience bonus perk 'mcmmo.perks.xp.10percentboost.<skillname>' multiplies incoming XP by 1.1
+ Added new experience bonus perk 'mcmmo.perks.xp.customboost.<skillname>' multiplies incoming XP by the boost amount defined in the experience config
+ Added Ender Dragon, Wither, and Witch to combat experience multipliers - they do not give XP by default
+ Added support for multiple mod config files, naming can be done as either armor.<modname>.yml or <modname>.armor.yml
+ Added config options to configure the items used in "Call of the Wild"
+ Added config option to configure the database command cooldown
= Fixed bug where healthbars wouldn't display if skills were disabled
= Fixed bug with "Call of the Wild" entities despawning
= Fixed bug with updating (very) old user data.
= Fixed bug with checking maximum durability of mod items.
= Fixed exploit involving Call of The Wild.
= Fixed bug where LeafBlower permissions were ignored
= Fixed bug with toggle commands not properly displaying the success message.
= Fixed IllegalArgumentException caused by an empty Fishing treasure category
= Fixed bug with Salvage not reading the config value for the anvil material.
= Fixed exploit where you could receive smelting XP for improper items
= Fixed bug where the Unbreaking enchantment was ignored when using "Super Breaker" or "Giga Drill Breaker"
= Fixed bug which prevented players from gaining Acrobatics XP when the setting 'Prevent_XP_After_Teleport' was set to false
= Fixed bug where cooldown donor perks were reducing more than expected
= Fixed bug where disabling hardcore mode for specific skills didn't work
= Fixed bug which caused the backup cleanup to delete old backups while it should have kept those
= Fixed bug where party chat broke if the display name contained special characters
= Fixed bug where `/addlevels all` and `/skillreset all` didn't work
= Fixed bug which made it possible to gain XP by taming the same horse multiple times, if a player "untamed" that horse
= Fixed bug where some horses summoned with "Call of the Wild" were unable to jump
= Fixed bug where the /ptp request expiration time was checked wrongly - preventing players from using the command
= Fixed bug where Hylian Luck was broken
= Fixed bug where Snow would never drop treasures
= Fixed issues with commands giving away vanished players.
= Fixed bug where the Repair lucky perk would increase the Arcane Forging downgrade chance, instead of decreasing it
! Changed party system. Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
! Changed appearance of party member list. Gold = party leader, White = online, Gray = offline, Italic = not nearby
! Updated localization files
! Changed the appearance of /mcmmo commands
! Changed AxesCritical to CriticalHit in config file
! Changed several secondary ability permissions(deprecated versions still exist)
! Changed /ptp config setting, Commands.ptp.Confirm_Required is now Commands.ptp.Accept.Required
! Changed config validation for UnlockLevels, they can now also be 0
! Changed config validation for Rank_Levels, successive Ranks can now be less than or equal to each other
! Changed default amount of XP gained from mining Quartz Ore. From 250 to 100 XP.
! Changed Acrobatics config setting, Skills.Acrobatics.Prevent_XP_After_Teleport is now Skills.Acrobatics.XP_After_Teleport_Cooldown
- Removed /stats alias for /mcstats
Version 1.4.07
+ Added XP boost to Acrobatics when wearing Boots of Feather Falling

View File

@@ -5,7 +5,7 @@
Our latest development builds are available ~~[here](http://ci.mcmmo.info)~~. Unfortunately, the mcMMO site is down; a temporary dev build location is hosted [here](http://ci.ecocitycraft.com/job/mcMMO/).
### Brief Description
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds thirteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
## About the Team
@@ -32,9 +32,14 @@ mcMMO is currently developed by a team of individuals from all over the world.
[![riking](https://1.gravatar.com/avatar/aca9f37e569ac3a63929920035a91ba4.png)]
(https://github.com/riking)
### Special thanks
[![EasyMFnE](https://www.gravatar.com/avatar/99c9a1fa3bbf957791ceac7b45daadb0.png)]
(https://github.com/EasyMFnE)
Added the Alchemy skill
## Compiling
mcMMO uses Maven 3 to manage dependancies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
The typical command used to build mcMMO is: `mvn clean package install`

439
extras/mods/LOTR.armor.yml Executable file
View File

@@ -0,0 +1,439 @@
# Lord of the Rings mod config by Dragyn
# Built against version [1.6.4] The Lord of the Rings Mod Public Beta 11.1
#
#
# Settings for Boots
###
Boots:
# Bronze
X12015:
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Orc
X12035:
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Gondorian
X12060:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Mithril
X12064:
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Elven
X12088:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Warg
X12098:
Repairable: true
Repair_Material: X12094
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dwarven
X12129:
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Galven
X12134:
Repairable: true
Repair_Material: X12130
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Uruk
X12161:
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Wood Elf
X12176:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Ancient
X12180:
Repairable: true
Repair_Material: X12179
Repair_Material_Data_Value: 3
Repair_Material_Quantity: 2
Durability: 500
# Rohirric
X12187:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Rangers
X12206:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dunlending
X12210:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Morgul
X12222:
Repairable: true
Repair_Material: X12217
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Chestplates
###
Chestplates:
# Bronze
X12013:
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Orc
X12033:
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Gondorian
X12058:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Mithril
X12062:
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Elven
X12086:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Warg
X12096:
Repairable: true
Repair_Material: X12094
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dwarven
X12127:
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Galven
X12132:
Repairable: true
Repair_Material: X12130
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Uruk
X12159:
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Wood Elf
X12174:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Ancient
X12178:
Repairable: true
Repair_Material: X12179
Repair_Material_Data_Value: 3
Repair_Material_Quantity: 2
Durability: 500
# Rohirric
X12185:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Rangers
X12204:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dunlending
X12208:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Morgul
X12220:
Repairable: true
Repair_Material: X12217
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Helmets
###
Helmets:
# Bronze
X12012:
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Orc
X12032:
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Gondorian
X12057:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Mithril
X12061:
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Elven
X12085:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Warg
X12095:
Repairable: true
Repair_Material: X12094
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dwarven
X12126:
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Galven
X12131:
Repairable: true
Repair_Material: X12130
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Uruk
X12158:
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Wood Elf
X12173:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Ancient
X12177:
Repairable: true
Repair_Material: X12179
Repair_Material_Data_Value: 3
Repair_Material_Quantity: 2
Durability: 500
# Rohirric
X12184:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Rangers
X12203:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dunlending
X12207:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Morgul
X12219:
Repairable: true
Repair_Material: X12217
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Leggings
###
Leggings:
# Bronze
X12014:
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Orc
X12034:
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Gondorian
X12059:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Mithril
X12063:
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Elven
X12087:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Warg
X12097:
Repairable: true
Repair_Material: X12094
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dwarven
X12128:
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Galven
X12133:
Repairable: true
Repair_Material: X12130
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Uruk
X12160:
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Wood Elf
X12175:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Ancient
X12179:
Repairable: true
Repair_Material: X12179
Repair_Material_Data_Value: 3
Repair_Material_Quantity: 2
Durability: 500
# Rohirric
X12186:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Rangers
X12205:
Repairable: true
Repair_Material: LEATHER
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Dunlending
X12209:
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Morgul
X12221:
Repairable: true
Repair_Material: X12217
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500

211
extras/mods/LOTR.blocks.yml Executable file
View File

@@ -0,0 +1,211 @@
# Lord of the Rings mod config by Skuli (Updated by Dragyn)
# Built against version [1.6.4] The Lord of the Rings Mod Public Beta 11.1
#
# Settings for Custom Excavation Blocks
###
Excavation:
Block_1|0:
XP_Gain: 99
Double_Drops_Enabled: true
Block_2|0:
XP_Gain: 99
Double_Drops_Enabled: true
#
# Settings for Custom Herbalism Blocks
###
Herbalism:
# Shireheather
X1813:
XP_Gain: 100
Double_Drops_Enabled: true
# Simbelmyne
X1805:
XP_Gain: 100
Double_Drops_Enabled: true
# Asphodel
X1895:
XP_Gain: 100
Double_Drops_Enabled: true
# Bluebell
X1867:
XP_Gain: 100
Double_Drops_Enabled: true
# Clover
X1873:
XP_Gain: 10
Double_Drops_Enabled: false
# Dead Marsh Plant
X1886:
XP_Gain: 10
Double_Drops_Enabled: false
# DwarfWort
X1902:
XP_Gain: 100
Double_Drops_Enabled: true
# Elanor
X1833:
XP_Gain: 100
Double_Drops_Enabled: true
# Lettuce Crop
X1830:
XP_Gain: 100
Double_Drops_Enabled: true
# Morgul Shroom
X1870:
XP_Gain: 100
Double_Drops_Enabled: true
# Niphredil
X1834:
XP_Gain: 100
Double_Drops_Enabled: true
# Pipeweed Crop
X1823:
XP_Gain: 100
Double_Drops_Enabled: true
# Pipeweed Plant
X1822:
XP_Gain: 100
Double_Drops_Enabled: true
#
# Settings for Custom Mining Blocks
###
Mining:
# Mithril
X1803:
XP_Gain: 2000
Double_Drops_Enabled: false
Is_Ore: true
# Naurite
X1818:
XP_Gain: 150
Double_Drops_Enabled: false
Is_Ore: false
#Glowstone Ore
X1859:
XP_Gain: 30
Double_Drops_Enabled: false
Is_Ore: false
# Remains
X1885:
XP_Gain: 1800
Double_Drops_Enabled: false
Is_Ore: false
# Gulduril
X1887:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Ore: false
# Quendite
X1846:
XP_Gain: 150
Double_Drops_Enabled: false
Is_Ore: false
# MorgulIron
X1819:
XP_Gain: 25
Double_Drops_Enabled: true
Is_Ore: false
# Rohan Rock
X180|2:
XP_Gain: 30
Double_Drops_Enabled: false
Is_Ore: false
#Gondor Stone
X180|1:
XP_Gain: 30
Double_Drops_Enabled: false
Is_Ore: false
# Mordor Stone
X180|0:
XP_Gain: 30
Double_Drops_Enabled: false
Is_Ore: false
#
# Settings for Custom Woodcutting Blocks
###
Woodcutting:
# Shire Pine
X1806|0:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Mallorn
X1806|1:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Apple
X1860|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Pear
X1860|1:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Cherry
X1860|2:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Mirkwood
X1806|2:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Charred
X1806|3:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Lebethron
X1896|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Beech
X1896|1:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
#
# Settings for Custom Ability Blocks
# (These blocks don't trigger abilities)
###
Ability_Blocks:
Block_1|0:
Block_2|0:

700
extras/mods/LOTR.tools.yml Executable file
View File

@@ -0,0 +1,700 @@
# Lord of the Rings mod config by Skuli (Updated by Dragyn)
# Built against version [1.6.4] The Lord of the Rings Mod Public Beta 11.1
Axes:
#DwarvenThrowingAxe
X12146:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 451
#UrukWarhammer
X12156:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 391
#Gondorian Warhammer
X12140:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 281
#UrukBattleaxe
X12155:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 391
#MithrilBattleaxe
X12138:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 2479
#MithrilWarhamer
X12139:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 2479
#OrcWarhammer
X12125:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 261
#Dwarven Warhammer
X12120:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 451
#DwarvenZbattleaxe
X12119:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 451
#BronzeAxe
X12009:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 197
#MithrilAxe
X12050:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 2479
#MallornAxe
X12075:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X1801
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 121
#Elven Axe
X12080:
XP_Modifer: 2
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 313
#DwarvenAxe
X12115:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 450
#OrcAxe
X12123:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 261
#UrukAxe
X12150:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 391
Bows:
#ElvenBow
X12093:
XP_Modifer: 2
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 9
Durability: 485
#mallornbow
X12084:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X1801
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 417
#orcBow
X12099:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 441
#UrukCrossbow
X12163:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 471
#MithrilCrossbow
X12171:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 1761
#IronCrossbow
X12170:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 9
Durability: 357
#BowofMirkwood
X12177:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X1806
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 3
Durability: 417
Hoes:
#BronzeHoe
X12011:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 197
#MithrilHoe
X12052:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 2479
#MallornHoe
X12077:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X1801
Repair_Material_Data_Value: 1
Repair_Material_Quantity: 2
Durability: 121
#CopperHoe
X26511:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X26507
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 180
#ElvenHoe
X12082:
XP_Modifer: 2
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12082
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 313
#DwarvenHoe
X12117:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X26507
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 180
Pickaxes:
#MEBronzePickaxe
X12008:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 197
#MithrilPixkaxe
X12049:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 2479
#MallornPickaxe
X12074:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X1801
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 121
#ElvenPickaxe
X12079:
XP_Modifer: 2
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 313
#DwarvenPickaxe
X12114:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 451
#UrukPickaxe
X12149:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 391
#OrcPickaxe
X12122:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 261
Shovels:
#BronzeShovel
X12007:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 197
#MithrilShovel
X12048:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 2479
#MallornShovel
X12073:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X1801
Repair_Material_Data_Value: 1
Repair_Material_Quantity: 1
Durability: 121
#ElvenShovel
X12078:
XP_Modifer: 2
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12082
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 313
#DwarvenShovel
X12113:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 451
#UrukShovel
X12148:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 391
#OrcShovel
X12121:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 261
Swords:
#Uruk Dagger
X12153:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 313
#Poisoned urukd agger
X12154:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 313
#Uruk Spear
X12157:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 391
#Rohirric Sword
X12181:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 251
#Rohirric Dagger
X12182:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 201
#Rohirric Spear
X12183:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 251
#Dunlending Spear
X12212:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 251
#Uruk Scimitar
X12151:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12147
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 391
#Mithril Dagger
X12137:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 1983
#Iron Dagger
X12136:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 201
#Dwarven Dagger
X12118:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 361
#Dwarven Sword
X12116:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12112
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 451
#Elven Sword
X12081:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 313
#Elven Spear
X12083:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 313
#Anduril
X12070:
XP_Modifer: 1
Ability_Enabled: true
Tier: 4
Repairable: false
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 313
#Mallorn Sword
X12076:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X1801
Repair_Material_Data_Value: 1
Repair_Material_Quantity: 2
Durability: 121
#Mithril Spear
X12069:
XP_Modifer: 1
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 2479
#Iron Spear
X12068:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: IRON_INGOT
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 251
#Orc Spear
X12066:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 261
#Bronze Spear
X12067:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 197
#Gondor Spear
X12065:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 281
#Gondor Sword
X12056:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: false
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 281
#Orc Scimitar
X12031:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12036
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 261
#Steel Sword
X26862:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X26857
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 751
#Bronze Sword
X12010:
XP_Modifer: 1
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X12004
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 197
#Mithril Sword
X12051:
XP_Modifer: 1
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X12006
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 2479

View File

@@ -0,0 +1,182 @@
# Config created by Dragyn
# Created For ExtrabiomesXL-universal-1.6.4-3.14.5
#
# Settings for Custom Excavation Blocks
###
Excavation:
# Quicksand
X2214|0:
XP_Gain: 40
Double_Drops_Enabled: true
#
# Settings for Custom Herbalism Blocks
###
Herbalism:
# Cattails
X2201|0:
XP_Gain: 30
Double_Drops_Enabled: true
# Hydrangea
X2202|1:
XP_Gain: 100
Double_Drops_Enabled: true
# Buttercups
X2202|2:
XP_Gain: 100
Double_Drops_Enabled: true
# Lavender
X2202|3:
XP_Gain: 100
Double_Drops_Enabled: true
# Tiny Cactus
X2202|4:
XP_Gain: 30
Double_Drops_Enabled: true
# Toadstool
X2202|6:
XP_Gain: 150
Double_Drops_Enabled: true
# Calla Lillies
X2202|7:
XP_Gain: 100
Double_Drops_Enabled: true
#
# Settings for Custom Mining Blocks
###
Mining:
X254|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X254|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
#
# Settings for Custom Woodcutting Blocks
###
Woodcutting:
# Fir
X2208|0:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
# Acacia
X2208|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
# Cypress
X2208|2:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Japanese Maple
X2208|3:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Redwood Quarter
X2209|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2211|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2212|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2213|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Fir Quarters
X2209|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X2211|1:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2212|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X2213|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
# Oak Quarters
X2209|2:
XP_Gain: 70
Double_Drops_Enabled: true
Is_Log: true
X2211|2:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2212|2:
XP_Gain: 70
Double_Drops_Enabled: true
Is_Log: true
X2213|2:
XP_Gain: 70
Double_Drops_Enabled: true
Is_Log: true
# Acacia
X2209|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
# Cypress
X2209|2:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Bald Cypress Quarter
X2225|0:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Bald Cypress Elbow
X2227|0:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Bald Cypress Log
X2231|2:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Rainbow Eucalyptus
X2228|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2229|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
X2231|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Autumn Log
X2231|1:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Sakura Log
X2238|0:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true

View File

@@ -0,0 +1,71 @@
# Config created by Dragyn
# Created For Galacticraft-1.6.4-2.0.7.904 and Galacticraft-Planets-1.6.4-2.0.7.904
#
# Settings for Boots
###
Boots:
# Heavy Duty
X10149:
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
X10171:
Repairable: true
Repair_Material: X10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 999
#
# Settings for Chestplates
###
Chestplates:
# Heavy Duty
X10147:
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
X10169:
Repairable: true
Repair_Material: X10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 999
#
# Settings for Helmets
###
Helmets:
# Heavy Duty
X10146:
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
X10168:
Repairable: true
Repair_Material: X10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 999
#
# Settings for Leggings
###
Leggings:
# Heavy Duty
X10148:
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
X10170:
Repairable: true
Repair_Material: X10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 999

View File

@@ -0,0 +1,98 @@
# Config created by Dragyn
# Created For Galacticraft-1.6.4-2.0.7.904 and Galacticraft-Planets-1.6.4-2.0.7.904
#
# Settings for Custom Excavation Blocks
###
Excavation:
# Dirt
X3347|3:
XP_Gain: 40
Double_Drops_Enabled: true
Block_2|0:
XP_Gain: 99
Double_Drops_Enabled: true
#
# Settings for Custom Mining Blocks
###
Mining:
# Copper Ore
X3347|0:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
X3372|5:
XP_Gain: 450
Double_Drops_Enabled: true
Is_Ore: true
X3390|0:
XP_Gain: 550
Double_Drops_Enabled: true
Is_Ore: true
# Tin Ore
X3347|1:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
X3372|6:
XP_Gain: 450
Double_Drops_Enabled: true
Is_Ore: true
X3390|1:
XP_Gain: 550
Double_Drops_Enabled: true
Is_Ore: true
# Aluminum Ore
X3372|7:
XP_Gain: 450
Double_Drops_Enabled: true
Is_Ore: true
# Silicon Ore
X3372|8:
XP_Gain: 450
Double_Drops_Enabled: true
Is_Ore: true
# Cheese Ore
X3347|2:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Iron Ore
X3390|3:
XP_Gain: 550
Double_Drops_Enabled: true
Is_Ore: true
# Desh Ore
X3390|2:
XP_Gain: 600
Double_Drops_Enabled: true
Is_Ore: true
# Moon Stone
X3347|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Moon Turf
X3347|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Mars Cobblestone
X3390|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Mars Rock/Stone
X3390|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X3390|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X3390|9:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false

View File

@@ -0,0 +1,123 @@
# Config created by Dragyn
# Created For Galacticraft-1.6.4-2.0.7.904 and Galacticraft-Planets-1.6.4-2.0.7.904
#
# Settings for Axes
###
Axes:
# Heavy Duty
X10145:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
# Desh
X10167:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: 10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 1000
#
# Settings for Hoes
###
Hoes:
# Heavy Duty
X10144:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
# Desh
X10166:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: 10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 1000
#
# Settings for Pickaxes
###
Pickaxes:
# Heavy Duty
X10142:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
# Desh
X10164:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: 10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 1000
#
# Settings for Shovels
###
Shovels:
# Heavy Duty
X10143:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
# Desh
X10165:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: 10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 1000
#
# Settings for Swords
###
Swords:
# Heavy Duty
X10141:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X10150
Repair_Material_Data_Value: 9
Repair_Material_Quantity: 2
Durability: 500
# Desh
X10163:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: 10161
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 1000

1018
extras/mods/metallurgy3.armor.yml Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,185 @@
# Config created by Dragyn
# Created For Metallurgy-1.6.4-3.3.1
#
#
# Settings for Custom Mining Blocks
###
Mining:
# Copper
X900|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Tin
X900|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Zinc
X902|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Silver
X902|1:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Platinum
X902|3:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# NETHER ORES
# Ignatius
X903|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Shadow Iron
X903|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Lemurite
X903|2:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Midasium
X903|3:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Vyroxeres
X903|4:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Ceruclase
X903|5:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Alduorite
X903|6:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Kalendrite
X903|7:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Vulcanite
X903|8:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Sanguinite
X903|9:
XP_Gain: 450
Double_Drops_Enabled: true
Is_Ore: true
# Manganese
X900|2:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Eximite
X900|5:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Meutoite
X900|6:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Sulfur
X905|7:
XP_Gain: 150
Double_Drops_Enabled: true
Is_Ore: false
# Phosphorite
X905|8:
XP_Gain: 150
Double_Drops_Enabled: true
Is_Ore: false
# Saltpeter
X905|9:
XP_Gain: 150
Double_Drops_Enabled: true
Is_Ore: false
# Magnesium
X905|10:
XP_Gain: 150
Double_Drops_Enabled: true
Is_Ore: false
# Bitumen
X905|11:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Ore: false
# Potash
X905|12:
XP_Gain: 150
Double_Drops_Enabled: true
Is_Ore: false
# Prometheum
X906|0:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Deep Iron
X906|1:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Infuscolium
X906|2:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Oureclase
X906|4:
XP_Gain: 650
Double_Drops_Enabled: true
Is_Ore: true
# Astral Silver
X906|5:
XP_Gain: 650
Double_Drops_Enabled: true
Is_Ore: true
# Carmot
X906|6:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Mithril
X906|7:
XP_Gain: 750
Double_Drops_Enabled: true
Is_Ore: true
# Rubracium
X906|8:
XP_Gain: 800
Double_Drops_Enabled: true
Is_Ore: true
# Orichalcum
X906|11:
XP_Gain: 900
Double_Drops_Enabled: true
Is_Ore: true
# Adamantine
X906|13:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Ore: true
# Atlarus
X906|14:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Ore: true

File diff suppressed because it is too large Load Diff

44
extras/mods/railcraft.armor.yml Executable file
View File

@@ -0,0 +1,44 @@
# Config created by Dragyn
# Created For Railcraft_1.6.2-8.1.0.0
#
#
# Settings for Boots
###
Boots:
X7758:
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Chestplates
###
Chestplates:
X7761:
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Helmets
###
Helmets:
X7759:
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Leggings
###
Leggings:
X7760:
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500

103
extras/mods/railcraft.blocks.yml Executable file
View File

@@ -0,0 +1,103 @@
# Config created by Dragyn
# Created For Railcraft_1.6.2-8.1.0.0
#
#
# Settings for Custom Mining Blocks
###
Mining:
# Abyssal Stone
X457|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Quarried Stone
X457|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Sulfur
X458|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
# Saltpeter
X458|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
# Dark Diamond
X458|2:
XP_Gain: 750
Double_Drops_Enabled: true
Is_Ore: false
# Dark Emerald
X458|3:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Ore: false
# Dark Lapis
X458|4:
XP_Gain: 400
Double_Drops_Enabled: true
Is_Ore: false
# Firestone
X458|5:
XP_Gain: 450
Double_Drops_Enabled: true
Is_Ore: false
# Infernal Stone
X467|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X467|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Blood Stained Stone
X468|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X468|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Sandy Stone
X469|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X469|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Quarried Stone
X471|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X471|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Frost Bound Stone
X472|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X472|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Nether Stone
X475|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X475|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false

76
extras/mods/railcraft.tools.yml Executable file
View File

@@ -0,0 +1,76 @@
# Config created by Dragyn
# Created For Railcraft_1.6.2-8.1.0.0
#
#
# Settings for Axes
###
Axes:
# Steel
X7819:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Hoes
###
Hoes:
# Steel
X7820:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Pickaxes
###
Pickaxes:
# Steel
X7821:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Shovels
###
Shovels:
# Steel
X7823:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Swords
###
Swords:
# Steel
X7824:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X7796
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500

543
extras/mods/simcraft.blocks.yml Executable file
View File

@@ -0,0 +1,543 @@
# Config created by Dragyn
# Created For SimCraft 1.6.4
#
#
# Settings for Custom Herbalism Blocks
###
Herbalism:
X705|0:
XP_Gain: 50
Double_Drops_Enabled: true
X705|1:
XP_Gain: 50
Double_Drops_Enabled: true
X705|2:
XP_Gain: 50
Double_Drops_Enabled: true
X705|3:
XP_Gain: 50
Double_Drops_Enabled: true
X705|4:
XP_Gain: 50
Double_Drops_Enabled: true
X705|5:
XP_Gain: 50
Double_Drops_Enabled: true
X705|6:
XP_Gain: 50
Double_Drops_Enabled: true
X705|7:
XP_Gain: 50
Double_Drops_Enabled: true
X705|8:
XP_Gain: 50
Double_Drops_Enabled: true
X705|9:
XP_Gain: 50
Double_Drops_Enabled: true
X705|10:
XP_Gain: 50
Double_Drops_Enabled: true
X705|11:
XP_Gain: 50
Double_Drops_Enabled: true
X705|12:
XP_Gain: 50
Double_Drops_Enabled: true
X705|13:
XP_Gain: 50
Double_Drops_Enabled: true
X705|14:
XP_Gain: 50
Double_Drops_Enabled: true
X705|15:
XP_Gain: 50
Double_Drops_Enabled: true
X706|0:
XP_Gain: 50
Double_Drops_Enabled: true
X706|1:
XP_Gain: 50
Double_Drops_Enabled: true
X706|2:
XP_Gain: 50
Double_Drops_Enabled: true
X706|3:
XP_Gain: 50
Double_Drops_Enabled: true
X706|4:
XP_Gain: 50
Double_Drops_Enabled: true
X706|5:
XP_Gain: 50
Double_Drops_Enabled: true
X706|6:
XP_Gain: 50
Double_Drops_Enabled: true
X706|7:
XP_Gain: 50
Double_Drops_Enabled: true
X706|8:
XP_Gain: 50
Double_Drops_Enabled: true
X706|9:
XP_Gain: 50
Double_Drops_Enabled: true
X706|10:
XP_Gain: 50
Double_Drops_Enabled: true
X706|11:
XP_Gain: 50
Double_Drops_Enabled: true
X706|12:
XP_Gain: 50
Double_Drops_Enabled: true
X706|13:
XP_Gain: 50
Double_Drops_Enabled: true
X706|14:
XP_Gain: 50
Double_Drops_Enabled: true
X706|15:
XP_Gain: 50
Double_Drops_Enabled: true
X707|0:
XP_Gain: 50
Double_Drops_Enabled: true
X707|1:
XP_Gain: 50
Double_Drops_Enabled: true
X707|2:
XP_Gain: 50
Double_Drops_Enabled: true
X707|3:
XP_Gain: 50
Double_Drops_Enabled: true
X707|4:
XP_Gain: 50
Double_Drops_Enabled: true
X707|5:
XP_Gain: 50
Double_Drops_Enabled: true
X707|6:
XP_Gain: 50
Double_Drops_Enabled: true
X707|7:
XP_Gain: 50
Double_Drops_Enabled: true
X707|8:
XP_Gain: 50
Double_Drops_Enabled: true
X707|9:
XP_Gain: 50
Double_Drops_Enabled: true
X707|10:
XP_Gain: 50
Double_Drops_Enabled: true
X707|11:
XP_Gain: 50
Double_Drops_Enabled: true
X707|12:
XP_Gain: 50
Double_Drops_Enabled: true
X707|13:
XP_Gain: 50
Double_Drops_Enabled: true
X707|14:
XP_Gain: 50
Double_Drops_Enabled: true
X707|15:
XP_Gain: 50
Double_Drops_Enabled: true
#
# Settings for Custom Mining Blocks
###
Mining:
X700|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|8:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|9:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|10:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|11:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|12:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|13:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|14:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X700|15:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X701|0:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|1:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|2:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|3:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|4:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|5:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|6:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|7:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|8:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|9:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|10:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|11:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|12:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|13:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|14:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X701|15:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X702|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|2:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|3:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|4:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|5:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|6:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|7:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|8:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|9:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|10:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|11:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|12:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|13:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|14:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X702|15:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|2:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|3:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|4:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|5:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|6:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|7:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|8:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|9:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|10:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|11:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|12:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|13:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|14:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X703|15:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|2:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|3:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|4:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|5:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|6:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|7:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|8:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|9:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|10:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|11:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|12:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|13:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|14:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X704|15:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
#
# Settings for Custom Woodcutting Blocks
###
Woodcutting:
X708|0:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|2:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|3:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|4:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|5:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|6:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|7:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|8:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|9:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|10:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X708|11:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X1095|0:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X1095|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X1095|2:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
X1095|3:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true

61
extras/mods/simcraft.tools.yml Executable file
View File

@@ -0,0 +1,61 @@
# Config created by Dragyn
# Created For Railcraft_1.6.2-8.1.0.0
#
#
# Settings for Axes
###
Axes:
# Steel
X15787:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X15260
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Pickaxes
###
Pickaxes:
# Steel
X15788:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X15260
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Shovels
###
Shovels:
# Steel
X15789:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X15260
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Swords
###
Swords:
# Steel
X15786:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X15260
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500

View File

@@ -0,0 +1,134 @@
# Config created by Dragyn
# Created For twilightforest-1.20.3
#
#
# Settings for Boots
###
Boots:
# Ironwood
X27978:
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Fiery
X27995:
Repairable: true
Repair_Material: X27991
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Stealeaf
X28002:
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28037:
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Chestplates
###
Chestplates:
# Ironwood
X27976:
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Fiery
X27993:
Repairable: true
Repair_Material: X27991
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Stealeaf
X28000:
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28035:
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Helmets
###
Helmets:
# Ironwood
X27975:
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Fiery
X27992:
Repairable: true
Repair_Material: X27991
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Stealeaf
X27999:
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28034:
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Leggings
###
Leggings:
# Ironwood
X27977:
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Fiery
X27994:
Repairable: true
Repair_Material: X27991
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Stealeaf
X28001:
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28036:
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500

View File

@@ -0,0 +1,117 @@
# Config created by Dragyn
# Created For twilightforest-1.20.3
#
#
# Settings for Custom Herbalism Blocks
###
Herbalism:
# Mushgloom
X2169|9:
XP_Gain: 150
Double_Drops_Enabled: true
# Torchberry Plant
X2169|13:
XP_Gain: 20
Double_Drops_Enabled: true
# Mayapple
X2169|4:
XP_Gain: 30
Double_Drops_Enabled: true
# Fiddlehead
X2169|8:
XP_Gain: 35
Double_Drops_Enabled: true
#
# Settings for Custom Mining Blocks
###
Mining:
# Mazestone
X2165|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|1:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|2:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|3:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|4:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|5:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|6:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
X2165|7:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: false
#
# Settings for Custom Woodcutting Blocks
###
Woodcutting:
# Twilight Oak
X2163|0:
XP_Gain: 70
Double_Drops_Enabled: true
Is_Log: true
# Canopy
X2163|1:
XP_Gain: 80
Double_Drops_Enabled: true
Is_Log: true
# Mangrove
X2163|2:
XP_Gain: 90
Double_Drops_Enabled: true
Is_Log: true
# Darkwood
X2163|3:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Log: true
# Roots
X2170|0:
XP_Gain: 10
Double_Drops_Enabled: true
Is_Log: false
X2170|1:
XP_Gain: 10
Double_Drops_Enabled: true
Is_Log: false
# Timewood
X2176|0:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Log: true
# Transwood
X2176|1:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Log: true
# Minewood
X2176|2:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Log: true
# Sortingwood
X2176|3:
XP_Gain: 1000
Double_Drops_Enabled: true
Is_Log: true

View File

@@ -0,0 +1,186 @@
# Config created by Dragyn
# Created For twilightforest-1.20.3
#
#
# Settings for Axes
###
Axes:
# Ironwood
X27982:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Steeleaf
X31989:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28040:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Minotaur
X31984:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X264
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Hoes
###
Hoes:
# Ironwood
X27983:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Steeleaf
X31988:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Pickaxes
###
Pickaxes:
# Ironwood
X27981:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Fiery
X27997:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27991
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Steeleaf
X28005:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28039:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Shovels
###
Shovels:
# Ironwood
X27980:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Steeleaf
X28004:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Swords
###
Swords:
# Ironwood
X27979:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27974
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Fiery
X27996:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27991
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Steeleaf
X28003:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X27998
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
# Knightmetal
X28038:
XP_Modifer: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X28032
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500

View File

@@ -0,0 +1,171 @@
# Config created by Dragyn
# Created For UndergroundBiomes 1.6.x - 0.4.2c
#
#
# Settings for Custom Mining Blocks
###
Mining:
X2000|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2000|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
#
X2001|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2001|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
#
X2009|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2009|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
#
X2010|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|4:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2010|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
#
X2011|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2011|1:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2011|2:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2011|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2011|4:
XP_Gain: 50
Double_Drops_Enabled: true
Is_Ore: false
X2011|5:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2011|6:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
X2011|7:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false

14
pom.xml
View File

@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>1.4.08-dev1</version>
<version>1.5.01-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<issueManagement>
@@ -108,6 +108,10 @@
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
<repository>
<id>Plugin MetricsExtension</id>
<url>http://repo.turt2live.com</url>
@@ -135,9 +139,13 @@
</dependencies>
<distributionManagement>
<repository>
<id>mcmmo-repo</id>
<url>file:///var/lib/jenkins/repo</url>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>md_5-snapshots</id>
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@@ -1,9 +1,11 @@
package com.gmail.nossr50.api;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
import com.gmail.nossr50.util.player.UserManager;
public final class AbilityAPI {
@@ -80,4 +82,8 @@ public final class AbilityAPI {
public static void setTreeFellerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown);
}
public static boolean isBleeding(LivingEntity entity) {
return BleedTimerTask.isBleeding(entity);
}
}

View File

@@ -7,10 +7,12 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.api.exceptions.InvalidPlayerException;
import com.gmail.nossr50.api.exceptions.InvalidSkillException;
import com.gmail.nossr50.api.exceptions.InvalidXPGainReasonException;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.player.UserManager;
@@ -43,9 +45,7 @@ public final class ExperienceAPI {
public static boolean isNonChildSkill(String skillType) {
SkillType skill = SkillType.getSkill(skillType);
if (skill == null) return false;
return !skill.isChildSkill();
return skill != null && !skill.isChildSkill();
}
@Deprecated
@@ -64,8 +64,26 @@ public final class ExperienceAPI {
*
* @throws InvalidSkillException if the given skill is not valid
*/
@Deprecated
public static void addRawXP(Player player, String skillType, float XP) {
UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), XP);
addRawXP(player, skillType, XP, "UNKNOWN");
}
/**
* Adds raw XP to the player.
* </br>
* This function is designed for API usage.
*
* @param player The player to add XP to
* @param skillType The skill to add XP to
* @param XP The amount of XP to add
* @param xpGainReason The reason to gain XP
*
* @throws InvalidSkillException if the given skill is not valid
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/
public static void addRawXP(Player player, String skillType, float XP, String xpGainReason) {
UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
}
@Deprecated
@@ -100,8 +118,26 @@ public final class ExperienceAPI {
*
* @throws InvalidSkillException if the given skill is not valid
*/
@Deprecated
public static void addMultipliedXP(Player player, String skillType, int XP) {
UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()));
addMultipliedXP(player, skillType, XP, "UNKNOWN");
}
/**
* Adds XP to the player, calculates for XP Rate only.
* </br>
* This function is designed for API usage.
*
* @param player The player to add XP to
* @param skillType The skill to add XP to
* @param XP The amount of XP to add
* @param xpGainReason The reason to gain XP
*
* @throws InvalidSkillException if the given skill is not valid
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/
public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) {
UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
}
/**
@@ -131,10 +167,28 @@ public final class ExperienceAPI {
*
* @throws InvalidSkillException if the given skill is not valid
*/
@Deprecated
public static void addModifiedXP(Player player, String skillType, int XP) {
addModifiedXP(player, skillType, XP, "UNKNOWN");
}
/**
* Adds XP to the player, calculates for XP Rate and skill modifier.
* </br>
* This function is designed for API usage.
*
* @param player The player to add XP to
* @param skillType The skill to add XP to
* @param XP The amount of XP to add
* @param xpGainReason The reason to gain XP
*
* @throws InvalidSkillException if the given skill is not valid
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/
public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason) {
SkillType skill = getSkillType(skillType);
UserManager.getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()));
UserManager.getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
}
/**
@@ -167,8 +221,27 @@ public final class ExperienceAPI {
*
* @throws InvalidSkillException if the given skill is not valid
*/
@Deprecated
public static void addXP(Player player, String skillType, int XP) {
UserManager.getPlayer(player).beginXpGain(getSkillType(skillType), XP);
addXP(player, skillType, XP, "UNKNOWN");
}
/**
* Adds XP to the player, calculates for XP Rate, skill modifiers, perks, child skills,
* and party sharing.
* </br>
* This function is designed for API usage.
*
* @param player The player to add XP to
* @param skillType The skill to add XP to
* @param XP The amount of XP to add
* @param xpGainReason The reason to gain XP
*
* @throws InvalidSkillException if the given skill is not valid
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/
public static void addXP(Player player, String skillType, int XP, String xpGainReason) {
UserManager.getPlayer(player).beginXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
}
/**
@@ -349,12 +422,12 @@ public final class ExperienceAPI {
profile.addLevels(parentSkill, (levels / parentSkills.size()));
}
profile.save();
profile.scheduleAsyncSave();
return;
}
profile.addLevels(skill, levels);
profile.save();
profile.scheduleAsyncSave();
}
/**
@@ -583,7 +656,7 @@ public final class ExperienceAPI {
PlayerProfile profile = getOfflineProfile(playerName);
profile.addXp(skill, XP);
profile.save();
profile.scheduleAsyncSave();
}
private static PlayerProfile getOfflineProfile(String playerName) {
@@ -615,4 +688,14 @@ public final class ExperienceAPI {
return skill;
}
private static XPGainReason getXPGainReason(String reason) throws InvalidXPGainReasonException {
XPGainReason xpGainReason = XPGainReason.getXPGainReason(reason);
if (xpGainReason == null) {
throw new InvalidXPGainReasonException();
}
return xpGainReason;
}
}

View File

@@ -174,4 +174,17 @@ public final class PartyAPI {
public static List<Player> getOnlineMembers(Player player) {
return PartyManager.getOnlineMembers(player);
}
public static boolean hasAlly(String partyName) {
return getAllyName(partyName) != null;
}
public static String getAllyName(String partyName) {
Party ally = PartyManager.getParty(partyName).getAlly();
if (ally != null) {
return ally.getName();
}
return null;
}
}

View File

@@ -0,0 +1,9 @@
package com.gmail.nossr50.api.exceptions;
public class InvalidXPGainReasonException extends RuntimeException {
private static final long serialVersionUID = 4427052841957931157L;
public InvalidXPGainReasonException() {
super("That is not a valid XPGainReason.");
}
}

View File

@@ -1,5 +1,8 @@
package com.gmail.nossr50.chat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
@@ -7,6 +10,7 @@ import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
public class PartyChatManager extends ChatManager {
private Party party;
@@ -27,13 +31,20 @@ public class PartyChatManager extends ChatManager {
@Override
protected void sendMessage() {
if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader())) {
message = message.replaceFirst(displayName, ChatColor.GOLD + displayName + ChatColor.RESET);
message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET);
}
for (Player member : party.getOnlineMembers()) {
member.sendMessage(message);
}
if (party.getAlly() != null) {
for (Player member : party.getAlly().getOnlineMembers()) {
String allyPrefix = LocaleLoader.formatString(Config.getInstance().getPartyChatPrefixAlly());
member.sendMessage(allyPrefix + message);
}
}
plugin.getLogger().info("[P]<" + party.getName() + ">" + message);
}
}

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -10,7 +9,6 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -40,7 +38,7 @@ public class KrakenCommand implements TabExecutor {
return true;
}
String playerName = Misc.getMatchedPlayerName(args[0]);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) {
@@ -59,7 +57,7 @@ public class KrakenCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();

View File

@@ -9,7 +9,6 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.HolidayManager;
import com.gmail.nossr50.util.Permissions;
public class McmmoCommand implements CommandExecutor {
@@ -31,8 +30,11 @@ public class McmmoCommand implements CommandExecutor {
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "gjmcferrin@gmail.com" + ChatColor.GOLD + " Paypal");
}
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
HolidayManager.anniversaryCheck(sender);
if (Permissions.showversion(sender)) {
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
}
mcMMO.getHolidayManager().anniversaryCheck(sender);
return true;
case 1:
@@ -43,9 +45,9 @@ public class McmmoCommand implements CommandExecutor {
}
sender.sendMessage(LocaleLoader.getString("Commands.mcc.Header"));
displayPartyCommands(sender);
displayGeneralCommands(sender);
displayOtherCommands(sender);
displayPartyCommands(sender);
}
return true;
@@ -54,55 +56,57 @@ public class McmmoCommand implements CommandExecutor {
}
}
private void displayPartyCommands(CommandSender sender) {
if (Permissions.party(sender)) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.Commands"));
sender.sendMessage(" /party create <" + LocaleLoader.getString("Commands.Usage.PartyName") + "> " + LocaleLoader.getString("Commands.Party1"));
sender.sendMessage(" /party join <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party2"));
sender.sendMessage(" /party quit " + LocaleLoader.getString("Commands.Party.Quit"));
private void displayGeneralCommands(CommandSender sender) {
sender.sendMessage(ChatColor.DARK_AQUA + " /mcstats " + LocaleLoader.getString("Commands.Stats"));
sender.sendMessage(ChatColor.DARK_AQUA + " /<skill>" + LocaleLoader.getString("Commands.SkillInfo"));
sender.sendMessage(ChatColor.DARK_AQUA + " /mctop " + LocaleLoader.getString("Commands.Leaderboards"));
if (Permissions.partyChat(sender)) {
sender.sendMessage(" /party chat " + LocaleLoader.getString("Commands.Party.Toggle"));
}
if (Permissions.inspect(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /inspect " + LocaleLoader.getString("Commands.Inspect"));
}
sender.sendMessage(" /party invite <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Invite"));
sender.sendMessage(" /party accept " + LocaleLoader.getString("Commands.Party.Accept"));
if (Permissions.partySubcommand(sender, PartySubcommandType.TELEPORT)) {
sender.sendMessage(" /party teleport " + LocaleLoader.getString("Commands.Party.Teleport"));
}
if (Permissions.mcability(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
}
}
private void displayOtherCommands(CommandSender sender) {
sender.sendMessage(LocaleLoader.getString("Commands.Other"));
sender.sendMessage(" /mcstats " + LocaleLoader.getString("Commands.Stats"));
sender.sendMessage(" /mctop " + LocaleLoader.getString("Commands.Leaderboards"));
if (Permissions.skillreset(sender)) {
sender.sendMessage(" /skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
}
if (Permissions.mcability(sender)) {
sender.sendMessage(" /mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
}
if (Permissions.adminChat(sender)) {
sender.sendMessage(" /adminchat " + LocaleLoader.getString("Commands.AdminToggle"));
}
if (Permissions.inspect(sender)) {
sender.sendMessage(" /inspect " + LocaleLoader.getString("Commands.Inspect"));
sender.sendMessage(ChatColor.DARK_AQUA + " /skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
}
if (Permissions.mmoedit(sender)) {
sender.sendMessage(" /mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
sender.sendMessage(ChatColor.DARK_AQUA + " /mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
}
if (Permissions.adminChat(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /adminchat " + LocaleLoader.getString("Commands.AdminToggle"));
}
if (Permissions.mcgod(sender)) {
sender.sendMessage(" /mcgod " + LocaleLoader.getString("Commands.mcgod"));
sender.sendMessage(ChatColor.DARK_AQUA + " /mcgod " + LocaleLoader.getString("Commands.mcgod"));
}
}
sender.sendMessage(" /<skill>" + LocaleLoader.getString("Commands.SkillInfo"));
private void displayPartyCommands(CommandSender sender) {
if (Permissions.party(sender)) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.Commands"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party create <" + LocaleLoader.getString("Commands.Usage.PartyName") + "> " + LocaleLoader.getString("Commands.Party1"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party join <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party2"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party quit " + LocaleLoader.getString("Commands.Party.Quit"));
if (Permissions.partyChat(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /party chat " + LocaleLoader.getString("Commands.Party.Toggle"));
}
sender.sendMessage(ChatColor.DARK_AQUA + " /party invite <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Invite"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party accept " + LocaleLoader.getString("Commands.Party.Accept"));
if (Permissions.partySubcommand(sender, PartySubcommandType.TELEPORT)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /party teleport <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Teleport"));
}
}
}
}

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -10,7 +9,6 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -39,7 +37,7 @@ public abstract class ToggleCommand implements TabExecutor {
return true;
}
String playerName = Misc.getMatchedPlayerName(args[0]);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) {
@@ -63,7 +61,7 @@ public abstract class ToggleCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();

View File

@@ -12,7 +12,9 @@ import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.chat.ChatManager;
import com.gmail.nossr50.chat.ChatManagerFactory;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
@@ -111,6 +113,11 @@ public abstract class ChatCommand implements TabExecutor {
return;
}
if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
return;
}
mcMMOPlayer.enableChat(chatMode);
sender.sendMessage(chatMode.getEnabledMessage());
}

View File

@@ -4,8 +4,10 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.chat.PartyChatManager;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
@@ -28,6 +30,11 @@ public class PartyChatCommand extends ChatCommand {
return;
}
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
return;
}
message = buildChatMessage(args, 0);
}
else {

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.database;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -11,7 +10,6 @@ import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -22,9 +20,9 @@ public class McremoveCommand implements TabExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
String playerName = Misc.getMatchedPlayerName(args[0]);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
if (UserManager.getPlayer(playerName, true) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
if (UserManager.getOfflinePlayer(playerName) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
return true;
}
@@ -46,7 +44,7 @@ public class McremoveCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
@@ -26,11 +27,11 @@ public class AddlevelsCommand extends ExperienceCommand {
profile.addLevels(skill, value);
if (player == null) {
profile.save();
profile.scheduleAsyncSave();
return;
}
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, true);
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, true, XPGainReason.COMMAND);
}
@Override

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
@@ -23,11 +24,11 @@ public class AddxpCommand extends ExperienceCommand {
@Override
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
if (player != null) {
UserManager.getPlayer(player).applyXpGain(skill, value);
UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND);
}
else {
profile.addXp(skill, value);
profile.save();
profile.scheduleAsyncSave();
}
}

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.experience;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -15,7 +14,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -24,6 +22,8 @@ import com.google.common.collect.ImmutableList;
public abstract class ExperienceCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
SkillType skill;
switch (args.length) {
case 2:
if (CommandUtils.noConsoleUsage(sender)) {
@@ -39,7 +39,13 @@ public abstract class ExperienceCommand implements TabExecutor {
return true;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]), Integer.parseInt(args[1]));
skill = SkillType.getSkill(args[0]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]));
return true;
case 3:
@@ -52,11 +58,16 @@ public abstract class ExperienceCommand implements TabExecutor {
return true;
}
SkillType skill = SkillType.getSkill(args[1]);
skill = SkillType.getSkill(args[1]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
int value = Integer.parseInt(args[2]);
String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
@@ -84,7 +95,7 @@ public abstract class ExperienceCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
@@ -100,11 +111,7 @@ public abstract class ExperienceCommand implements TabExecutor {
protected abstract void handlePlayerMessageSkill(Player player, int value, SkillType skill);
private boolean validateArguments(CommandSender sender, String skillName, String value) {
if (CommandUtils.isInvalidInteger(sender, value) || CommandUtils.isInvalidSkill(sender, skillName)) {
return false;
}
return true;
return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName)));
}
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
@@ -118,7 +125,7 @@ public abstract class ExperienceCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
if (skill == null) {
for (SkillType skillType : SkillType.values()) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, skillType, value);
}

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
@@ -28,7 +29,7 @@ public class MmoeditCommand extends ExperienceCommand {
profile.modifySkill(skill, value);
if (player == null) {
profile.save();
profile.scheduleAsyncSave();
return;
}
@@ -36,7 +37,7 @@ public class MmoeditCommand extends ExperienceCommand {
return;
}
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, value > skillLevel);
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND);
}
@Override

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.experience;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -14,14 +13,19 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
/**
* This class mirrors the structure of ExperienceCommand, except the
* value/quantity argument is removed.
*/
public class SkillresetCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@@ -31,32 +35,38 @@ public class SkillresetCommand implements TabExecutor {
return true;
}
if (!Permissions.skillreset(sender)) {
if (!permissionsCheckSelf(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (CommandUtils.isInvalidSkill(sender, args[0])) {
if (!validateArguments(sender, args[0])) {
return true;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]), args.length, sender, command);
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]));
return true;
case 2:
if (!Permissions.skillresetOthers(sender)) {
if (!permissionsCheckOthers(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (CommandUtils.isInvalidSkill(sender, args[1])) {
if (!validateArguments(sender, args[1])) {
return true;
}
SkillType skill = SkillType.getSkill(args[1]);
SkillType skill;
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
else {
skill = SkillType.getSkill(args[1]);
}
String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
@@ -66,13 +76,13 @@ public class SkillresetCommand implements TabExecutor {
return true;
}
editValues(null, profile, skill, args.length, sender, command);
editValues(null, profile, skill);
}
else {
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, args.length, sender, command);
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill);
}
ExperienceCommand.handleSenderMessage(sender, playerName, skill);
handleSenderMessage(sender, playerName, skill);
return true;
default:
@@ -84,7 +94,7 @@ public class SkillresetCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
@@ -93,41 +103,65 @@ public class SkillresetCommand implements TabExecutor {
}
}
private void editValues(Player player, PlayerProfile profile, SkillType skill, int argsLength, CommandSender sender, Command command) {
if (skill == null) {
for (SkillType skillType : SkillType.values()) {
handleCommand(player, profile, skillType, argsLength, sender, command);
}
if (player != null) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.All"));
}
}
else {
handleCommand(player, profile, skill, argsLength, sender, command);
if (player != null) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
}
}
}
private void handleCommand(Player player, PlayerProfile profile, SkillType skill, int argsLength, CommandSender sender, Command command) {
if (argsLength == 1 && !Permissions.skillreset(sender, skill) || (argsLength == 2 && !Permissions.skillresetOthers(sender, skill))) {
sender.sendMessage(command.getPermissionMessage());
return;
}
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill) {
int levelsRemoved = profile.getSkillLevel(skill);
float xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.modifySkill(skill, 0);
if (player == null) {
profile.save();
profile.scheduleAsyncSave();
return;
}
EventUtils.handleLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false);
EventUtils.handleLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false, XPGainReason.COMMAND);
}
protected boolean permissionsCheckSelf(CommandSender sender) {
return Permissions.skillreset(sender);
}
protected boolean permissionsCheckOthers(CommandSender sender) {
return Permissions.skillresetOthers(sender);
}
protected void handlePlayerMessageAll(Player player) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.All"));
}
protected void handlePlayerMessageSkill(Player player, SkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
}
private boolean validateArguments(CommandSender sender, String skillName) {
return !(CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all"));
}
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
if (skill == null) {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
}
}
protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, skillType);
}
if (player != null) {
handlePlayerMessageAll(player);
}
}
else {
handleCommand(player, profile, skill);
if (player != null) {
handlePlayerMessageSkill(player, skill);
}
}
}
}

View File

@@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
public class PartyChangeOwnerCommand implements CommandExecutor {
@@ -17,7 +17,7 @@ public class PartyChangeOwnerCommand implements CommandExecutor {
switch (args.length) {
case 2:
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = Misc.getMatchedPlayerName(args[1]);
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
if (!playerParty.getMembers().contains(targetName)) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));

View File

@@ -1,9 +1,9 @@
package com.gmail.nossr50.commands.party;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -12,9 +12,10 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
@@ -25,7 +26,7 @@ import com.google.common.collect.ImmutableList;
public class PartyCommand implements TabExecutor {
private static final List<String> PARTY_SUBCOMMANDS;
private static final List<String> EXPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
private static final List<String> XPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
private static final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc");
static {
@@ -43,7 +44,7 @@ public class PartyCommand implements TabExecutor {
private CommandExecutor partyAcceptCommand = new PartyAcceptCommand();
private CommandExecutor partyCreateCommand = new PartyCreateCommand();
private CommandExecutor partyQuitCommand = new PartyQuitCommand();
private CommandExecutor partyExpShareCommand = new PartyExpShareCommand();
private CommandExecutor partyXpShareCommand = new PartyXpShareCommand();
private CommandExecutor partyItemShareCommand = new PartyItemShareCommand();
private CommandExecutor partyInviteCommand = new PartyInviteCommand();
private CommandExecutor partyKickCommand = new PartyKickCommand();
@@ -54,8 +55,9 @@ public class PartyCommand implements TabExecutor {
private CommandExecutor partyRenameCommand = new PartyRenameCommand();
private CommandExecutor partyInfoCommand = new PartyInfoCommand();
private CommandExecutor partyHelpCommand = new PartyHelpCommand();
private CommandExecutor partyTeleportCommand = mcMMO.p.getCommand("ptp").getExecutor();
private CommandExecutor partyTeleportCommand = new PtpCommand();
private CommandExecutor partyChatCommand = new PartyChatCommand();
private CommandExecutor partyAllianceCommand = new PartyAllianceCommand();
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@@ -133,8 +135,8 @@ public class PartyCommand implements TabExecutor {
}
switch (subcommand) {
case EXPSHARE:
return partyExpShareCommand.onCommand(sender, command, label, args);
case XPSHARE:
return partyXpShareCommand.onCommand(sender, command, label, args);
case ITEMSHARE:
return partyItemShareCommand.onCommand(sender, command, label, args);
case KICK:
@@ -150,6 +152,8 @@ public class PartyCommand implements TabExecutor {
return partyChangePasswordCommand.onCommand(sender, command, label, args);
case RENAME:
return partyRenameCommand.onCommand(sender, command, label, args);
case ALLIANCE:
return partyAllianceCommand.onCommand(sender, command, label, args);
default:
break;
}
@@ -174,10 +178,10 @@ public class PartyCommand implements TabExecutor {
case INVITE:
case KICK:
case OWNER:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
case EXPSHARE:
return StringUtil.copyPartialMatches(args[1], EXPSHARE_COMPLETIONS, new ArrayList<String>(EXPSHARE_COMPLETIONS.size()));
case XPSHARE:
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<String>(XPSHARE_COMPLETIONS.size()));
case ITEMSHARE:
return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<String>(ITEMSHARE_COMPLETIONS.size()));
case LOCK:
@@ -189,7 +193,10 @@ public class PartyCommand implements TabExecutor {
List<String> matches = StringUtil.copyPartialMatches(args[1], PtpCommand.TELEPORT_SUBCOMMANDS, new ArrayList<String>(PtpCommand.TELEPORT_SUBCOMMANDS.size()));
if (matches.size() == 0) {
playerNames = UserManager.getPlayerNames();
Player player = (Player) sender;
Party party = UserManager.getPlayer(player).getParty();
playerNames = party.getOnlinePlayerNames(player);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
}
@@ -216,13 +223,7 @@ public class PartyCommand implements TabExecutor {
}
private String[] extractArgs(String[] args) {
String[] newArgs = new String[args.length - 1];
for (int i = 1; i < args.length; i++) {
newArgs[i - 1] = args[i];
}
return newArgs;
return Arrays.copyOfRange(args, 1, args.length);
}
private boolean isItemShareCategory(String category) {

View File

@@ -20,7 +20,7 @@ public class PartyHelpCommand implements CommandExecutor {
sender.sendMessage(LocaleLoader.getString("Party.Help.7", "/party leader"));
sender.sendMessage(LocaleLoader.getString("Party.Help.8", "/party disband"));
sender.sendMessage(LocaleLoader.getString("Party.Help.9", "/party itemshare"));
sender.sendMessage(LocaleLoader.getString("Party.Help.10", "/party expshare"));
sender.sendMessage(LocaleLoader.getString("Party.Help.10", "/party xpshare"));
return true;
default:

View File

@@ -1,14 +1,17 @@
package com.gmail.nossr50.commands.party;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
@@ -26,7 +29,8 @@ public class PartyInfoCommand implements CommandExecutor {
Party party = mcMMOPlayer.getParty();
displayPartyHeader(player, party);
displayShareModeInfo(party, player);
displayShareModeInfo(player, party);
displayPartyFeatures(player, party);
displayMemberInfo(player, mcMMOPlayer, party);
return true;
@@ -36,31 +40,52 @@ public class PartyInfoCommand implements CommandExecutor {
}
}
private String createMembersList(Party party) {
StringBuilder memberList = new StringBuilder();
private void displayPartyHeader(Player player, Party party) {
player.sendMessage(LocaleLoader.getString("Commands.Party.Header"));
for (String memberName : party.getMembers()) {
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
StringBuilder status = new StringBuilder();
status.append(LocaleLoader.getString("Commands.Party.Status", party.getName(), LocaleLoader.getString("Party.Status." + (party.isLocked() ? "Locked" : "Unlocked")), party.getLevel()));
if (party.getLeader().equalsIgnoreCase(memberName)) {
memberList.append(ChatColor.GOLD);
}
else if (member != null) {
memberList.append(ChatColor.WHITE);
}
else {
memberList.append(ChatColor.GRAY);
}
memberList.append(memberName).append(" ");
if (!party.hasReachedLevelCap()) {
status.append(" (").append(party.getXpToLevelPercentage()).append(")");
}
return memberList.toString();
player.sendMessage(status.toString());
}
private void displayShareModeInfo(Party party, Player player) {
boolean xpShareEnabled = Config.getInstance().getExpShareEnabled();
boolean itemShareEnabled = Config.getInstance().getItemShareEnabled();
private void displayPartyFeatures(Player player, Party party) {
player.sendMessage(LocaleLoader.getString("Commands.Party.Features.Header"));
List<String> unlockedPartyFeatures = new ArrayList<String>();
List<String> lockedPartyFeatures = new ArrayList<String>();
for (PartyFeature partyFeature : PartyFeature.values()) {
if (!partyFeature.hasPermission(player)) {
continue;
}
if (isUnlockedFeature(party, partyFeature)) {
unlockedPartyFeatures.add(partyFeature.getLocaleString());
}
else {
lockedPartyFeatures.add(partyFeature.getFeatureLockedLocaleString());
}
}
player.sendMessage(LocaleLoader.getString("Commands.Party.UnlockedFeatures", unlockedPartyFeatures.isEmpty() ? "None" : unlockedPartyFeatures));
for (String message : lockedPartyFeatures) {
player.sendMessage(message);
}
}
private boolean isUnlockedFeature(Party party, PartyFeature partyFeature) {
return party.getLevel() >= Config.getInstance().getPartyFeatureUnlockLevel(partyFeature);
}
private void displayShareModeInfo(Player player, Party party) {
boolean xpShareEnabled = isUnlockedFeature(party, PartyFeature.XP_SHARE);
boolean itemShareEnabled = isUnlockedFeature(party, PartyFeature.ITEM_SHARE);
boolean itemSharingActive = (party.getItemShareMode() != ShareMode.NONE);
if (!xpShareEnabled && !itemShareEnabled) {
@@ -90,17 +115,12 @@ public class PartyInfoCommand implements CommandExecutor {
}
}
private void displayPartyHeader(Player player, Party party) {
player.sendMessage(LocaleLoader.getString("Commands.Party.Header"));
player.sendMessage(LocaleLoader.getString("Commands.Party.Status", party.getName(), LocaleLoader.getString("Party.Status." + (party.isLocked() ? "Locked" : "Unlocked"))));
}
private void displayMemberInfo(Player player, McMMOPlayer mcMMOPlayer, Party party) {
int membersNear = PartyManager.getNearMembers(mcMMOPlayer).size();
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
int membersOnline = party.getOnlineMembers().size() - 1;
player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header"));
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", membersNear, membersOnline));
player.sendMessage(createMembersList(party));
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size(), membersOnline));
player.sendMessage(party.createMembersList(player.getName(), nearMembers));
}
}

View File

@@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -18,8 +17,8 @@ public class PartyInviteCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
String targetName = Misc.getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName, true);
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = UserManager.getOfflinePlayer(targetName);
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return false;

View File

@@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.ItemShareType;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
@@ -17,13 +18,13 @@ import com.gmail.nossr50.util.player.UserManager;
public class PartyItemShareCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!Config.getInstance().getItemShareEnabled()) {
sender.sendMessage(LocaleLoader.getString("Party.ItemShare.Disabled"));
Party party = UserManager.getPlayer((Player) sender).getParty();
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.4"));
return true;
}
Party party = UserManager.getPlayer((Player) sender).getParty();
switch (args.length) {
case 2:
ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase());
@@ -37,7 +38,7 @@ public class PartyItemShareCommand implements CommandExecutor {
return true;
case 3:
boolean toggle = false;
boolean toggle;
if (CommandUtils.shouldEnableToggle(args[2])) {
toggle = true;

View File

@@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -19,7 +18,7 @@ public class PartyJoinCommand implements CommandExecutor {
switch (args.length) {
case 2:
case 3:
String targetName = Misc.getMatchedPlayerName(args[1]);
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName);
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {

View File

@@ -11,6 +11,7 @@ import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
public class PartyKickCommand implements CommandExecutor {
@@ -19,13 +20,15 @@ public class PartyKickCommand implements CommandExecutor {
switch (args.length) {
case 2:
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(args[1]);
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
if (!playerParty.getMembers().contains(target.getName())) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", target.getName()));
if (!playerParty.getMembers().contains(targetName)) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
return true;
}
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);
if (target.isOnline()) {
Player onlineTarget = target.getPlayer();
String partyName = playerParty.getName();

View File

@@ -7,7 +7,7 @@ public enum PartySubcommandType {
HELP,
INFO,
QUIT,
EXPSHARE,
XPSHARE,
ITEMSHARE,
INVITE,
KICK,
@@ -18,7 +18,8 @@ public enum PartySubcommandType {
PASSWORD,
RENAME,
TELEPORT,
CHAT;
CHAT,
ALLIANCE;
public static PartySubcommandType getSubcommand(String commandName) {
for (PartySubcommandType command : values()) {
@@ -37,11 +38,14 @@ public enum PartySubcommandType {
return OWNER;
}
else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) {
return EXPSHARE;
return XPSHARE;
}
else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) {
return ITEMSHARE;
}
else if (commandName.equalsIgnoreCase("ally")) {
return ALLIANCE;
}
return null;
}

View File

@@ -7,24 +7,25 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
public class PartyExpShareCommand implements CommandExecutor {
public class PartyXpShareCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!Config.getInstance().getExpShareEnabled()) {
sender.sendMessage(LocaleLoader.getString("Party.ExpShare.Disabled"));
Party party = UserManager.getPlayer((Player) sender).getParty();
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.XP_SHARE)) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.5"));
return true;
}
switch (args.length) {
case 2:
Party party = UserManager.getPlayer((Player) sender).getParty();
if (args[1].equalsIgnoreCase("none") || CommandUtils.shouldDisableToggle(args[1])) {
handleChangingShareMode(party, ShareMode.NONE);
}
@@ -32,13 +33,13 @@ public class PartyExpShareCommand implements CommandExecutor {
handleChangingShareMode(party, ShareMode.EQUAL);
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "<NONE | EQUAL>"));
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "xpshare", "<NONE | EQUAL>"));
}
return true;
default:
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "<NONE | EQUAL>"));
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "xpshare", "<NONE | EQUAL>"));
return true;
}
}
@@ -46,7 +47,7 @@ public class PartyExpShareCommand implements CommandExecutor {
private void handleChangingShareMode(Party party, ShareMode mode) {
party.setXpShareMode(mode);
String changeModeMessage = LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Exp"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())));
String changeModeMessage = LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Xp"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())));
for (Player member : party.getOnlineMembers()) {
member.sendMessage(changeModeMessage);

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,9 +9,9 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillUtils;
public class PtpAcceptCommand implements CommandExecutor {
@Override
@@ -29,7 +29,7 @@ public class PtpAcceptCommand implements CommandExecutor {
return true;
}
if ((ptpRecord.getTimeout() + Config.getInstance().getPTPCommandTimeout()) * Misc.TIME_CONVERSION_FACTOR < System.currentTimeMillis()) {
if (SkillUtils.cooldownExpired(ptpRecord.getTimeout(), Config.getInstance().getPTPCommandTimeout())) {
ptpRecord.removeRequest();
player.sendMessage(LocaleLoader.getString("Commands.ptp.RequestExpired"));
return true;

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.party.teleport;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -13,6 +12,8 @@ import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
@@ -40,6 +41,21 @@ public class PtpCommand implements TabExecutor {
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (!mcMMOPlayer.inParty()) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
return true;
}
Party party = mcMMOPlayer.getParty();
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.TELEPORT)) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.2"));
return true;
}
switch (args.length) {
case 1:
if (args[0].equalsIgnoreCase("toggle")) {
@@ -50,9 +66,6 @@ public class PtpCommand implements TabExecutor {
return ptpAcceptAnyCommand.onCommand(sender, command, label, args);
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
int hurtCooldown = Config.getInstance().getPTPCommandRecentlyHurtCooldown();
@@ -86,7 +99,7 @@ public class PtpCommand implements TabExecutor {
}
}
sendTeleportRequest(sender, player, Misc.getMatchedPlayerName(args[0]));
sendTeleportRequest(sender, player, CommandUtils.getMatchedPlayerName(args[0]));
return true;
default:
@@ -101,7 +114,14 @@ public class PtpCommand implements TabExecutor {
List<String> matches = StringUtil.copyPartialMatches(args[0], TELEPORT_SUBCOMMANDS, new ArrayList<String>(TELEPORT_SUBCOMMANDS.size()));
if (matches.size() == 0) {
Set<String> playerNames = UserManager.getPlayerNames();
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (!mcMMOPlayer.inParty()) {
return ImmutableList.of();
}
List<String> playerNames = mcMMOPlayer.getParty().getOnlinePlayerNames(player);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
}

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.player;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -16,7 +15,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -29,8 +27,8 @@ public class InspectCommand implements TabExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
@@ -105,7 +103,7 @@ public class InspectCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();

View File

@@ -41,7 +41,7 @@ public class MccooldownCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
for (AbilityType ability : AbilityType.NORMAL_ABILITIES) {
for (AbilityType ability : AbilityType.values()) {
if (!ability.getPermissions(player)) {
continue;
}

View File

@@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.player;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -15,7 +14,6 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -46,8 +44,8 @@ public class McrankCommand implements TabExecutor {
return true;
}
String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
if (mcMMOPlayer != null) {
Player player = mcMMOPlayer.getPlayer();
@@ -73,7 +71,7 @@ public class McrankCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();
@@ -83,8 +81,9 @@ public class McrankCommand implements TabExecutor {
private void display(CommandSender sender, String playerName) {
if (sender instanceof Player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
if (mcMMOPlayer.getDatabaseATS() + Misc.PLAYER_DATABASE_COOLDOWN_MILLIS > System.currentTimeMillis()) {
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
return;
}
@@ -93,7 +92,7 @@ public class McrankCommand implements TabExecutor {
}
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getRankUseBoard());
boolean useChat = useBoard ? Config.getInstance().getRankUseChat() : true;
boolean useChat = !useBoard || Config.getInstance().getRankUseChat();
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
}

View File

@@ -15,7 +15,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
@@ -85,8 +84,9 @@ public class MctopCommand implements TabExecutor {
if (sender instanceof Player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
if (mcMMOPlayer.getDatabaseATS() + Misc.PLAYER_DATABASE_COOLDOWN_MILLIS > System.currentTimeMillis()) {
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
return;
}
@@ -99,7 +99,7 @@ public class MctopCommand implements TabExecutor {
private void display(int page, SkillType skill, CommandSender sender) {
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getTopUseBoard());
boolean useChat = useBoard ? Config.getInstance().getTopUseChat() : true;
boolean useChat = !useBoard || Config.getInstance().getTopUseChat();
new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
}

View File

@@ -5,9 +5,9 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
import com.gmail.nossr50.util.Permissions;
public class AcrobaticsCommand extends SkillCommand {
@@ -30,21 +30,21 @@ public class AcrobaticsCommand extends SkillCommand {
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// DODGE
if (canDodge) {
String[] dodgeStrings = calculateAbilityDisplayValues(skillValue, Acrobatics.dodgeMaxBonusLevel, Acrobatics.dodgeMaxChance, isLucky);
String[] dodgeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DODGE, isLucky);
dodgeChance = dodgeStrings[0];
dodgeChanceLucky = dodgeStrings[1];
}
// ROLL
if (canRoll) {
String[] rollStrings = calculateAbilityDisplayValues(skillValue, Acrobatics.rollMaxBonusLevel, Acrobatics.rollMaxChance, isLucky);
String[] rollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.ROLL, isLucky);
rollChance = rollStrings[0];
rollChanceLucky = rollStrings[1];
}
// GRACEFUL ROLL
if (canGracefulRoll) {
String[] gracefulRollStrings = calculateAbilityDisplayValues(skillValue, Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollMaxChance, isLucky);
String[] gracefulRollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GRACEFUL_ROLL, isLucky);
gracefulRollChance = gracefulRollStrings[0];
gracefulRollChanceLucky = gracefulRollStrings[1];
}
@@ -52,9 +52,9 @@ public class AcrobaticsCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canDodge = Permissions.dodge(player);
canRoll = Permissions.roll(player);
canGracefulRoll = Permissions.gracefulRoll(player);
canDodge = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DODGE);
canRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ROLL);
canGracefulRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GRACEFUL_ROLL);
}
@Override

View File

@@ -0,0 +1,103 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.alchemy.Alchemy.Tier;
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
public class AlchemyCommand extends SkillCommand {
private String brewSpeed;
private String brewSpeedLucky;
private int tier;
private int ingredientCount;
private String ingredientList;
private boolean canCatalysis;
private boolean canConcoctions;
public AlchemyCommand() {
super(SkillType.ALCHEMY);
}
protected String[] calculateAbilityDisplayValues(Player player, boolean isLucky) {
AlchemyManager alchemyManager = UserManager.getPlayer(player).getAlchemyManager();
String[] displayValues = new String[2];
displayValues[0] = decimal.format(alchemyManager.calculateBrewSpeed(false)) + "x";
displayValues[1] = isLucky ? decimal.format(alchemyManager.calculateBrewSpeed(true)) + "x" : null;
return displayValues;
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// CATALYSIS
if (canCatalysis) {
String[] catalysisStrings = calculateAbilityDisplayValues(player, isLucky);
brewSpeed = catalysisStrings[0];
brewSpeedLucky = catalysisStrings[1];
}
// CONCOCTIONS
if (canConcoctions) {
AlchemyManager alchemyManager = UserManager.getPlayer(player).getAlchemyManager();
tier = alchemyManager.getTier();
ingredientCount = alchemyManager.getIngredients().size();
ingredientList = alchemyManager.getIngredientList();
}
}
@Override
protected void permissionsCheck(Player player) {
canCatalysis = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CATALYSIS);
canConcoctions = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CONCOCTIONS);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canCatalysis) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Alchemy.Effect.0"), LocaleLoader.getString("Alchemy.Effect.1")));
}
if (canConcoctions) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Alchemy.Effect.2"), LocaleLoader.getString("Alchemy.Effect.3")));
}
return messages;
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canCatalysis) {
int unlockLevel = AdvancedConfig.getInstance().getCatalysisUnlockLevel();
if (skillValue < unlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Alchemy.Ability.Locked.0", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Alchemy.Catalysis.Speed", brewSpeed) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", brewSpeedLucky) : ""));
}
}
if (canConcoctions) {
messages.add(LocaleLoader.getString("Alchemy.Concoctions.Rank", tier, Tier.values().length));
messages.add(LocaleLoader.getString("Alchemy.Concoctions.Ingredients", ingredientCount, ingredientList));
}
return messages;
}
}

View File

@@ -0,0 +1,205 @@
package com.gmail.nossr50.commands.skills;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.HolidayManager.FakeSkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.google.common.collect.ImmutableList;
public class AprilCommand implements TabExecutor {
private String skillName;
protected DecimalFormat percent = new DecimalFormat("##0.00%");
protected DecimalFormat decimal = new DecimalFormat("##0.00");
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
skillName = StringUtils.getCapitalized(label);
switch (args.length) {
case 0:
Player player = (Player) sender;
FakeSkillType fakeSkillType = FakeSkillType.getByName(skillName);
float skillValue = Misc.getRandom().nextInt(99);
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
player.sendMessage(LocaleLoader.getString("Commands.XPGain", getXPGainString(fakeSkillType)));
player.sendMessage(LocaleLoader.getString("Effects.Level", (int) skillValue, Misc.getRandom().nextInt(1000), 1000 + Misc.getRandom().nextInt(1000)));
List<String> effectMessages = effectsDisplay(fakeSkillType);
if (!effectMessages.isEmpty()) {
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Effects.Effects")));
for (String message : effectMessages) {
player.sendMessage(message);
}
}
List<String> statsMessages = statsDisplay(fakeSkillType);
if (!statsMessages.isEmpty()) {
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Commands.Stats.Self")));
for (String message : statsMessages) {
player.sendMessage(message);
}
}
player.sendMessage(LocaleLoader.formatString("[[DARK_AQUA]]Guide for {0} available - type /APRIL FOOLS ! :D", skillName));
return true;
default:
return true;
}
}
private String getXPGainString(FakeSkillType fakeSkillType) {
switch (fakeSkillType) {
case MACHO:
return "Get beaten up";
case JUMPING:
return "Kris Kross will make ya Jump Jump";
case THROWING:
return "Chuck your items on the floor";
case WRECKING:
return "I'M GONNA WRECK IT!";
case CRAFTING:
return "Craft apple pies";
case WALKING:
return "Walk around the park";
case SWIMMING:
return "Like a fish on a bicycle";
case FALLING:
return "Faceplant the floor, headbutt the ground";
case CLIMBING:
return "Climb the highest mountain";
case FLYING:
return "I believe I can fly";
case DIVING:
return "Scuba club 4000";
case PIGGY:
return "OINK! OINK!";
default:
return "Sit and wait?";
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return ImmutableList.of("?");
default:
return ImmutableList.of();
}
}
private List<String> effectsDisplay(FakeSkillType fakeSkillType) {
List<String> messages = new ArrayList<String>();
switch (fakeSkillType) {
case MACHO:
messages.add(LocaleLoader.getString("Effects.Template", "Punching bag", "Absorb damage, like a bag of sand"));
break;
case JUMPING:
messages.add(LocaleLoader.getString("Effects.Template", "Jump", "PRESS SPACE TO JUMP"));
messages.add(LocaleLoader.getString("Effects.Template", "Jump Twice", "PRESS SPACE TWICE TO JUMP TWICE"));
break;
case THROWING:
messages.add(LocaleLoader.getString("Effects.Template", "Drop Item", "Randomly drop items, at random"));
break;
case WRECKING:
messages.add(LocaleLoader.getString("Effects.Template", "Ralphinator", "Smash windows with your fists"));
break;
case CRAFTING:
messages.add(LocaleLoader.getString("Effects.Template", "Crafting", "Chance of successful craft"));
break;
case WALKING:
messages.add(LocaleLoader.getString("Effects.Template", "Walk", "Traveling gracefully by foot"));
break;
case SWIMMING:
messages.add(LocaleLoader.getString("Effects.Template", "Swim", "Just keep swimming, swimming, swimming"));
break;
case FALLING:
messages.add(LocaleLoader.getString("Effects.Template", "Skydiving", "Go jump of a cliff. No, seriously."));
break;
case CLIMBING:
messages.add(LocaleLoader.getString("Effects.Template", "Rock Climber", "Use string to climb mountains faster"));
break;
case FLYING:
messages.add(LocaleLoader.getString("Effects.Template", "Fly", "Throw yourself at the ground and miss"));
break;
case DIVING:
messages.add(LocaleLoader.getString("Effects.Template", "Hold Breath", "Press shift to hold your breath longer"));
break;
case PIGGY:
messages.add(LocaleLoader.getString("Effects.Template", "Carrot Turbo", "Supercharge your pigs with carrots"));
break;
}
return messages;
}
private List<String> statsDisplay(FakeSkillType fakeSkillType) {
List<String> messages = new ArrayList<String>();
switch (fakeSkillType) {
case MACHO:
messages.add(LocaleLoader.formatString("[[RED]]Damage Taken: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(77))));
break;
case JUMPING:
messages.add(LocaleLoader.formatString("[[RED]]Double Jump Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case THROWING:
messages.add(LocaleLoader.formatString("[[RED]]Drop Item Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(87))));
break;
case WRECKING:
messages.add(LocaleLoader.formatString("[[RED]]Wrecking Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(14))));
break;
case CRAFTING:
messages.add(LocaleLoader.formatString("[[RED]]Crafting Success: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case WALKING:
messages.add(LocaleLoader.formatString("[[RED]]Walk Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case SWIMMING:
messages.add(LocaleLoader.formatString("[[RED]]Swim Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case FALLING:
messages.add(LocaleLoader.formatString("[[RED]]Skydiving Success: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(37))));
break;
case CLIMBING:
messages.add(LocaleLoader.formatString("[[RED]]Rock Climber Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case FLYING:
messages.add(LocaleLoader.formatString("[[RED]]Fly Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case DIVING:
messages.add(LocaleLoader.formatString("[[RED]]Hold Breath Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
break;
case PIGGY:
messages.add(LocaleLoader.formatString("[[RED]]Carrot Turbo Boost: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(80)) + 10));
break;
}
return messages;
}
}

View File

@@ -5,6 +5,7 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.archery.Archery;
@@ -35,14 +36,14 @@ public class ArcheryCommand extends SkillCommand {
// DAZE
if (canDaze) {
String[] dazeStrings = calculateAbilityDisplayValues(skillValue, Archery.dazeMaxBonusLevel, Archery.dazeMaxBonus, isLucky);
String[] dazeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DAZE, isLucky);
dazeChance = dazeStrings[0];
dazeChanceLucky = dazeStrings[1];
}
// RETRIEVE
if (canRetrieve) {
String[] retrieveStrings = calculateAbilityDisplayValues(skillValue, Archery.retrieveMaxBonusLevel, Archery.retrieveMaxChance, isLucky);
String[] retrieveStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.RETRIEVE, isLucky);
retrieveChance = retrieveStrings[0];
retrieveChanceLucky = retrieveStrings[1];
}
@@ -50,9 +51,9 @@ public class ArcheryCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canSkillShot = Permissions.bonusDamage(player, skill);
canDaze = Permissions.daze(player);
canRetrieve = Permissions.arrowRetrieval(player);
canSkillShot = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SKILL_SHOT);
canDaze = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DAZE);
canRetrieve = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.RETRIEVE);
}
@Override

View File

@@ -5,6 +5,7 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.axes.Axes;
@@ -13,14 +14,14 @@ import com.gmail.nossr50.util.Permissions;
public class AxesCommand extends SkillCommand {
private String critChance;
private String critChanceLucky;
private double bonusDamage;
private double axeMasteryDamage;
private double impactDamage;
private String skullSplitterLength;
private String skullSplitterLengthEndurance;
private boolean canSkullSplitter;
private boolean canCritical;
private boolean canBonusDamage;
private boolean canAxeMastery;
private boolean canImpact;
private boolean canGreaterImpact;
@@ -30,7 +31,7 @@ public class AxesCommand extends SkillCommand {
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// IMPACT
// ARMOR IMPACT
if (canImpact) {
impactDamage = 1 + (skillValue / Axes.impactIncreaseLevel);
}
@@ -42,26 +43,26 @@ public class AxesCommand extends SkillCommand {
skullSplitterLengthEndurance = skullSplitterStrings[1];
}
// CRITICAL STRIKES
// CRITICAL HIT
if (canCritical) {
String[] criticalStrikeStrings = calculateAbilityDisplayValues(skillValue, Axes.criticalHitMaxBonusLevel, Axes.criticalHitMaxChance, isLucky);
critChance = criticalStrikeStrings[0];
critChanceLucky = criticalStrikeStrings[1];
String[] criticalHitStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.CRITICAL_HIT, isLucky);
critChance = criticalHitStrings[0];
critChanceLucky = criticalHitStrings[1];
}
// AXE MASTERY
if (canBonusDamage) {
bonusDamage = Math.min(skillValue / (Axes.bonusDamageMaxBonusLevel / Axes.bonusDamageMaxBonus), Axes.bonusDamageMaxBonus);
if (canAxeMastery) {
axeMasteryDamage = Math.min(skillValue / (Axes.axeMasteryMaxBonusLevel / Axes.axeMasteryMaxBonus), Axes.axeMasteryMaxBonus);
}
}
@Override
protected void permissionsCheck(Player player) {
canSkullSplitter = Permissions.skullSplitter(player);
canCritical = Permissions.criticalStrikes(player);
canBonusDamage = Permissions.bonusDamage(player, skill);
canImpact = Permissions.armorImpact(player);
canGreaterImpact = Permissions.greaterImpact(player);
canCritical = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CRITICAL_HIT);
canAxeMastery = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.AXE_MASTERY);
canImpact = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ARMOR_IMPACT);
canGreaterImpact = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GREATER_IMPACT);
}
@Override
@@ -76,7 +77,7 @@ public class AxesCommand extends SkillCommand {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.2"), LocaleLoader.getString("Axes.Effect.3")));
}
if (canBonusDamage) {
if (canAxeMastery) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.4"), LocaleLoader.getString("Axes.Effect.5")));
}
@@ -95,8 +96,8 @@ public class AxesCommand extends SkillCommand {
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canBonusDamage) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", bonusDamage)));
if (canAxeMastery) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", axeMasteryDamage)));
}
if (canImpact) {

View File

@@ -5,6 +5,7 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
@@ -33,7 +34,7 @@ public class ExcavationCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canGigaDrill = Permissions.gigaDrillBreaker(player);
canTreasureHunt = Permissions.excavationTreasureHunter(player);
canTreasureHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.EXCAVATION_TREASURE_HUNTER);
}
@Override

View File

@@ -4,12 +4,12 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.block.Biome;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.treasure.Rarity;
import com.gmail.nossr50.locale.LocaleLoader;
@@ -50,7 +50,6 @@ public class FishingCommand extends SkillCommand {
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
boolean isStorming = player.getWorld().hasStorm();
// TREASURE HUNTER
if (canTreasureHunt) {
@@ -69,7 +68,7 @@ public class FishingCommand extends SkillCommand {
double totalEnchantChance = 0;
for (Rarity rarity : Rarity.values()) {
if (rarity != Rarity.TRAP || rarity != Rarity.RECORD) {
if (rarity != Rarity.TRAP && rarity != Rarity.RECORD) {
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
}
}
@@ -91,16 +90,14 @@ public class FishingCommand extends SkillCommand {
// MASTER ANGLER
if (canMasterAngler) {
double rawBiteChance = 1.0 / (isStorming ? 300 : 500);
double rawBiteChance = 1.0 / (player.getWorld().hasStorm() ? 300 : 500);
Location location = fishingManager.getHookLocation();
if (location == null) {
location = player.getLocation();
}
Biome biome = location.getBlock().getBiome();
if (biome == Biome.RIVER || biome == Biome.OCEAN) {
if (Fishing.masterAnglerBiomes.contains(location.getBlock().getBiome())) {
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
}
@@ -114,12 +111,12 @@ public class FishingCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canTreasureHunt = Permissions.fishingTreasureHunter(player);
canMagicHunt = Permissions.magicHunter(player);
canShake = Permissions.shake(player);
canFishermansDiet = Permissions.fishermansDiet(player);
canMasterAngler = Permissions.masterAngler(player);
canIceFish = Permissions.iceFishing(player);
canTreasureHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FISHING_TREASURE_HUNTER);
canMagicHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.MAGIC_HUNTER);
canShake = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHAKE);
canFishermansDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FISHERMANS_DIET);
canMasterAngler = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.MASTER_ANGLER);
canIceFish = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ICE_FISHING);
}
@Override
@@ -158,7 +155,7 @@ public class FishingCommand extends SkillCommand {
List<String> messages = new ArrayList<String>();
if (canTreasureHunt) {
messages.add(LocaleLoader.getString("Fishing.Ability.Rank", lootTier, Tier.EIGHT.toNumerical()));
messages.add(LocaleLoader.getString("Fishing.Ability.Rank", lootTier, Tier.values().length));
messages.add(LocaleLoader.getString("Fishing.Ability.TH.DropRate", trapTreasure, commonTreasure, uncommonTreasure, rareTreasure, epicTreasure, legendaryTreasure, recordTreasure));
}

View File

@@ -6,6 +6,7 @@ import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.herbalism.Herbalism;
@@ -55,28 +56,28 @@ public class HerbalismCommand extends SkillCommand {
if (canGreenThumbBlocks || canGreenThumbPlants) {
greenThumbStage = calculateRank(skillValue, Herbalism.greenThumbStageMaxLevel, Herbalism.greenThumbStageChangeLevel);
String[] greenThumbStrings = calculateAbilityDisplayValues(skillValue, Herbalism.greenThumbMaxLevel, Herbalism.greenThumbMaxChance, isLucky);
String[] greenThumbStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GREEN_THUMB_PLANT, isLucky);
greenThumbChance = greenThumbStrings[0];
greenThumbChanceLucky = greenThumbStrings[1];
}
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, Herbalism.doubleDropsMaxLevel, Herbalism.doubleDropsMaxChance, isLucky);
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.HERBALISM_DOUBLE_DROPS, isLucky);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
// HYLIAN LUCK
if (hasHylianLuck) {
String[] hylianLuckStrings = calculateAbilityDisplayValues(skillValue, Herbalism.hylianLuckMaxLevel, Herbalism.hylianLuckMaxChance, isLucky);
String[] hylianLuckStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.HYLIAN_LUCK, isLucky);
hylianLuckChance = hylianLuckStrings[0];
hylianLuckChanceLucky = hylianLuckStrings[1];
}
// SHROOM THUMB
if (canShroomThumb) {
String[] shroomThumbStrings = calculateAbilityDisplayValues(skillValue, Herbalism.shroomThumbMaxLevel, Herbalism.shroomThumbMaxChance, isLucky);
String[] shroomThumbStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.SHROOM_THUMB, isLucky);
shroomThumbChance = shroomThumbStrings[0];
shroomThumbChanceLucky = shroomThumbStrings[1];
}
@@ -84,13 +85,13 @@ public class HerbalismCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
hasHylianLuck = Permissions.hylianLuck(player);
hasHylianLuck = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HYLIAN_LUCK);
canGreenTerra = Permissions.greenTerra(player);
canGreenThumbPlants = Permissions.greenThumbPlant(player, Material.CROPS) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.NETHER_WARTS) || Permissions.greenThumbPlant(player, Material.COCOA);
canGreenThumbBlocks = Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK);
canFarmersDiet = Permissions.farmersDiet(player);
canDoubleDrop = Permissions.doubleDrops(player, skill) && !skill.getDoubleDropsDisabled();
canShroomThumb = Permissions.shroomThumb(player);
canFarmersDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FARMERS_DIET);
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canShroomThumb = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHROOM_THUMB);
}
@Override

View File

@@ -6,10 +6,10 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
import com.gmail.nossr50.skills.mining.Mining;
import com.gmail.nossr50.skills.mining.MiningManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
@@ -48,7 +48,7 @@ public class MiningCommand extends SkillCommand {
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, Mining.doubleDropsMaxLevel, Mining.doubleDropsMaxChance, isLucky);
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.MINING_DOUBLE_DROPS, isLucky);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
@@ -71,7 +71,7 @@ public class MiningCommand extends SkillCommand {
canBiggerBombs = Permissions.biggerBombs(player);
canBlast = Permissions.remoteDetonation(player);
canDemoExpert = Permissions.demolitionsExpertise(player);
canDoubleDrop = Permissions.doubleDrops(player, skill) && !skill.getDoubleDropsDisabled();
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.MINING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canSuperBreaker = Permissions.superBreaker(player);
}
@@ -121,7 +121,7 @@ public class MiningCommand extends SkillCommand {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", unlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, Tier.EIGHT.toNumerical(), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, Tier.values().length, LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
}
}

View File

@@ -7,6 +7,8 @@ import org.bukkit.Material;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.repair.ArcaneForging;
@@ -25,7 +27,6 @@ public class RepairCommand extends SkillCommand {
private boolean canSuperRepair;
private boolean canMasterRepair;
private boolean canArcaneForge;
private boolean canSalvage;
private boolean canRepairStone;
private boolean canRepairIron;
private boolean canRepairGold;
@@ -65,7 +66,7 @@ public class RepairCommand extends SkillCommand {
// SUPER REPAIR
if (canSuperRepair) {
String[] superRepairStrings = calculateAbilityDisplayValues(skillValue, Repair.superRepairMaxBonusLevel, Repair.superRepairMaxChance, isLucky);
String[] superRepairStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.SUPER_REPAIR, isLucky);
superRepairChance = superRepairStrings[0];
superRepairChanceLucky = superRepairStrings[1];
}
@@ -73,17 +74,16 @@ public class RepairCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canSuperRepair = Permissions.superRepair(player);
canMasterRepair = Permissions.repairMastery(player);
canArcaneForge = Permissions.arcaneForging(player);
canSalvage = Permissions.salvage(player);
canRepairDiamond = Permissions.repairDiamond(player);
canRepairGold = Permissions.repairGold(player);
canRepairIron = Permissions.repairIron(player);
canRepairStone = Permissions.repairStone(player);
canRepairString = Permissions.repairString(player);
canRepairLeather = Permissions.repairLeather(player);
canRepairWood = Permissions.repairWood(player);
canSuperRepair = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SUPER_REPAIR);
canMasterRepair = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.REPAIR_MASTERY);
canArcaneForge = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ARCANE_FORGING);
canRepairDiamond = Permissions.repairMaterialType(player, MaterialType.DIAMOND);
canRepairGold = Permissions.repairMaterialType(player, MaterialType.GOLD);
canRepairIron = Permissions.repairMaterialType(player, MaterialType.IRON);
canRepairStone = Permissions.repairMaterialType(player, MaterialType.STONE);
canRepairString = Permissions.repairMaterialType(player, MaterialType.STRING);
canRepairLeather = Permissions.repairMaterialType(player, MaterialType.LEATHER);
canRepairWood = Permissions.repairMaterialType(player, MaterialType.WOOD);
arcaneBypass = Permissions.arcaneBypass(player);
}
@@ -121,10 +121,6 @@ public class RepairCommand extends SkillCommand {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.6", diamondLevel), LocaleLoader.getString("Repair.Effect.7")));
}
if (canSalvage && Repair.salvageUnlockLevel > 0) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.16", Repair.salvageUnlockLevel), LocaleLoader.getString("Repair.Effect.17")));
}
if (canArcaneForge) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Repair.Effect.8"), LocaleLoader.getString("Repair.Effect.9")));
}
@@ -147,7 +143,7 @@ public class RepairCommand extends SkillCommand {
if (canArcaneForge) {
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
messages.add(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), Tier.EIGHT.toNumerical()));
messages.add(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), Tier.values().length));
if (ArcaneForging.arcaneForgingEnchantLoss) {
messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Success", (arcaneBypass ? 100 : repairManager.getKeepEnchantChance())));

View File

@@ -0,0 +1,79 @@
package com.gmail.nossr50.commands.skills;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.salvage.Salvage;
import com.gmail.nossr50.skills.salvage.SalvageManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
public class SalvageCommand extends SkillCommand {
private boolean canAdvancedSalvage;
private boolean canArcaneSalvage;
public SalvageCommand() {
super(SkillType.SALVAGE);
}
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
// TODO Auto-generated method stub
}
@Override
protected void permissionsCheck(Player player) {
canAdvancedSalvage = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ADVANCED_SALVAGE);
canArcaneSalvage = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ARCANE_SALVAGE);
}
@Override
protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>();
if (canAdvancedSalvage) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Salvage.Effect.0"), LocaleLoader.getString("Salvage.Effect.1")));
}
if (canArcaneSalvage) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Salvage.Effect.2"), LocaleLoader.getString("Salvage.Effect.3")));
}
return messages;
}
@Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
SalvageManager salvageManager = UserManager.getPlayer(player).getSalvageManager();
if (canAdvancedSalvage) {
if (skillValue < Salvage.advancedSalvageUnlockLevel) {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Salvage.Ability.Locked.0", Salvage.advancedSalvageUnlockLevel)));
}
else {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Ability.Bonus.0"), LocaleLoader.getString("Salvage.Ability.Bonus.1", percent.format(salvageManager.getMaxSalvagePercentage()))));
}
}
if (canArcaneSalvage) {
messages.add(LocaleLoader.getString("Salvage.Arcane.Rank", salvageManager.getArcaneSalvageRank(), Salvage.Tier.values().length));
if (Salvage.arcaneSalvageEnchantLoss) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Arcane.ExtractFull"), percent.format(salvageManager.getExtractFullEnchantChance() / 100)));
}
if (Salvage.arcaneSalvageDowngrades) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Arcane.ExtractPartial"), percent.format(salvageManager.getExtractPartialEnchantChance() / 100)));
}
}
return messages;
}
}

View File

@@ -13,9 +13,11 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.Motd;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
@@ -86,8 +88,7 @@ public abstract class SkillCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Effects.Effects")));
if (isLucky) {
String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix");
player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc", skillName)));
player.sendMessage(Motd.PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc", skillName)));
}
for (String message : effectMessages) {
@@ -136,8 +137,10 @@ public abstract class SkillCommand implements TabExecutor {
return displayValues;
}
protected String[] calculateAbilityDisplayValues(float skillValue, int maxBonusLevel, double maxChance, boolean isLucky) {
return calculateAbilityDisplayValues((maxChance / maxBonusLevel) * Math.min(skillValue, maxBonusLevel), isLucky);
protected String[] calculateAbilityDisplayValues(float skillValue, SecondaryAbility skillAbility, boolean isLucky) {
int maxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(skillAbility);
return calculateAbilityDisplayValues((AdvancedConfig.getInstance().getMaxChance(skillAbility) / maxBonusLevel) * Math.min(skillValue, maxBonusLevel), isLucky);
}
protected String[] calculateLengthDisplayValues(Player player, float skillValue) {

View File

@@ -6,6 +6,7 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.smelting.Smelting;
@@ -38,7 +39,7 @@ public class SmeltingCommand extends SkillCommand {
// SECOND SMELT
if (canSecondSmelt) {
String[] secondSmeltStrings = calculateAbilityDisplayValues(skillValue, Smelting.secondSmeltMaxLevel, Smelting.secondSmeltMaxChance, isLucky);
String[] secondSmeltStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.SECOND_SMELT, isLucky);
secondSmeltChance = secondSmeltStrings[0];
secondSmeltChanceLucky = secondSmeltStrings[1];
}
@@ -53,9 +54,9 @@ public class SmeltingCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canFuelEfficiency = Permissions.fuelEfficiency(player);
canSecondSmelt = Permissions.doubleDrops(player, skill);
canFluxMine = Permissions.fluxMining(player);
canFuelEfficiency = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FUEL_EFFICIENCY);
canSecondSmelt = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SECOND_SMELT);
canFluxMine = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FLUX_MINING);
canVanillaXPBoost = Permissions.vanillaXpBoost(player, skill);
}

View File

@@ -5,14 +5,16 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.swords.Swords;
import com.gmail.nossr50.util.Permissions;
public class SwordsCommand extends SkillCommand {
private String counterAttackChance;
private String counterAttackChanceLucky;
private String counterChance;
private String counterChanceLucky;
private int bleedLength;
private String bleedChance;
private String bleedChanceLucky;
@@ -38,25 +40,25 @@ public class SwordsCommand extends SkillCommand {
// BLEED
if (canBleed) {
bleedLength = (skillValue >= Swords.bleedMaxBonusLevel) ? Swords.bleedMaxTicks : Swords.bleedBaseTicks;
bleedLength = (skillValue >= AdvancedConfig.getInstance().getMaxBonusLevel(SecondaryAbility.BLEED)) ? Swords.bleedMaxTicks : Swords.bleedBaseTicks;
String[] bleedStrings = calculateAbilityDisplayValues(skillValue, Swords.bleedMaxBonusLevel, Swords.bleedMaxChance, isLucky);
String[] bleedStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.BLEED, isLucky);
bleedChance = bleedStrings[0];
bleedChanceLucky = bleedStrings[1];
}
// COUNTER ATTACK
// COUNTER
if (canCounter) {
String[] counterAttackStrings = calculateAbilityDisplayValues(skillValue, Swords.counterAttackMaxBonusLevel, Swords.counterAttackMaxChance, isLucky);
counterAttackChance = counterAttackStrings[0];
counterAttackChanceLucky = counterAttackStrings[1];
String[] counterStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.COUNTER, isLucky);
counterChance = counterStrings[0];
counterChanceLucky = counterStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBleed = Permissions.bleed(player);
canCounter = Permissions.counterAttack(player);
canBleed = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BLEED);
canCounter = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.COUNTER);
canSerratedStrike = Permissions.serratedStrikes(player);
}
@@ -85,7 +87,7 @@ public class SwordsCommand extends SkillCommand {
List<String> messages = new ArrayList<String>();
if (canCounter) {
messages.add(LocaleLoader.getString("Swords.Combat.Counter.Chance", counterAttackChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterAttackChanceLucky) : ""));
messages.add(LocaleLoader.getString("Swords.Combat.Counter.Chance", counterChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterChanceLucky) : ""));
}
if (canBleed) {

View File

@@ -7,6 +7,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.taming.Taming;
@@ -33,7 +34,7 @@ public class TamingCommand extends SkillCommand {
@Override
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
if (canGore) {
String[] goreStrings = calculateAbilityDisplayValues(skillValue, Taming.goreMaxBonusLevel, Taming.goreMaxChance, isLucky);
String[] goreStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GORE, isLucky);
goreChance = goreStrings[0];
goreChanceLucky = goreStrings[1];
}
@@ -41,15 +42,15 @@ public class TamingCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canBeastLore = Permissions.beastLore(player);
canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BEAST_LORE);
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
canEnvironmentallyAware = Permissions.environmentallyAware(player);
canFastFood = Permissions.fastFoodService(player);
canGore = Permissions.gore(player);
canSharpenedClaws = Permissions.sharpenedClaws(player);
canShockProof = Permissions.shockProof(player);
canThickFur = Permissions.thickFur(player);
canHolyHound = Permissions.holyHound(player);
canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ENVIROMENTALLY_AWARE);
canFastFood = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FAST_FOOD);
canGore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GORE);
canSharpenedClaws = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHARPENED_CLAWS);
canShockProof = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHOCK_PROOF);
canThickFur = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.THICK_FUR);
canHolyHound = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HOLY_HOUND);
}
@Override
@@ -90,9 +91,9 @@ public class TamingCommand extends SkillCommand {
if (canCallWild) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13")));
messages.add(LocaleLoader.getString("Taming.Effect.14", Config.getInstance().getTamingCOTWOcelotCost()));
messages.add(LocaleLoader.getString("Taming.Effect.15", Config.getInstance().getTamingCOTWWolfCost()));
messages.add(LocaleLoader.getString("Taming.Effect.20", Config.getInstance().getTamingCOTWHorseCost()));
messages.add(LocaleLoader.getString("Taming.Effect.14", Config.getInstance().getTamingCOTWCost(EntityType.OCELOT)));
messages.add(LocaleLoader.getString("Taming.Effect.15", Config.getInstance().getTamingCOTWCost(EntityType.WOLF)));
messages.add(LocaleLoader.getString("Taming.Effect.20", Config.getInstance().getTamingCOTWCost(EntityType.HORSE)));
}
return messages;

View File

@@ -5,6 +5,7 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.unarmed.Unarmed;
@@ -23,7 +24,7 @@ public class UnarmedCommand extends SkillCommand {
private boolean canBerserk;
private boolean canDisarm;
private boolean canBonusDamage;
private boolean canIronArm;
private boolean canDeflect;
private boolean canIronGrip;
@@ -42,26 +43,26 @@ public class UnarmedCommand extends SkillCommand {
// DISARM
if (canDisarm) {
String[] disarmStrings = calculateAbilityDisplayValues(skillValue, Unarmed.disarmMaxBonusLevel, Unarmed.disarmMaxChance, isLucky);
String[] disarmStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DISARM, isLucky);
disarmChance = disarmStrings[0];
disarmChanceLucky = disarmStrings[1];
}
// DEFLECT
if (canDeflect) {
String[] deflectStrings = calculateAbilityDisplayValues(skillValue, Unarmed.deflectMaxBonusLevel, Unarmed.deflectMaxChance, isLucky);
String[] deflectStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DEFLECT, isLucky);
deflectChance = deflectStrings[0];
deflectChanceLucky = deflectStrings[1];
}
// IRON ARM
if (canBonusDamage) {
ironArmBonus = Math.min(3 + ((int) skillValue / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
if (canIronArm) {
ironArmBonus = Math.min(Unarmed.ironArmMinBonusDamage + ((int) skillValue / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
}
// IRON GRIP
if (canIronGrip) {
String[] ironGripStrings = calculateAbilityDisplayValues(skillValue, Unarmed.ironGripMaxBonusLevel, Unarmed.ironGripMaxChance, isLucky);
String[] ironGripStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.IRON_GRIP, isLucky);
ironGripChance = ironGripStrings[0];
ironGripChanceLucky = ironGripStrings[1];
}
@@ -70,10 +71,11 @@ public class UnarmedCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canBerserk = Permissions.berserk(player);
canBonusDamage = Permissions.bonusDamage(player, skill);
canDeflect = Permissions.arrowDeflect(player);
canDisarm = Permissions.disarm(player);
canIronGrip = Permissions.ironGrip(player);
canIronArm = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.IRON_ARM);
canDeflect = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DEFLECT);
canDisarm = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DISARM);
canIronGrip = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.IRON_GRIP);
// TODO: Apparently we forgot about block cracker?
}
@Override
@@ -83,12 +85,13 @@ public class UnarmedCommand extends SkillCommand {
if (canBerserk) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.0"), LocaleLoader.getString("Unarmed.Effect.1")));
}
// TODO: Apparently we forgot about block cracker?
if (canDisarm) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.2"), LocaleLoader.getString("Unarmed.Effect.3")));
}
if (canBonusDamage) {
if (canIronArm) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.4"), LocaleLoader.getString("Unarmed.Effect.5")));
}
@@ -107,7 +110,7 @@ public class UnarmedCommand extends SkillCommand {
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();
if (canBonusDamage) {
if (canIronArm) {
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus)));
}

View File

@@ -6,9 +6,9 @@ import java.util.List;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.woodcutting.Woodcutting;
import com.gmail.nossr50.util.Permissions;
public class WoodcuttingCommand extends SkillCommand {
@@ -36,7 +36,7 @@ public class WoodcuttingCommand extends SkillCommand {
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, Woodcutting.doubleDropsMaxLevel, Woodcutting.doubleDropsMaxChance, isLucky);
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS, isLucky);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
@@ -45,8 +45,8 @@ public class WoodcuttingCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canTreeFell = Permissions.treeFeller(player);
canDoubleDrop = Permissions.doubleDrops(player, skill) && !skill.getDoubleDropsDisabled();
canLeafBlow = Permissions.leafBlower(player);
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
canLeafBlow = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.LEAF_BLOWER);
}
@Override

View File

@@ -4,10 +4,15 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.fishing.Fishing;
import com.gmail.nossr50.skills.mining.BlastMining;
import com.gmail.nossr50.skills.repair.ArcaneForging;
import com.gmail.nossr50.skills.salvage.Salvage;
import com.gmail.nossr50.skills.smelting.Smelting;
import com.gmail.nossr50.util.StringUtils;
public class AdvancedConfig extends AutoUpdateConfigLoader {
private static AdvancedConfig instance;
@@ -40,11 +45,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
}
/* ACROBATICS */
if (getDodgeChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.DODGE) < 1) {
reason.add("Skills.Acrobatics.Dodge.ChanceMax should be at least 1!");
}
if (getDodgeMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.DODGE) < 1) {
reason.add("Skills.Acrobatics.Dodge.MaxBonusLevel should be at least 1!");
}
@@ -52,11 +57,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Acrobatics.Dodge.DamageModifier should be greater than 1!");
}
if (getRollChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.ROLL) < 1) {
reason.add("Skills.Acrobatics.Roll.ChanceMax should be at least 1!");
}
if (getRollMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.ROLL) < 1) {
reason.add("Skills.Acrobatics.Roll.MaxBonusLevel should be at least 1!");
}
@@ -64,11 +69,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Acrobatics.Roll.DamageThreshold should be at least 0!");
}
if (getGracefulRollChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.GRACEFUL_ROLL) < 1) {
reason.add("Skills.Acrobatics.GracefulRoll.ChanceMax should be at least 1!");
}
if (getGracefulRollMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.GRACEFUL_ROLL) < 1) {
reason.add("Skills.Acrobatics.GracefulRoll.MaxBonusLevel should be at least 1!");
}
@@ -76,6 +81,38 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Acrobatics.GracefulRoll.DamageThreshold should be at least 0!");
}
/* ALCHEMY */
if (getCatalysisUnlockLevel() < 0) {
reason.add("Skills.Alchemy.Catalysis.UnlockLevel should be at least 0!");
}
if (getCatalysisMaxBonusLevel() <= getCatalysisUnlockLevel()) {
reason.add("Skills.Alchemy.Catalysis.MaxBonusLevel should be greater than Skills.Alchemy.Catalysis.UnlockLevel!");
}
if (getCatalysisMinSpeed() <= 0) {
reason.add("Skills.Alchemy.Catalysis.MinSpeed must be greater than 0!");
}
if (getCatalysisMaxSpeed() < getCatalysisMinSpeed()) {
reason.add("Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed!");
}
List<Alchemy.Tier> alchemyTierList = Arrays.asList(Alchemy.Tier.values());
for (Alchemy.Tier tier : alchemyTierList) {
if (getConcoctionsTierLevel(tier) < 0) {
reason.add("Skills.Alchemy.Rank_Levels.Rank_" + tier.toNumerical() + " should be at least 0!");
}
if (tier != Alchemy.Tier.fromNumerical(Alchemy.Tier.values().length)) {
Alchemy.Tier nextTier = alchemyTierList.get(alchemyTierList.indexOf(tier) - 1);
if (getConcoctionsTierLevel(tier) > getConcoctionsTierLevel(nextTier)) {
reason.add("Skills.Alchemy.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Alchemy.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
}
}
/* ARCHERY */
if (getSkillShotIncreaseLevel() < 1) {
reason.add("Skills.Archery.SkillShot.IncreaseLevel should be at least 1!");
@@ -89,11 +126,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Archery.SkillShot.MaxBonus should be at least 0!");
}
if (getDazeBonusMax() < 1) {
if (getMaxChance(SecondaryAbility.DAZE) < 1) {
reason.add("Skills.Acrobatics.Daze.ChanceMax should be at least 1!");
}
if (getDazeMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.DAZE) < 1) {
reason.add("Skills.Acrobatics.Daze.MaxBonusLevel should be at least 1!");
}
@@ -101,11 +138,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Acrobatics.Daze.BonusDamage should be at least 0!");
}
if (getRetrieveChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.RETRIEVE) < 1) {
reason.add("Skills.Acrobatics.Retrieve.ChanceMax should be at least 1!");
}
if (getRetrieveMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.RETRIEVE) < 1) {
reason.add("Skills.Acrobatics.Retrieve.MaxBonusLevel should be at least 1!");
}
@@ -114,28 +151,28 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
}
/* AXES */
if (getBonusDamageAxesBonusMax() < 1) {
reason.add("Skills.Axes.DamageIncrease.MaxBonus should be at least 1!");
if (getAxeMasteryBonusMax() < 1) {
reason.add("Skills.Axes.AxeMastery.MaxBonus should be at least 1!");
}
if (getBonusDamageAxesMaxBonusLevel() < 1) {
reason.add("Skills.Axes.DamageIncrease.MaxBonusLevel should be at least 1!");
if (getAxeMasteryMaxBonusLevel() < 1) {
reason.add("Skills.Axes.AxeMastery.MaxBonusLevel should be at least 1!");
}
if (getAxesCriticalChance() < 1) {
reason.add("Skills.Axes.AxesCritical.ChanceMax should be at least 1!");
if (getMaxChance(SecondaryAbility.CRITICAL_HIT) < 1) {
reason.add("Skills.Axes.CriticalHit.ChanceMax should be at least 1!");
}
if (getAxesCriticalMaxBonusLevel() < 1) {
reason.add("Skills.Axes.AxesCritical.MaxBonusLevel should be at least 1!");
if (getMaxBonusLevel(SecondaryAbility.CRITICAL_HIT) < 1) {
reason.add("Skills.Axes.CriticalHit.MaxBonusLevel should be at least 1!");
}
if (getAxesCriticalPVPModifier() < 1) {
reason.add("Skills.Axes.AxesCritical.PVP_Modifier should be at least 1!");
if (getCriticalHitPVPModifier() < 1) {
reason.add("Skills.Axes.CriticalHit.PVP_Modifier should be at least 1!");
}
if (getAxesCriticalPVEModifier() < 1) {
reason.add("Skills.Axes.AxesCritical.PVE_Modifier should be at least 1!");
if (getCriticalHitPVEModifier() < 1) {
reason.add("Skills.Axes.CriticalHit.PVE_Modifier should be at least 1!");
}
if (getGreaterImpactChance() < 1) {
@@ -185,8 +222,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != Fishing.Tier.EIGHT) {
Fishing.Tier nextTier = fishingTierList.get(fishingTierList.indexOf(tier) - 1);
if (getFishingTierLevel(tier) >= getFishingTierLevel(nextTier)) {
reason.add("Skills.Fishing.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Fishing.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
if (getFishingTierLevel(tier) > getFishingTierLevel(nextTier)) {
reason.add("Skills.Fishing.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Fishing.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
if (getShakeChance(tier) > getShakeChance(nextTier)) {
@@ -203,12 +240,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Fishing.FishermansDiet.RankChange should be at least 1!");
}
if (getIceFishingUnlockLevel() < 1) {
reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 1!");
if (getIceFishingUnlockLevel() < 0) {
reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 0!");
}
if (getMasterAnglerUnlockLevel() < 1) {
reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 1!");
if (getMasterAnglerUnlockLevel() < 0) {
reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 0!");
}
if (getMasterAnglerBoatModifier() < 1) {
@@ -228,44 +265,44 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Herbalism.GreenThumb.StageChange should be at least 1!");
}
if (getGreenThumbChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.GREEN_THUMB_PLANT) < 1) {
reason.add("Skills.Herbalism.GreenThumb.ChanceMax should be at least 1!");
}
if (getGreenThumbMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.GREEN_THUMB_PLANT) < 1) {
reason.add("Skills.Herbalism.GreenThumb.MaxBonusLevel should be at least 1!");
}
if (getHerbalismDoubleDropsChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.HERBALISM_DOUBLE_DROPS) < 1) {
reason.add("Skills.Herbalism.DoubleDrops.ChanceMax should be at least 1!");
}
if (getHerbalismDoubleDropsMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.HERBALISM_DOUBLE_DROPS) < 1) {
reason.add("Skills.Herbalism.DoubleDrops.MaxBonusLevel should be at least 1!");
}
if (getHylianLuckChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.HYLIAN_LUCK) < 1) {
reason.add("Skills.Herbalism.HylianLuck.ChanceMax should be at least 1!");
}
if (getHylianLuckMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.HYLIAN_LUCK) < 1) {
reason.add("Skills.Herbalism.HylianLuck.MaxBonusLevel should be at least 1!");
}
if (getShroomThumbChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.SHROOM_THUMB) < 1) {
reason.add("Skills.Herbalism.ShroomThumb.ChanceMax should be at least 1!");
}
if (getShroomThumbMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.SHROOM_THUMB) < 1) {
reason.add("Skills.Herbalism.ShroomThumb.MaxBonusLevel should be at least 1!");
}
/* MINING */
if (getMiningDoubleDropChance() < 1) {
if (getMaxChance(SecondaryAbility.MINING_DOUBLE_DROPS) < 1) {
reason.add("Skills.Mining.DoubleDrops.ChanceMax should be at least 1!");
}
if (getMiningDoubleDropMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.MINING_DOUBLE_DROPS) < 1) {
reason.add("Skills.Mining.DoubleDrops.MaxBonusLevel should be at least 1!");
}
@@ -299,8 +336,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != BlastMining.Tier.EIGHT) {
BlastMining.Tier nextTier = blastMiningTierList.get(blastMiningTierList.indexOf(tier) - 1);
if (getBlastMiningRankLevel(tier) >= getBlastMiningRankLevel(nextTier)) {
reason.add("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Mining.BlastMining.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
if (getBlastMiningRankLevel(tier) > getBlastMiningRankLevel(nextTier)) {
reason.add("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Mining.BlastMining.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
if (getBlastDamageDecrease(tier) > getBlastDamageDecrease(nextTier)) {
@@ -334,18 +371,14 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Repair.RepairMastery.MaxBonusLevel should be at least 1!");
}
if (getSuperRepairChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.SUPER_REPAIR) < 1) {
reason.add("Skills.Repair.SuperRepair.ChanceMax should be at least 1!");
}
if (getSuperRepairMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.SUPER_REPAIR) < 1) {
reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!");
}
if (getSalvageUnlockLevel() < 1) {
reason.add("Skills.Repair.Salvage.UnlockLevel should be at least 1!");
}
List<ArcaneForging.Tier> arcaneForgingTierList = Arrays.asList(ArcaneForging.Tier.values());
for (ArcaneForging.Tier tier : arcaneForgingTierList) {
@@ -364,8 +397,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != ArcaneForging.Tier.EIGHT) {
ArcaneForging.Tier nextTier = arcaneForgingTierList.get(arcaneForgingTierList.indexOf(tier) - 1);
if (getArcaneForgingRankLevel(tier) >= getArcaneForgingRankLevel(nextTier)) {
reason.add("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
if (getArcaneForgingRankLevel(tier) > getArcaneForgingRankLevel(nextTier)) {
reason.add("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
if (getArcaneForgingDowngradeChance(nextTier) > getArcaneForgingDowngradeChance(tier)) {
@@ -378,6 +411,51 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
}
}
/* SALVAGE */
if (getSalvageMaxPercentage() < 1) {
reason.add("Skills.Salvage.MaxPercentage should be at least 1!");
}
if (getSalvageMaxPercentageLevel() < 1) {
reason.add("Skills.Salvage.MaxPercentageLevel should be at least 1!");
}
if (getAdvancedSalvageUnlockLevel() < 1) {
reason.add("Skills.Salvage.AdvancedSalvage.UnlockLevel should be at least 1!");
}
List<Salvage.Tier> salvageTierList = Arrays.asList(Salvage.Tier.values());
for (Salvage.Tier tier : salvageTierList) {
if (getArcaneSalvageRankLevel(tier) < 0) {
reason.add("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + tier.toNumerical() + " should be at least 0!");
}
if (getArcaneSalvageExtractFullEnchantsChance(tier) < 0 || getArcaneSalvageExtractFullEnchantsChance(tier) > 100) {
reason.add("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + tier.toNumerical() + " only accepts values from 0 to 100!");
}
if (getArcaneSalvageExtractPartialEnchantsChance(tier) < 0 || getArcaneSalvageExtractPartialEnchantsChance(tier) > 100) {
reason.add("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + tier.toNumerical() + " only accepts values from 0 to 100!");
}
if (tier != Salvage.Tier.EIGHT) {
Salvage.Tier nextTier = salvageTierList.get(salvageTierList.indexOf(tier) - 1);
if (getArcaneSalvageRankLevel(tier) >= getArcaneSalvageRankLevel(nextTier)) {
reason.add("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
if (getArcaneSalvageExtractFullEnchantsChance(tier) > getArcaneSalvageExtractFullEnchantsChance(nextTier)) {
reason.add("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + nextTier.toNumerical() + "!");
}
if (getArcaneSalvageExtractPartialEnchantsChance(tier) > getArcaneSalvageExtractPartialEnchantsChance(nextTier)) {
reason.add("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + nextTier.toNumerical() + "!");
}
}
}
/* SMELTING */
if (getBurnModifierMaxLevel() < 1) {
reason.add("Skills.Smelting.FuelEfficiency.MaxBonusLevel should be at least 1!");
@@ -387,16 +465,16 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Smelting.FuelEfficiency.Multiplier should be at least 1!");
}
if (getSecondSmeltMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.SECOND_SMELT) < 1) {
reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!");
}
if (getSecondSmeltMaxChance() < 1) {
if (getMaxChance(SecondaryAbility.SECOND_SMELT) < 1) {
reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!");
}
if (getFluxMiningUnlockLevel() < 1) {
reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 1!");
if (getFluxMiningUnlockLevel() < 0) {
reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 0!");
}
if (getFluxMiningChance() < 1) {
@@ -417,22 +495,22 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != Smelting.Tier.EIGHT) {
Smelting.Tier nextTier = smeltingTierList.get(smeltingTierList.indexOf(tier) - 1);
if (getSmeltingRankLevel(tier) >= getSmeltingRankLevel(nextTier)) {
reason.add("Skills.Smelting.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Smelting.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
if (getSmeltingRankLevel(tier) > getSmeltingRankLevel(nextTier)) {
reason.add("Skills.Smelting.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Smelting.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
if (getSmeltingVanillaXPBoostMultiplier(tier) > getSmeltingRankLevel(nextTier)) {
if (getSmeltingVanillaXPBoostMultiplier(tier) > getSmeltingVanillaXPBoostMultiplier(nextTier)) {
reason.add("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Smelting.VanillaXPMultiplier.Rank_" + nextTier.toNumerical() + "!");
}
}
}
/* SWORDS */
if (getBleedChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.BLEED) < 1) {
reason.add("Skills.Swords.Bleed.ChanceMax should be at least 1!");
}
if (getBleedMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.BLEED) < 1) {
reason.add("Skills.Swords.Bleed.MaxBonusLevel should be at least 1!");
}
@@ -448,11 +526,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Swords.Bleed.BaseTicks should be at least 1!");
}
if (getCounterChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.COUNTER) < 1) {
reason.add("Skills.Swords.Counter.ChanceMax should be at least 1!");
}
if (getCounterMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.COUNTER) < 1) {
reason.add("Skills.Swords.Counter.MaxBonusLevel should be at least 1!");
}
@@ -470,11 +548,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
/* TAMING */
if (getGoreChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.GORE) < 1) {
reason.add("Skills.Taming.Gore.ChanceMax should be at least 1!");
}
if (getGoreMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.GORE) < 1) {
reason.add("Skills.Taming.Gore.MaxBonusLevel should be at least 1!");
}
@@ -486,40 +564,40 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Taming.Gore.Modifier should be at least 1!");
}
if (getFastFoodUnlock() < 1) {
reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 1!");
if (getFastFoodUnlock() < 0) {
reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 0!");
}
if (getFastFoodChance() < 1) {
reason.add("Skills.Taming.FastFood.Chance should be at least 1!");
}
if (getEnviromentallyAwareUnlock() < 1) {
reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 1!");
if (getEnviromentallyAwareUnlock() < 0) {
reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 0!");
}
if (getThickFurUnlock() < 1) {
reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 1!");
if (getThickFurUnlock() < 0) {
reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 0!");
}
if (getThickFurModifier() < 1) {
reason.add("Skills.Taming.ThickFur.Modifier should be at least 1!");
}
if (getHolyHoundUnlock() < 1) {
reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 1!");
if (getHolyHoundUnlock() < 0) {
reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 0!");
}
if (getShockProofUnlock() < 1) {
reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 1!");
if (getShockProofUnlock() < 0) {
reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 0!");
}
if (getShockProofModifier() < 1) {
reason.add("Skills.Taming.ShockProof.Modifier should be at least 1!");
}
if (getSharpenedClawsUnlock() < 1) {
reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 1!");
if (getSharpenedClawsUnlock() < 0) {
reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 0!");
}
if (getSharpenedClawsBonus() < 1) {
@@ -531,27 +609,27 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
}
/* UNARMED */
if (getDisarmChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.DISARM) < 1) {
reason.add("Skills.Unarmed.Disarm.ChanceMax should be at least 1!");
}
if (getDisarmMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.DISARM) < 1) {
reason.add("Skills.Unarmed.Disarm.MaxBonusLevel should be at least 1!");
}
if (getDeflectChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.DEFLECT) < 1) {
reason.add("Skills.Unarmed.Deflect.ChanceMax should be at least 1!");
}
if (getDeflectMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.DEFLECT) < 1) {
reason.add("Skills.Unarmed.Deflect.MaxBonusLevel should be at least 1!");
}
if (getIronGripChanceMax() < 1) {
if (getMaxChance(SecondaryAbility.IRON_GRIP) < 1) {
reason.add("Skills.Unarmed.IronGrip.ChanceMax should be at least 1!");
}
if (getIronGripMaxBonusLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.IRON_GRIP) < 1) {
reason.add("Skills.Unarmed.IronGrip.MaxBonusLevel should be at least 1!");
}
@@ -572,15 +650,15 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
}
/* WOODCUTTING */
if (getLeafBlowUnlockLevel() < 1) {
reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 1!");
if (getLeafBlowUnlockLevel() < 0) {
reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 0!");
}
if (getWoodcuttingDoubleDropChance() < 1) {
if (getMaxChance(SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) < 1) {
reason.add("Skills.Woodcutting.DoubleDrops.ChanceMax should be at least 1!");
}
if (getWoodcuttingDoubleDropMaxLevel() < 1) {
if (getMaxBonusLevel(SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) < 1) {
reason.add("Skills.Woodcutting.DoubleDrops.MaxBonusLevel should be at least 1!");
}
@@ -611,42 +689,41 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getAbilityLength() { return config.getInt("Skills.General.Ability.IncreaseLevel", 50); }
public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); }
public int getMaxBonusLevel(SecondaryAbility skillAbility) { return config.getInt("Skills." + StringUtils.getCapitalized(SkillType.bySecondaryAbility(skillAbility).toString()) + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace(" ", "") + ".MaxBonusLevel"); }
public double getMaxChance(SecondaryAbility skillAbility) { return config.getDouble("Skills." + StringUtils.getCapitalized(SkillType.bySecondaryAbility(skillAbility).toString()) + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace(" ", "") + ".ChanceMax", 100.0D); }
/* ACROBATICS */
public double getDodgeChanceMax() { return config.getDouble("Skills.Acrobatics.Dodge.ChanceMax", 20.0D); }
public int getDodgeMaxBonusLevel() { return config.getInt("Skills.Acrobatics.Dodge.MaxBonusLevel", 800); }
public double getDodgeDamageModifier() { return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); }
public double getRollChanceMax() { return config.getDouble("Skills.Acrobatics.Roll.ChanceMax", 100.0D); }
public int getRollMaxBonusLevel() { return config.getInt("Skills.Acrobatics.Roll.MaxBonusLevel", 1000); }
public double getRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); }
public double getGracefulRollChanceMax() { return config.getDouble("Skills.Acrobatics.GracefulRoll.ChanceMax", 100.0D); }
public int getGracefulRollMaxBonusLevel() { return config.getInt("Skills.Acrobatics.GracefulRoll.MaxBonusLevel", 500); }
public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); }
/* ALCHEMY */
public int getCatalysisUnlockLevel() { return config.getInt("Skills.Alchemy.Catalysis.UnlockLevel", 100); }
public int getCatalysisMaxBonusLevel() { return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); }
public double getCatalysisMinSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); }
public double getCatalysisMaxSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); }
public int getConcoctionsTierLevel(Alchemy.Tier tier) { return config.getInt("Skills.Alchemy.Rank_Levels.Rank_" + tier.toNumerical()); }
/* ARCHERY */
public int getSkillShotIncreaseLevel() { return config.getInt("Skills.Archery.SkillShot.IncreaseLevel", 50); }
public double getSkillShotIncreasePercentage() { return config.getDouble("Skills.Archery.SkillShot.IncreasePercentage", 0.1D); }
public double getSkillShotBonusMax() { return config.getDouble("Skills.Archery.SkillShot.MaxBonus", 2.0D); }
public double getSkillShotDamageMax() { return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); }
public double getDazeBonusMax() { return config.getDouble("Skills.Archery.Daze.ChanceMax", 50.0D); }
public int getDazeMaxBonusLevel() { return config.getInt("Skills.Archery.Daze.MaxBonusLevel", 1000); }
public double getDazeModifier() { return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); }
public double getRetrieveChanceMax() { return config.getDouble("Skills.Archery.Retrieve.ChanceMax", 100.0D); }
public int getRetrieveMaxBonusLevel() { return config.getInt("Skills.Archery.Retrieve.MaxBonusLevel", 1000); }
public double getForceMultiplier() { return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); }
/* AXES */
public double getBonusDamageAxesBonusMax() { return config.getDouble("Skills.Axes.DamageIncrease.MaxBonus", 4.0D); }
public int getBonusDamageAxesMaxBonusLevel() { return config.getInt("Skills.Axes.DamageIncrease.MaxBonusLevel", 200); }
public double getAxeMasteryBonusMax() { return config.getDouble("Skills.Axes.AxeMastery.MaxBonus", 4.0D); }
public int getAxeMasteryMaxBonusLevel() { return config.getInt("Skills.Axes.AxeMastery.MaxBonusLevel", 200); }
public double getAxesCriticalChance() { return config.getDouble("Skills.Axes.AxesCritical.ChanceMax", 37.50D); }
public int getAxesCriticalMaxBonusLevel() { return config.getInt("Skills.Axes.AxesCritical.MaxBonusLevel", 750); }
public double getAxesCriticalPVPModifier() { return config.getDouble("Skills.Axes.AxesCritical.PVP_Modifier", 1.5D); }
public double getAxesCriticalPVEModifier() { return config.getDouble("Skills.Axes.AxesCritical.PVE_Modifier", 2.0D); }
public double getCriticalHitPVPModifier() { return config.getDouble("Skills.Axes.CriticalHit.PVP_Modifier", 1.5D); }
public double getCriticalHitPVEModifier() { return config.getDouble("Skills.Axes.CriticalHit.PVE_Modifier", 2.0D); }
public double getGreaterImpactChance() { return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); }
public double getGreaterImpactModifier() { return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); }
@@ -678,22 +755,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); }
public int getGreenThumbStageChange() { return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); }
public double getGreenThumbChanceMax() { return config.getDouble("Skills.Herbalism.GreenThumb.ChanceMax", 100.0D); }
public int getGreenThumbMaxLevel() { return config.getInt("Skills.Herbalism.GreenThumb.MaxBonusLevel", 1500); }
public double getHerbalismDoubleDropsChanceMax() { return config.getDouble("Skills.Herbalism.DoubleDrops.ChanceMax", 100.0D); }
public int getHerbalismDoubleDropsMaxLevel() { return config.getInt("Skills.Herbalism.DoubleDrops.MaxBonusLevel", 1000); }
public double getHylianLuckChanceMax() { return config.getDouble("Skills.Herbalism.HylianLuck.ChanceMax", 10.0D); }
public int getHylianLuckMaxLevel() { return config.getInt("Skills.Herbalism.HylianLuck.MaxBonusLevel", 1000); }
public double getShroomThumbChanceMax() { return config.getDouble("Skills.Herbalism.ShroomThumb.ChanceMax", 50.0D); }
public int getShroomThumbMaxLevel() { return config.getInt("Skills.Herbalism.ShroomThumb.MaxBonusLevel", 1500); }
/* MINING */
public double getMiningDoubleDropChance() { return config.getDouble("Skills.Mining.DoubleDrops.ChanceMax", 100.0D); }
public int getMiningDoubleDropMaxLevel() { return config.getInt("Skills.Mining.DoubleDrops.MaxBonusLevel", 1000); }
public int getBlastMiningRankLevel(BlastMining.Tier tier) { return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical()); }
public double getBlastDamageDecrease(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + tier.toNumerical()); }
public double getOreBonus(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + tier.toNumerical()); }
@@ -704,9 +767,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
/* REPAIR */
public double getRepairMasteryMaxBonus() { return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); }
public int getRepairMasteryMaxLevel() { return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 1000); }
public double getSuperRepairChanceMax() { return config.getDouble("Skills.Repair.SuperRepair.ChanceMax", 100.0D); }
public int getSuperRepairMaxLevel() { return config.getInt("Skills.Repair.SuperRepair.MaxBonusLevel", 1000); }
public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage.UnlockLevel", 600); }
/* Arcane Forging */
public int getArcaneForgingRankLevel(ArcaneForging.Tier tier) { return config.getInt("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + tier.toNumerical()); }
@@ -717,13 +777,23 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true); }
public double getArcaneForgingDowngradeChance(ArcaneForging.Tier tier) { return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + tier.toNumerical()); }
/* SALVAGE */
public double getSalvageMaxPercentage() { return config.getDouble("Skills.Salvage.MaxPercentage", 100.0D); }
public int getSalvageMaxPercentageLevel() { return config.getInt("Skills.Salvage.MaxPercentageLevel", 1000); }
public int getAdvancedSalvageUnlockLevel() { return config.getInt("Skills.Salvage.AdvancedSalvage.UnlockLevel", 350); }
public boolean getArcaneSalvageEnchantDowngradeEnabled() { return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true); }
public boolean getArcaneSalvageEnchantLossEnabled() { return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true); }
public int getArcaneSalvageRankLevel(Salvage.Tier tier) { return config.getInt("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + tier.toNumerical()); }
public double getArcaneSalvageExtractFullEnchantsChance(Salvage.Tier tier) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + tier.toNumerical()); }
public double getArcaneSalvageExtractPartialEnchantsChance(Salvage.Tier tier) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + tier.toNumerical()); }
/* SMELTING */
public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 1000); }
public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); }
public int getSecondSmeltMaxLevel() { return config.getInt("Skills.Smelting.SecondSmelt.MaxBonusLevel", 1000); }
public double getSecondSmeltMaxChance() { return config.getDouble("Skills.Smelting.SecondSmelt.ChanceMax", 100.0D); }
public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }
public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); }
@@ -732,22 +802,16 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
/* SWORDS */
public double getBleedChanceMax() { return config.getDouble("Skills.Swords.Bleed.ChanceMax", 75.0D); }
public int getBleedMaxBonusLevel() { return config.getInt("Skills.Swords.Bleed.MaxBonusLevel", 750); }
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }
public boolean getCounterRequiresBlock() { return config.getBoolean("Skills.Swords.Counter.RequiresBlock"); }
public double getCounterChanceMax() { return config.getDouble("Skills.Swords.Counter.ChanceMax", 30.0D); }
public int getCounterMaxBonusLevel() { return config.getInt("Skills.Swords.Counter.MaxBonusLevel", 600); }
public double getCounterModifier() { return config.getDouble("Skills.Swords.Counter.DamageModifier", 2.0D); }
public double getSerratedStrikesModifier() { return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); }
public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes.BleedTicks", 5); }
/* TAMING */
public double getGoreChanceMax() { return config.getDouble("Skills.Taming.Gore.ChanceMax", 100.0D); }
public int getGoreMaxBonusLevel() { return config.getInt("Skills.Taming.Gore.MaxBonusLevel", 1000); }
public int getGoreBleedTicks() { return config.getInt("Skills.Taming.Gore.BleedTicks", 2); }
public double getGoreModifier() { return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); }
@@ -767,28 +831,18 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getSharpenedClawsUnlock() { return config.getInt("Skills.Taming.SharpenedClaws.UnlockLevel", 750); }
public double getSharpenedClawsBonus() { return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D); }
public double getMinHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D); }
public double getMaxHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); }
/* UNARMED */
public double getDisarmChanceMax() { return config.getDouble("Skills.Unarmed.Disarm.ChanceMax", 33.0D); }
public int getDisarmMaxBonusLevel() { return config.getInt("Skills.Unarmed.Disarm.MaxBonusLevel", 1000); }
public double getDeflectChanceMax() { return config.getDouble("Skills.Unarmed.Deflect.ChanceMax", 50.0D); }
public int getDeflectMaxBonusLevel() { return config.getInt("Skills.Unarmed.Deflect.MaxBonusLevel", 1000); }
public double getIronGripChanceMax() { return config.getDouble("Skills.Unarmed.IronGrip.ChanceMax", 100.0D); }
public int getIronGripMaxBonusLevel() { return config.getInt("Skills.Unarmed.IronGrip.MaxBonusLevel", 1000); }
public double getIronArmMinBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMin", 3.0D); }
public double getIronArmMaxBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMax", 8.0D); }
public int getIronArmIncreaseLevel() { return config.getInt("Skills.Unarmed.IronArm.IncreaseLevel", 50); }
public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); }
/* WOODCUTTING */
public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }
public double getWoodcuttingDoubleDropChance() { return config.getDouble("Skills.Woodcutting.DoubleDrops.ChanceMax", 100.0D); }
public int getWoodcuttingDoubleDropMaxLevel() { return config.getInt("Skills.Woodcutting.DoubleDrops.MaxBonusLevel", 1000); }
/* KRAKEN STUFF */
public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); }
public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); }

View File

@@ -5,10 +5,12 @@ import java.util.List;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.TreeSpecies;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.StringUtils;
@@ -109,7 +111,7 @@ public class Config extends AutoUpdateConfigLoader {
}
if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) {
reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 64!");
reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 9!");
}
if (getChimaeraItem() == null) {
@@ -146,6 +148,16 @@ public class Config extends AutoUpdateConfigLoader {
reason.add("Party.Sharing.Range should be greater than 0!");
}
if (getPartyXpCurveMultiplier() < 1) {
reason.add("Party.Leveling.Xp_Curve_Modifier should be at least 1!");
}
for (PartyFeature partyFeature : PartyFeature.values()) {
if (getPartyFeatureUnlockLevel(partyFeature) < 0) {
reason.add("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!");
}
}
/* Inspect command distance */
if (getInspectDistance() <= 0) {
reason.add("Commands.inspect.Max_Distance should be greater than 0!");
@@ -171,20 +183,40 @@ public class Config extends AutoUpdateConfigLoader {
reason.add("Cannot use the same item for Repair and Salvage anvils!");
}
if (getTamingCOTWWolfCost() < 1) {
reason.add("Skills.Taming.Call_Of_The_Wild.Bones_Required should be at least 1!");
if (getTamingCOTWMaterial(EntityType.WOLF) == null) {
reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Material is invalid!!");
}
if (getTamingCOTWOcelotCost() < 1) {
reason.add("Skills.Taming.Call_Of_The_Wild.Fish_Required should be at least 1!");
if (getTamingCOTWMaterial(EntityType.OCELOT) == null) {
reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Material is invalid!!");
}
if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot_Amount should be greater than 0!");
if (getTamingCOTWMaterial(EntityType.HORSE) == null) {
reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Material is invalid!!");
}
if (getTamingCOTWCost(EntityType.WOLF) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Amount should be greater than 0!");
}
if (getTamingCOTWCost(EntityType.OCELOT) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Amount should be greater than 0!");
}
if (getTamingCOTWCost(EntityType.HORSE) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Amount should be greater than 0!");
}
if (getTamingCOTWAmount(EntityType.WOLF) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Wolf_Amount should be greater than 0!");
reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Summon_Amount should be greater than 0!");
}
if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Summon_Amount should be greater than 0!");
}
if (getTamingCOTWAmount(EntityType.HORSE) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Summon_Amount should be greater than 0!");
}
return noErrorsInConfig(reason);
@@ -207,16 +239,17 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); }
public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); }
public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); }
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.partychat.Use_Display_Names", true); }
public String getPartyChatPrefixAlly() { return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); }
public String getAdminChatPrefix() { return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.adminchat.Use_Display_Names", true); }
public boolean getMatchOfflinePlayers() { return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); }
public long getDatabasePlayerCooldown() { return config.getLong("Commands.Database.Player_Cooldown", 1750); }
public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); }
@@ -233,6 +266,11 @@ public class Config extends AutoUpdateConfigLoader {
public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); }
/* Scoreboards */
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); }
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
public boolean getRankUseChat() { return config.getBoolean("Scoreboard.Types.Rank.Print", false); }
public boolean getRankUseBoard() { return config.getBoolean("Scoreboard.Types.Rank.Board", true); }
public int getRankScoreboardTime() { return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); }
@@ -258,11 +296,6 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getSkillLevelUpBoard() { return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); }
public int getSkillLevelUpTime() { return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); }
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
/* Database Purging */
public int getPurgeInterval() { return config.getInt("Database_Purging.Purge_Interval", -1); }
public int getOldUsersCutoff() { return config.getInt("Database_Purging.Old_User_Cutoff", 6); }
@@ -302,12 +335,16 @@ public class Config extends AutoUpdateConfigLoader {
public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); }
public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); }
public int getHardcoreDeathStatPenaltyLevelThreshold() { return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); }
public boolean getHardcoreVampirismEnabled(SkillType skillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), false); }
public void setHardcoreVampirismEnabled(SkillType skillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), enabled); }
public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); }
public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); }
public int getHardcoreVampirismLevelThreshold() { return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); }
/* SMP Mods */
public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Armor_Mods_Enabled", false); }
@@ -338,19 +375,29 @@ public class Config extends AutoUpdateConfigLoader {
/* PARTY SETTINGS */
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
public boolean getExpShareEnabled() { return config.getBoolean("Party.Sharing.ExpShare_enabled", true); }
public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); }
public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); }
public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); }
public boolean getItemShareEnabled() { return config.getBoolean("Party.Sharing.ItemShare_enabled", true); }
public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0D); }
public int getPartyLevelCap() {
int cap = config.getInt("Party.Leveling.Level_Cap", 10);
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
public int getPartyXpCurveMultiplier() { return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); }
public boolean getPartyXpNearMembersNeeded() { return config.getBoolean("Party.Leveling.Near_Members_Needed", false); }
public boolean getPartyInformAllMembers() { return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); }
public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); }
/* Party Teleport Settings */
public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); }
public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); }
public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); }
public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Accept_Required", true); }
public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); }
/* Inspect command distance */
@@ -397,10 +444,17 @@ public class Config extends AutoUpdateConfigLoader {
/* Acrobatics */
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
public boolean getPreventXPAfterTeleport() { return config.getBoolean("Skills.Acrobatics.Prevent_XP_After_Teleport", true); }
public int getXPAfterTeleportCooldown() { return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); }
/* Alchemy */
public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); }
public boolean getPreventHopperTransferIngredients() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); }
public boolean getPreventHopperTransferBottles() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); }
/* Fishing */
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); }
public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); }
/* Mining */
public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); }
@@ -410,26 +464,26 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getRepairAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); }
public boolean getRepairAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); }
public Material getRepairAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); }
public Material getSalvageAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Repair.Salvage_Anvil_Material", "GOLD_BLOCK")); }
public boolean getSalvageTools() { return config.getBoolean("Skills.Repair.Salvage_tools", true); }
public boolean getSalvageArmor() { return config.getBoolean("Skills.Repair.Salvage_armor", true); }
public boolean getRepairConfirmRequired() { return config.getBoolean("Skills.Repair.Confirm_Required", true); }
/* Salvage */
public boolean getSalvageAnvilMessagesEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Messages", true); }
public boolean getSalvageAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); }
public boolean getSalvageAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); }
public Material getSalvageAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); }
public boolean getSalvageConfirmRequired() { return config.getBoolean("Skills.Salvage.Confirm_Required", true); }
/* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
/* Taming */
public int getTamingCOTWHorseCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Apples_Required", 10); }
public int getTamingCOTWWolfCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10); }
public int getTamingCOTWOcelotCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Fish_Required", 10); }
public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); }
public int getTamingCOTWCost(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); }
public int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); }
public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); }
public int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ "_Amount"); }
/* Woodcutting */
public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); }
public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); }
public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); }
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
public boolean getWoodcuttingDoubleDropsEnabled(TreeSpecies species) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); }
public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); }
/* AFK Leveling */

View File

@@ -4,12 +4,16 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.TreeSpecies;
import org.bukkit.entity.EntityType;
import org.bukkit.material.LongGrass;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.config.AutoUpdateConfigLoader;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.skills.repair.repairables.RepairMaterialType;
import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage;
import com.gmail.nossr50.util.StringUtils;
public class ExperienceConfig extends AutoUpdateConfigLoader {
@@ -76,6 +80,13 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
* XP SETTINGS
*/
/* Alchemy */
for (PotionStage potionStage : PotionStage.values()) {
if (getPotionXP(potionStage) < 0) {
reason.add("Experience.Alchemy.Potion_Stage_" + potionStage.toNumerical() + " should be at least 0!");
}
}
/* Combat XP Multipliers */
if (getAnimalsXP() < 0) {
reason.add("Experience.Combat.Multiplier.Animals should be at least 0!");
@@ -98,9 +109,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
}
/* Fishing */
if (getFishingBaseXP() <= 0) {
reason.add("Experience.Fishing.Base should be greater than 0!");
}
// TODO: Add validation for each fish type once enum is available.
if (getFishingShakeXP() <= 0) {
reason.add("Experience.Fishing.Shake should be greater than 0!");
@@ -121,20 +130,12 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
}
/* Woodcutting */
if (getWoodcuttingXPOak() <= 0) {
reason.add("Experience.Woodcutting.Oak should be greater than 0!");
}
for (TreeSpecies species : TreeSpecies.values()) {
String key = "Experience.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_");
if (getWoodcuttingXPBirch() <= 0) {
reason.add("Experience.Woodcutting.Birch should be greater than 0!");
}
if (getWoodcuttingXPSpruce() <= 0) {
reason.add("Experience.Woodcutting.Spruce should be greater than 0!");
}
if (getWoodcuttingXPJungle() <= 0) {
reason.add("Experience.Woodcutting.Jungle should be greater than 0!");
if (config.getInt(key) <= 0) {
reason.add(key + " should be greater than 0!");
}
}
if (getWoodcuttingXPHugeBrownMushroom() <= 0) {
@@ -159,7 +160,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Curve values */
public double getMultiplier(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); }
public int getBase(FormulaType type) { return config.getInt("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); }
public double getExponent(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) +"_Values.exponent"); }
public double getExponent(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); }
/* Global modifier */
public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience_Formula.Multiplier.Global", 1.0); }
@@ -174,6 +175,9 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Skill modifiers */
public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); }
/* Custom XP perk */
public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); }
/* Conversion */
public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); }
@@ -199,13 +203,115 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public double getFeatherFallXPModifier() { return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); }
/* Alchemy */
public double getPotionXP(PotionStage stage) { return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); }
/* Fishing */
public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
public int getFishXp(MaterialData data) {
switch (data.getData()) {
case 0x0:
return config.getInt("Experience.Fishing.Raw_Fish", 800);
case 0x1:
return config.getInt("Experience.Fishing.Raw_Salmon", 800);
case 0x2:
return config.getInt("Experience.Fishing.Clownfish", 800);
case 0x3:
return config.getInt("Experience.Fishing.Pufferfish", 800);
default:
return 0;
}
}
public int getFishingShakeXP() { return config.getInt("Experience.Fishing.Shake", 50); }
/* Herbalism */
public int getFlowerAndGrassXp(MaterialData data) {
Material type = data.getItemType();
if (type == Material.RED_ROSE) {
switch (data.getData()) {
case 0x0:
return config.getInt("Experience.Herbalism.Poppy", 100);
case 0x1:
return config.getInt("Experience.Herbalism.Blue_Orchid", 150);
case 0x2:
return config.getInt("Experience.Herbalism.Allium", 300);
case 0x3:
return config.getInt("Experience.Herbalism.Azure_Bluet", 150);
case 0x4:
return config.getInt("Experience.Herbalism.Red_Tulip", 150);
case 0x5:
return config.getInt("Experience.Herbalism.Orange_Tulip", 150);
case 0x6:
return config.getInt("Experience.Herbalism.White_Tulip", 150);
case 0x7:
return config.getInt("Experience.Herbalism.Pink_Tulip", 150);
case 0x8:
return config.getInt("Experience.Herbalism.Oxeye_Daisy", 150);
default:
return 0;
}
}
else if (type == Material.LONG_GRASS) {
switch (((LongGrass) data).getSpecies()) {
case DEAD:
return config.getInt("Experience.Herbalism.Dead_Bush", 30);
case FERN_LIKE:
return config.getInt("Experience.Herbalism.Small_Fern", 10);
case NORMAL:
return config.getInt("Experience.Herbalism.Small_Grass", 10);
default:
return 0;
}
}
else if (type == Material.DOUBLE_PLANT) {
switch (data.getData()) {
case 0x0:
return config.getInt("Experience.Herbalism.Sunflower", 50);
case 0x1:
return config.getInt("Experience.Herbalism.Lilac", 50);
case 0x2:
return config.getInt("Experience.Herbalism.Tall_Grass", 50);
case 0x3:
return config.getInt("Experience.Herbalism.Tall_Fern", 50);
case 0x4:
return config.getInt("Experience.Herbalism.Rose_Bush", 50);
case 0x5:
return config.getInt("Experience.Herbalism.Peony", 50);
default:
return 0;
}
}
return 0;
}
/* Repair */
public double getRepairXPBase() { return config.getDouble("Experience.Repair.Base", 1000.0); }
public double getRepairXP(RepairMaterialType repairMaterialType) { return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); }
public double getRepairXP(MaterialType repairMaterialType) { return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); }
/* Taming */
public int getTamingXPHorse() { return config.getInt("Experience.Taming.Animal_Taming.Horse", 1000); }
@@ -213,10 +319,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public int getTamingXPOcelot() { return config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500); }
/* Woodcutting */
public int getWoodcuttingXPOak() { return config.getInt("Experience.Woodcutting.Oak", 70); }
public int getWoodcuttingXPBirch() { return config.getInt("Experience.Woodcutting.Birch", 90); }
public int getWoodcuttingXPSpruce() { return config.getInt("Experience.Woodcutting.Spruce", 80); }
public int getWoodcuttingXPJungle() { return config.getInt("Experience.Woodcutting.Jungle", 100); }
public int getWoodcuttingTreeXP(TreeSpecies species) { return config.getInt("Experience.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); }
public int getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
}

View File

@@ -0,0 +1,35 @@
package com.gmail.nossr50.config.mods;
import java.io.File;
import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class ArmorConfigManager {
public ArmorConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml");
File dataFolder = new File(mcMMO.getModDirectory());
File vanilla = new File(dataFolder, "armor.default.yml");
ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) {
plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "armor.default.yml", false);
}
for (String fileName : dataFolder.list()) {
if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
continue;
}
File file = new File(dataFolder, fileName);
if (file.isDirectory()) {
continue;
}
modManager.registerCustomArmor(new CustomArmorConfig(fileName));
}
}
}

View File

@@ -0,0 +1,35 @@
package com.gmail.nossr50.config.mods;
import java.io.File;
import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class BlockConfigManager {
public BlockConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml");
File dataFolder = new File(mcMMO.getModDirectory());
File vanilla = new File(dataFolder, "blocks.default.yml");
ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) {
plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "blocks.default.yml", false);
}
for (String fileName : dataFolder.list()) {
if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
continue;
}
File file = new File(dataFolder, fileName);
if (file.isDirectory()) {
continue;
}
modManager.registerCustomBlocks(new CustomBlockConfig(fileName));
}
}
}

View File

@@ -9,49 +9,29 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.skills.repair.Repair;
import com.gmail.nossr50.skills.repair.repairables.RepairItemType;
import com.gmail.nossr50.skills.repair.repairables.RepairMaterialType;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import com.gmail.nossr50.util.skills.SkillUtils;
public class CustomArmorConfig extends ConfigLoader {
private static CustomArmorConfig instance;
private boolean needsUpdate = false;
private List<Repairable> repairables;
public List<Material> customBoots = new ArrayList<Material>();
public List<Material> customChestplates = new ArrayList<Material>();
public List<Material> customHelmets = new ArrayList<Material>();
public List<Material> customLeggings = new ArrayList<Material>();
private List<Material> customBoots = new ArrayList<Material>();
private List<Material> customChestplates = new ArrayList<Material>();
private List<Material> customHelmets = new ArrayList<Material>();
private List<Material> customLeggings = new ArrayList<Material>();
public List<Repairable> repairables = new ArrayList<Repairable>();
public CustomArmorConfig() {
super("mods", "armor.yml");
protected CustomArmorConfig(String fileName) {
super("mods", fileName);
loadKeys();
}
public static CustomArmorConfig getInstance() {
if (instance == null) {
instance = new CustomArmorConfig();
}
return instance;
}
public List<Repairable> getLoadedRepairables() {
if (repairables == null) {
return new ArrayList<Repairable>();
}
return repairables;
}
@Override
protected void loadKeys() {
repairables = new ArrayList<Repairable>();
loadArmor("Boots", customBoots);
loadArmor("Chestplates", customChestplates);
loadArmor("Helmets", customHelmets);
@@ -99,7 +79,7 @@ public class CustomArmorConfig extends ConfigLoader {
if (repairable) {
byte repairData = (byte) config.getInt(armorType + "." + armorName + ".Repair_Material_Data_Value", -1);
int repairQuantity = Repair.getRepairAndSalvageQuantities(new ItemStack(armorMaterial), repairMaterial, repairData);
int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(armorMaterial), repairMaterial, repairData);
if (repairQuantity == 0) {
repairQuantity = config.getInt(armorType + "." + armorName + ".Repair_Material_Data_Quantity", 2);
@@ -111,26 +91,10 @@ public class CustomArmorConfig extends ConfigLoader {
durability = (short) config.getInt(armorType + "." + armorName + ".Durability", 70);
}
repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairData, 0, repairQuantity, durability, RepairItemType.ARMOR, RepairMaterialType.OTHER, 1.0));
repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairData, 0, repairQuantity, durability, ItemType.ARMOR, MaterialType.OTHER, 1.0));
}
materialList.add(armorMaterial);
}
}
public boolean isCustomBoots(Material material) {
return customBoots.contains(material);
}
public boolean isCustomChestplate(Material material) {
return customChestplates.contains(material);
}
public boolean isCustomHelmet(Material material) {
return customHelmets.contains(material);
}
public boolean isCustomLeggings(Material material) {
return customLeggings.contains(material);
}
}

View File

@@ -13,40 +13,29 @@ import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
public class CustomBlockConfig extends ConfigLoader {
private static CustomBlockConfig instance;
private boolean needsUpdate = false;
private List<MaterialData> customExcavationBlocks = new ArrayList<MaterialData>();
private List<MaterialData> customHerbalismBlocks = new ArrayList<MaterialData>();
private List<MaterialData> customMiningBlocks = new ArrayList<MaterialData>();
private List<MaterialData> customWoodcuttingBlocks = new ArrayList<MaterialData>();
private List<MaterialData> customOres = new ArrayList<MaterialData>();
private List<MaterialData> customLogs = new ArrayList<MaterialData>();
private List<MaterialData> customLeaves = new ArrayList<MaterialData>();
private List<MaterialData> customAbilityBlocks = new ArrayList<MaterialData>();
public List<MaterialData> customExcavationBlocks = new ArrayList<MaterialData>();
public List<MaterialData> customHerbalismBlocks = new ArrayList<MaterialData>();
public List<MaterialData> customMiningBlocks = new ArrayList<MaterialData>();
public List<MaterialData> customOres = new ArrayList<MaterialData>();
public List<MaterialData> customLogs = new ArrayList<MaterialData>();
public List<MaterialData> customLeaves = new ArrayList<MaterialData>();
public List<MaterialData> customAbilityBlocks = new ArrayList<MaterialData>();
private HashMap<MaterialData, CustomBlock> customBlockMap = new HashMap<MaterialData, CustomBlock>();
public HashMap<MaterialData, CustomBlock> customBlockMap = new HashMap<MaterialData, CustomBlock>();
public CustomBlockConfig() {
super("mods", "blocks.yml");
protected CustomBlockConfig(String fileName) {
super("mods", fileName);
loadKeys();
}
public static CustomBlockConfig getInstance() {
if (instance == null) {
instance = new CustomBlockConfig();
}
return instance;
}
@Override
protected void loadKeys() {
loadBlocks("Excavation", customExcavationBlocks);
loadBlocks("Herbalism", customHerbalismBlocks);
loadBlocks("Mining", customMiningBlocks);
loadBlocks("Woodcutting", customWoodcuttingBlocks);
loadBlocks("Woodcutting", null);
loadBlocks("Ability_Blocks", customAbilityBlocks);
if (needsUpdate) {
@@ -83,9 +72,12 @@ public class CustomBlockConfig extends ConfigLoader {
continue;
}
byte blockData = Byte.valueOf(blockInfo[1]);
byte blockData = (blockInfo.length == 2) ? Byte.valueOf(blockInfo[1]) : 0;
MaterialData blockMaterialData = new MaterialData(blockMaterial, blockData);
blockList.add(blockMaterialData);
if (blockList != null) {
blockList.add(blockMaterialData);
}
if (skillType.equals("Ability_Blocks")) {
continue;
@@ -111,40 +103,4 @@ public class CustomBlockConfig extends ConfigLoader {
customBlockMap.put(blockMaterialData, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp));
}
}
public CustomBlock getCustomBlock(MaterialData data) {
return customBlockMap.get(data);
}
public boolean isCustomOre(MaterialData data) {
return customOres.contains(data);
}
public boolean isCustomLog(MaterialData data) {
return customLogs.contains(data);
}
public boolean isCustomLeaf(MaterialData data) {
return customLeaves.contains(data);
}
public boolean isCustomAbilityBlock(MaterialData data) {
return customAbilityBlocks.contains(data);
}
public boolean isCustomExcavationBlock(MaterialData data) {
return customExcavationBlocks.contains(data);
}
public boolean isCustomHerbalismBlock(MaterialData data) {
return customHerbalismBlocks.contains(data);
}
public boolean isCustomMiningBlock(MaterialData data) {
return customMiningBlocks.contains(data);
}
public boolean isCustomWoodcuttingBlock(MaterialData data) {
return customWoodcuttingBlocks.contains(data);
}
}

View File

@@ -3,7 +3,6 @@ package com.gmail.nossr50.config.mods;
import java.util.HashMap;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.config.ConfigLoader;
@@ -12,24 +11,14 @@ import com.gmail.nossr50.datatypes.mods.CustomEntity;
import org.apache.commons.lang.ClassUtils;
public class CustomEntityConfig extends ConfigLoader {
private static CustomEntityConfig instance;
public HashMap<String, CustomEntity> customEntityClassMap = new HashMap<String, CustomEntity>();
public HashMap<String, CustomEntity> customEntityTypeMap = new HashMap<String, CustomEntity>();
private HashMap<String, CustomEntity> customEntityClassMap = new HashMap<String, CustomEntity>();
private HashMap<String, CustomEntity> customEntityTypeMap = new HashMap<String, CustomEntity>();
public CustomEntityConfig() {
super("mods", "entities.yml");
protected CustomEntityConfig(String fileName) {
super("mods", fileName);
loadKeys();
}
public static CustomEntityConfig getInstance() {
if (instance == null) {
instance = new CustomEntityConfig();
}
return instance;
}
@Override
protected void loadKeys() {
if (config.getConfigurationSection("Hostile") != null) {
@@ -71,47 +60,4 @@ public class CustomEntityConfig extends ConfigLoader {
customEntityClassMap.put(clazz == null ? null : clazz.getName(), entity);
}
}
public boolean isCustomEntity(Entity entity) {
if (customEntityTypeMap.containsKey(entity.getType().toString())) {
return true;
}
try {
return customEntityClassMap.containsKey(((Class<?>) entity.getClass().getDeclaredField("entityClass").get(entity)).getName());
}
catch (Exception e) {
if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) {
return customEntityClassMap.containsKey(entity.getClass().getName());
}
e.printStackTrace();
return false;
}
}
public CustomEntity getCustomEntity(Entity entity) {
CustomEntity customEntity = customEntityTypeMap.get(entity.getType().toString());
if (customEntity == null) {
try {
customEntity = customEntityClassMap.get(((Class<?>) entity.getClass().getDeclaredField("entityClass").get(entity)).getName());
}
catch (Exception e) {
if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) {
customEntity = customEntityClassMap.get(entity.getClass().getName());
}
else {
e.printStackTrace();
}
}
}
return customEntity;
}
public void addEntity(CustomEntity customEntity, String className, String entityName) {
customEntityTypeMap.put(entityName, customEntity);
customEntityClassMap.put(className, customEntity);
}
}

View File

@@ -11,53 +11,33 @@ import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomTool;
import com.gmail.nossr50.skills.repair.Repair;
import com.gmail.nossr50.skills.repair.repairables.RepairItemType;
import com.gmail.nossr50.skills.repair.repairables.RepairMaterialType;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import com.gmail.nossr50.util.skills.SkillUtils;
public class CustomToolConfig extends ConfigLoader {
private static CustomToolConfig instance;
private boolean needsUpdate = false;
private List<Repairable> repairables;
public List<Material> customAxes = new ArrayList<Material>();
public List<Material> customBows = new ArrayList<Material>();
public List<Material> customHoes = new ArrayList<Material>();
public List<Material> customPickaxes = new ArrayList<Material>();
public List<Material> customShovels = new ArrayList<Material>();
public List<Material> customSwords = new ArrayList<Material>();
private List<Material> customAxes = new ArrayList<Material>();
private List<Material> customBows = new ArrayList<Material>();
private List<Material> customHoes = new ArrayList<Material>();
private List<Material> customPickaxes = new ArrayList<Material>();
private List<Material> customShovels = new ArrayList<Material>();
private List<Material> customSwords = new ArrayList<Material>();
public HashMap<Material, CustomTool> customToolMap = new HashMap<Material, CustomTool>();
private HashMap<Material, CustomTool> customToolMap = new HashMap<Material, CustomTool>();
public List<Repairable> repairables = new ArrayList<Repairable>();
private CustomToolConfig() {
super("mods", "tools.yml");
protected CustomToolConfig(String fileName) {
super("mods", fileName);
loadKeys();
}
public static CustomToolConfig getInstance() {
if (instance == null) {
instance = new CustomToolConfig();
}
return instance;
}
public List<Repairable> getLoadedRepairables() {
if (repairables == null) {
return new ArrayList<Repairable>();
}
return repairables;
}
@Override
protected void loadKeys() {
repairables = new ArrayList<Repairable>();
loadTool("Axes", customAxes);
loadTool("Bows", customBows);
loadTool("Hoes", customHoes);
@@ -107,7 +87,7 @@ public class CustomToolConfig extends ConfigLoader {
if (repairable) {
byte repairData = (byte) config.getInt(toolType + "." + toolName + ".Repair_Material_Data_Value", -1);
int repairQuantity = Repair.getRepairAndSalvageQuantities(new ItemStack(toolMaterial), repairMaterial, repairData);
int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(toolMaterial), repairMaterial, repairData);
if (repairQuantity == 0) {
repairQuantity = config.getInt(toolType + "." + toolName + ".Repair_Material_Data_Quantity", 2);
@@ -119,7 +99,7 @@ public class CustomToolConfig extends ConfigLoader {
durability = (short) config.getInt(toolType + "." + toolName + ".Durability", 60);
}
repairables.add(RepairableFactory.getRepairable(toolMaterial, repairMaterial, repairData, 0, repairQuantity, durability, RepairItemType.TOOL, RepairMaterialType.OTHER, 1.0));
repairables.add(RepairableFactory.getRepairable(toolMaterial, repairMaterial, repairData, 0, repairQuantity, durability, ItemType.TOOL, MaterialType.OTHER, 1.0));
}
double multiplier = config.getDouble(toolType + "." + toolName + ".XP_Modifier", 1.0);
@@ -132,36 +112,4 @@ public class CustomToolConfig extends ConfigLoader {
customToolMap.put(toolMaterial, tool);
}
}
public boolean isCustomAxe(Material material) {
return customAxes.contains(material);
}
public boolean isCustomBow(Material material) {
return customBows.contains(material);
}
public boolean isCustomHoe(Material material) {
return customHoes.contains(material);
}
public boolean isCustomPickaxe(Material material) {
return customPickaxes.contains(material);
}
public boolean isCustomShovel(Material material) {
return customShovels.contains(material);
}
public boolean isCustomSword(Material material) {
return customSwords.contains(material);
}
public boolean isCustomTool(Material material) {
return customToolMap.containsKey(material);
}
public CustomTool getCustomTool(Material material) {
return customToolMap.get(material);
}
}

View File

@@ -0,0 +1,35 @@
package com.gmail.nossr50.config.mods;
import java.io.File;
import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class EntityConfigManager {
public EntityConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.entities\\.yml");
File dataFolder = new File(mcMMO.getModDirectory());
File vanilla = new File(dataFolder, "entities.default.yml");
ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) {
plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "entities.default.yml", false);
}
for (String fileName : dataFolder.list()) {
if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
continue;
}
File file = new File(dataFolder, fileName);
if (file.isDirectory()) {
continue;
}
modManager.registerCustomEntities(new CustomEntityConfig(fileName));
}
}
}

View File

@@ -0,0 +1,35 @@
package com.gmail.nossr50.config.mods;
import java.io.File;
import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class ToolConfigManager {
public ToolConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.tools\\.yml");
File dataFolder = new File(mcMMO.getModDirectory());
File vanilla = new File(dataFolder, "tools.default.yml");
ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) {
plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "tools.default.yml", false);
}
for (String fileName : dataFolder.list()) {
if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
continue;
}
File file = new File(dataFolder, fileName);
if (file.isDirectory()) {
continue;
}
modManager.registerCustomTools(new CustomToolConfig(fileName));
}
}
}

View File

@@ -0,0 +1,222 @@
package com.gmail.nossr50.config.skills.alchemy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion;
public class PotionConfig extends ConfigLoader {
private static PotionConfig instance;
private List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierTwo = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierThree = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierFour = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierFive = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierSix = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierSeven = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierEight = new ArrayList<ItemStack>();
private Map<Short, AlchemyPotion> potionMap = new HashMap<Short, AlchemyPotion>();
private PotionConfig() {
super("potions.yml");
loadKeys();
}
public static PotionConfig getInstance() {
if (instance == null) {
instance = new PotionConfig();
}
return instance;
}
@Override
protected void loadKeys() {
loadConcoctions();
loadPotionMap();
}
private void loadConcoctions() {
ConfigurationSection concoctionSection = config.getConfigurationSection("Concoctions");
loadConcoctionsTier(concoctionsIngredientsTierOne, concoctionSection.getStringList("Tier_One_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierTwo, concoctionSection.getStringList("Tier_Two_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierThree, concoctionSection.getStringList("Tier_Three_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierFour, concoctionSection.getStringList("Tier_Four_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierFive, concoctionSection.getStringList("Tier_Five_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierSix, concoctionSection.getStringList("Tier_Six_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierSeven, concoctionSection.getStringList("Tier_Seven_Ingredients"));
loadConcoctionsTier(concoctionsIngredientsTierEight, concoctionSection.getStringList("Tier_Eight_Ingredients"));
concoctionsIngredientsTierTwo.addAll(concoctionsIngredientsTierOne);
concoctionsIngredientsTierThree.addAll(concoctionsIngredientsTierTwo);
concoctionsIngredientsTierFour.addAll(concoctionsIngredientsTierThree);
concoctionsIngredientsTierFive.addAll(concoctionsIngredientsTierFour);
concoctionsIngredientsTierSix.addAll(concoctionsIngredientsTierFive);
concoctionsIngredientsTierSeven.addAll(concoctionsIngredientsTierSix);
concoctionsIngredientsTierEight.addAll(concoctionsIngredientsTierSeven);
}
private void loadConcoctionsTier(List<ItemStack> ingredientList, List<String> ingredientStrings) {
if (ingredientStrings != null && ingredientStrings.size() > 0) {
for (String ingredientString : ingredientStrings) {
ItemStack ingredient = loadIngredient(ingredientString);
if (ingredient != null) {
ingredientList.add(ingredient);
}
}
}
}
/**
* Find the Potions configuration section and load all defined potions.
*/
private void loadPotionMap() {
ConfigurationSection potionSection = config.getConfigurationSection("Potions");
int pass = 0;
int fail = 0;
for (String dataValue : potionSection.getKeys(false)) {
AlchemyPotion potion = loadPotion(potionSection.getConfigurationSection(dataValue));
if (potion != null) {
potionMap.put(potion.getDataValue(), potion);
pass++;
}
else {
fail++;
}
}
mcMMO.p.debug("Loaded " + pass + " Alchemy potions, skipped " + fail + ".");
}
/**
* Parse a ConfigurationSection representing a AlchemyPotion.
* Returns null if input cannot be parsed.
*
* @param potion_section ConfigurationSection to be parsed.
*
* @return Parsed AlchemyPotion.
*/
private AlchemyPotion loadPotion(ConfigurationSection potion_section) {
try {
short dataValue = Short.parseShort(potion_section.getName());
String name = potion_section.getString("Name");
List<String> lore = new ArrayList<String>();
if (potion_section.contains("Lore")) {
for (String line : potion_section.getStringList("Lore")) {
lore.add(line);
}
}
List<PotionEffect> effects = new ArrayList<PotionEffect>();
if (potion_section.contains("Effects")) {
for (String effect : potion_section.getStringList("Effects")) {
String[] parts = effect.split(" ");
PotionEffectType type = parts.length > 0 ? PotionEffectType.getByName(parts[0]) : null;
int amplifier = parts.length > 1 ? Integer.parseInt(parts[1]) : 0;
int duration = parts.length > 2 ? Integer.parseInt(parts[2]) : 0;
if (type != null) {
effects.add(new PotionEffect(type, duration, amplifier));
}
else {
mcMMO.p.getLogger().warning("Failed to parse effect for potion " + name + ": " + effect);
}
}
}
Map<ItemStack, Short> children = new HashMap<ItemStack, Short>();
if (potion_section.contains("Children")) {
for (String child : potion_section.getConfigurationSection("Children").getKeys(false)) {
ItemStack ingredient = loadIngredient(child);
if (ingredient != null) {
children.put(ingredient, Short.parseShort(potion_section.getConfigurationSection("Children").getString(child)));
}
else {
mcMMO.p.getLogger().warning("Failed to parse child for potion " + name + ": " + child);
}
}
}
return new AlchemyPotion(dataValue, name, lore, effects, children);
}
catch (Exception e) {
mcMMO.p.getLogger().warning("Failed to load Alchemy potion: " + potion_section.getName());
return null;
}
}
/**
* Parse a string representation of an ingredient.
* Format: '&lt;MATERIAL&gt;[:data]'
* Returns null if input cannot be parsed.
*
* @param ingredient String representing an ingredient.
*
* @return Parsed ingredient.
*/
private ItemStack loadIngredient(String ingredient) {
if (ingredient == null || ingredient.isEmpty()) {
return null;
}
String[] parts = ingredient.split(":");
Material material = parts.length > 0 ? Material.getMaterial(parts[0]) : null;
short data = parts.length > 1 ? Short.parseShort(parts[1]) : 0;
if (material != null) {
return new ItemStack(material, 1, data);
}
return null;
}
public List<ItemStack> getIngredients(int tier) {
switch (tier) {
case 8:
return concoctionsIngredientsTierEight;
case 7:
return concoctionsIngredientsTierSeven;
case 6:
return concoctionsIngredientsTierSix;
case 5:
return concoctionsIngredientsTierFive;
case 4:
return concoctionsIngredientsTierFour;
case 3:
return concoctionsIngredientsTierThree;
case 2:
return concoctionsIngredientsTierTwo;
case 1:
default:
return concoctionsIngredientsTierOne;
}
}
public boolean isValidPotion(ItemStack item) {
return potionMap.containsKey(item.getDurability());
}
public AlchemyPotion getPotion(short durability) {
return potionMap.get(durability);
}
}

View File

@@ -1,4 +1,4 @@
package com.gmail.nossr50.skills.repair.config;
package com.gmail.nossr50.config.skills.repair;
import java.util.ArrayList;
import java.util.List;
@@ -9,12 +9,12 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.skills.repair.Repair;
import com.gmail.nossr50.skills.repair.repairables.RepairItemType;
import com.gmail.nossr50.skills.repair.repairables.RepairMaterialType;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
public class RepairConfig extends ConfigLoader {
private List<Repairable> repairables;
@@ -48,37 +48,37 @@ public class RepairConfig extends ConfigLoader {
}
// Repair Material Type
RepairMaterialType repairMaterialType = RepairMaterialType.OTHER;
MaterialType repairMaterialType = MaterialType.OTHER;
String repairMaterialTypeString = config.getString("Repairables." + key + ".MaterialType", "OTHER");
if (!config.contains("Repairables." + key + ".MaterialType") && itemMaterial != null) {
ItemStack repairItem = new ItemStack(itemMaterial);
if (ItemUtils.isWoodTool(repairItem)) {
repairMaterialType = RepairMaterialType.WOOD;
repairMaterialType = MaterialType.WOOD;
}
else if (ItemUtils.isStoneTool(repairItem)) {
repairMaterialType = RepairMaterialType.STONE;
repairMaterialType = MaterialType.STONE;
}
else if (ItemUtils.isStringTool(repairItem)) {
repairMaterialType = RepairMaterialType.STRING;
repairMaterialType = MaterialType.STRING;
}
else if (ItemUtils.isLeatherArmor(repairItem)) {
repairMaterialType = RepairMaterialType.LEATHER;
repairMaterialType = MaterialType.LEATHER;
}
else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) {
repairMaterialType = RepairMaterialType.IRON;
repairMaterialType = MaterialType.IRON;
}
else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) {
repairMaterialType = RepairMaterialType.GOLD;
repairMaterialType = MaterialType.GOLD;
}
else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) {
repairMaterialType = RepairMaterialType.DIAMOND;
repairMaterialType = MaterialType.DIAMOND;
}
}
else {
try {
repairMaterialType = RepairMaterialType.valueOf(repairMaterialTypeString);
repairMaterialType = MaterialType.valueOf(repairMaterialTypeString);
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid MaterialType of " + repairMaterialTypeString);
@@ -87,7 +87,7 @@ public class RepairConfig extends ConfigLoader {
// Repair Material
String repairMaterialName = config.getString("Repairables." + key + ".RepairMaterial");
Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultRepairMaterial() : Material.matchMaterial(repairMaterialName));
Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultMaterial() : Material.matchMaterial(repairMaterialName));
if (repairMaterial == null) {
reason.add(key + " has an invalid repair material: " + repairMaterialName);
@@ -96,27 +96,31 @@ public class RepairConfig extends ConfigLoader {
// Maximum Durability
short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) config.getInt("Repairables." + key + ".MaximumDurability"));
if (maximumDurability <= 0) {
maximumDurability = (short) config.getInt("Repairables." + key + ".MaximumDurability");
}
if (maximumDurability <= 0) {
reason.add("Maximum durability of " + key + " must be greater than 0!");
}
// Item Type
RepairItemType repairItemType = RepairItemType.OTHER;
ItemType repairItemType = ItemType.OTHER;
String repairItemTypeString = config.getString("Repairables." + key + ".ItemType", "OTHER");
if (!config.contains("Repairables." + key + ".ItemType") && itemMaterial != null) {
ItemStack repairItem = new ItemStack(itemMaterial);
if (ItemUtils.isMinecraftTool(repairItem)) {
repairItemType = RepairItemType.TOOL;
repairItemType = ItemType.TOOL;
}
else if (ItemUtils.isArmor(repairItem)) {
repairItemType = RepairItemType.ARMOR;
repairItemType = ItemType.ARMOR;
}
}
else {
try {
repairItemType = RepairItemType.valueOf(repairItemTypeString);
repairItemType = ItemType.valueOf(repairItemTypeString);
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid ItemType of " + repairItemTypeString);
@@ -132,7 +136,7 @@ public class RepairConfig extends ConfigLoader {
}
// Minimum Quantity
int minimumQuantity = (itemMaterial != null ? Repair.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity", 2));
int minimumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity", 2));
if (minimumQuantity <= 0 && itemMaterial != null) {
minimumQuantity = config.getInt("Repairables." + key + ".MinimumQuantity", 2);

View File

@@ -1,4 +1,4 @@
package com.gmail.nossr50.skills.repair.config;
package com.gmail.nossr50.config.skills.repair;
import java.io.File;
import java.util.ArrayList;
@@ -9,11 +9,9 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
public class RepairConfigManager {
private List<Repairable> repairables;
private final List<Repairable> repairables = new ArrayList<Repairable>();
public RepairConfigManager(mcMMO plugin) {
repairables = new ArrayList<Repairable>();
Pattern pattern = Pattern.compile("repair\\.(?:.+)\\.yml");
File dataFolder = plugin.getDataFolder();
File vanilla = new File(dataFolder, "repair.vanilla.yml");
@@ -34,19 +32,11 @@ public class RepairConfigManager {
}
RepairConfig rConfig = new RepairConfig(fileName);
List<Repairable> rConfigRepairables = rConfig.getLoadedRepairables();
if (rConfigRepairables != null) {
repairables.addAll(rConfigRepairables);
}
repairables.addAll(rConfig.getLoadedRepairables());
}
}
public List<Repairable> getLoadedRepairables() {
if (repairables == null) {
return new ArrayList<Repairable>();
}
return repairables;
}
}

View File

@@ -0,0 +1,165 @@
package com.gmail.nossr50.config.skills.salvage;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory;
import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
public class SalvageConfig extends ConfigLoader {
private List<Salvageable> salvageables;
public SalvageConfig(String fileName) {
super(fileName);
loadKeys();
}
@Override
protected void loadKeys() {
salvageables = new ArrayList<Salvageable>();
ConfigurationSection section = config.getConfigurationSection("Salvageables");
Set<String> keys = section.getKeys(false);
for (String key : keys) {
// Validate all the things!
List<String> reason = new ArrayList<String>();
// Item Material
Material itemMaterial = Material.matchMaterial(key);
if (itemMaterial == null) {
reason.add("Invalid material: " + key);
}
// Salvage Material Type
MaterialType salvageMaterialType = MaterialType.OTHER;
String salvageMaterialTypeString = config.getString("Salvageables." + key + ".MaterialType", "OTHER");
if (!config.contains("Salvageables." + key + ".MaterialType") && itemMaterial != null) {
ItemStack salvageItem = new ItemStack(itemMaterial);
if (ItemUtils.isWoodTool(salvageItem)) {
salvageMaterialType = MaterialType.WOOD;
}
else if (ItemUtils.isStoneTool(salvageItem)) {
salvageMaterialType = MaterialType.STONE;
}
else if (ItemUtils.isStringTool(salvageItem)) {
salvageMaterialType = MaterialType.STRING;
}
else if (ItemUtils.isLeatherArmor(salvageItem)) {
salvageMaterialType = MaterialType.LEATHER;
}
else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) {
salvageMaterialType = MaterialType.IRON;
}
else if (ItemUtils.isGoldArmor(salvageItem) || ItemUtils.isGoldTool(salvageItem)) {
salvageMaterialType = MaterialType.GOLD;
}
else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) {
salvageMaterialType = MaterialType.DIAMOND;
}
}
else {
try {
salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString);
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString);
}
}
// Salvage Material
String salvageMaterialName = config.getString("Salvageables." + key + ".SalvageMaterial");
Material salvageMaterial = (salvageMaterialName == null ? salvageMaterialType.getDefaultMaterial() : Material.matchMaterial(salvageMaterialName));
if (salvageMaterial == null) {
reason.add(key + " has an invalid salvage material: " + salvageMaterialName);
}
// Maximum Durability
short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) config.getInt("Salvageables." + key + ".MaximumDurability"));
// Item Type
ItemType salvageItemType = ItemType.OTHER;
String salvageItemTypeString = config.getString("Salvageables." + key + ".ItemType", "OTHER");
if (!config.contains("Salvageables." + key + ".ItemType") && itemMaterial != null) {
ItemStack salvageItem = new ItemStack(itemMaterial);
if (ItemUtils.isMinecraftTool(salvageItem)) {
salvageItemType = ItemType.TOOL;
}
else if (ItemUtils.isArmor(salvageItem)) {
salvageItemType = ItemType.ARMOR;
}
}
else {
try {
salvageItemType = ItemType.valueOf(salvageItemTypeString);
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid ItemType of " + salvageItemTypeString);
}
}
byte salvageMetadata = (byte) config.getInt("Salvageables." + key + ".SalvageMaterialMetadata", -1);
int minimumLevel = config.getInt("Salvageables." + key + ".MinimumLevel");
double xpMultiplier = config.getDouble("Salvageables." + key + ".XpMultiplier", 1);
if (minimumLevel < 0) {
reason.add(key + " has an invalid MinimumLevel of " + minimumLevel);
}
// Maximum Quantity
int maximumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), salvageMaterial, salvageMetadata) : config.getInt("Salvageables." + key + ".MaximumQuantity", 2));
if (maximumQuantity <= 0 && itemMaterial != null) {
maximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", 2);
}
int configMaximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", -1);
if (configMaximumQuantity > 0) {
maximumQuantity = configMaximumQuantity;
}
if (maximumQuantity <= 0) {
reason.add("Maximum quantity of " + key + " must be greater than 0!");
}
if (noErrorsInSalvageable(reason)) {
Salvageable salvageable = SalvageableFactory.getSalvageable(itemMaterial, salvageMaterial, salvageMetadata, minimumLevel, maximumQuantity, maximumDurability, salvageItemType, salvageMaterialType, xpMultiplier);
salvageables.add(salvageable);
}
}
}
protected List<Salvageable> getLoadedSalvageables() {
return salvageables == null ? new ArrayList<Salvageable>() : salvageables;
}
private boolean noErrorsInSalvageable(List<String> issues) {
if (!issues.isEmpty()) {
plugin.getLogger().warning("Errors have been found in: " + fileName);
plugin.getLogger().warning("The following issues were found:");
}
for (String issue : issues) {
plugin.getLogger().warning(issue);
}
return issues.isEmpty();
}
}

View File

@@ -0,0 +1,42 @@
package com.gmail.nossr50.config.skills.salvage;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
public class SalvageConfigManager {
private final List<Salvageable> salvageables = new ArrayList<Salvageable>();
public SalvageConfigManager(mcMMO plugin) {
Pattern pattern = Pattern.compile("salvage\\.(?:.+)\\.yml");
File dataFolder = plugin.getDataFolder();
File vanilla = new File(dataFolder, "salvage.vanilla.yml");
if (!vanilla.exists()) {
plugin.saveResource("salvage.vanilla.yml", false);
}
for (String fileName : dataFolder.list()) {
if (!pattern.matcher(fileName).matches()) {
continue;
}
File file = new File(dataFolder, fileName);
if (file.isDirectory()) {
continue;
}
SalvageConfig salvageConfig = new SalvageConfig(fileName);
salvageables.addAll(salvageConfig.getLoadedSalvageables());
}
}
public List<Salvageable> getLoadedSalvageables() {
return salvageables;
}
}

View File

@@ -35,6 +35,8 @@ public class TreasureConfig extends ConfigLoader {
public List<ExcavationTreasure> excavationFromMycel = new ArrayList<ExcavationTreasure>();
public List<ExcavationTreasure> excavationFromSoulSand = new ArrayList<ExcavationTreasure>();
public List<ExcavationTreasure> excavationFromSnow = new ArrayList<ExcavationTreasure>();
public List<ExcavationTreasure> excavationFromRedSand = new ArrayList<ExcavationTreasure>();
public List<ExcavationTreasure> excavationFromPodzol = new ArrayList<ExcavationTreasure>();
public List<HylianTreasure> hylianFromBushes = new ArrayList<HylianTreasure>();
public List<HylianTreasure> hylianFromFlowers = new ArrayList<HylianTreasure>();
@@ -158,26 +160,29 @@ public class TreasureConfig extends ConfigLoader {
// Validate all the things!
List<String> reason = new ArrayList<String>();
String[] treasureInfo = treasureName.split("[|]");
String materialName = treasureInfo[0];
/*
* Material, Amount, and Data
*/
Material material;
if (treasureName.contains("POTION")) {
if (materialName.contains("POTION")) {
material = Material.POTION;
}
else if (treasureName.contains("INK_SACK")) {
else if (materialName.contains("INK_SACK")) {
material = Material.INK_SACK;
}
else {
material = Material.matchMaterial(treasureName);
material = Material.matchMaterial(materialName);
}
int amount = config.getInt(type + "." + treasureName + ".Amount");
int data = config.getInt(type + "." + treasureName + ".Data");
short data = (treasureInfo.length == 2) ? Byte.valueOf(treasureInfo[1]) : (short) config.getInt(type + "." + treasureName + ".Data");
if (material == null) {
reason.add("Invalid material: " + treasureName);
reason.add("Invalid material: " + materialName);
}
if (amount <= 0) {
@@ -226,8 +231,8 @@ public class TreasureConfig extends ConfigLoader {
*/
ItemStack item = null;
if (treasureName.contains("POTION")) {
String potionType = treasureName.substring(7);
if (materialName.contains("POTION")) {
String potionType = materialName.substring(7);
try {
item = new Potion(PotionType.valueOf(potionType.toUpperCase().trim())).toItemStack(amount);
@@ -236,8 +241,8 @@ public class TreasureConfig extends ConfigLoader {
reason.add("Invalid Potion_Type: " + potionType);
}
}
else if (treasureName.contains("INK_SACK")) {
String color = treasureName.substring(9);
else if (materialName.contains("INK_SACK")) {
String color = materialName.substring(9);
try {
Dye dye = new Dye();
@@ -250,7 +255,7 @@ public class TreasureConfig extends ConfigLoader {
}
}
else if (material != null) {
item = new ItemStack(material, amount, (short) data);
item = new ItemStack(material, amount, data);
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
ItemMeta itemMeta = item.getItemMeta();
@@ -371,6 +376,14 @@ public class TreasureConfig extends ConfigLoader {
if (dropList.contains("Snow")) {
excavationFromSnow.add(excavationTreasure);
}
if (dropList.contains("Red_Sand")) {
excavationFromRedSand.add(excavationTreasure);
}
if (dropList.contains("Podzol")) {
excavationFromPodzol.add(excavationTreasure);
}
}
else if (isHylian) {
HylianTreasure hylianTreasure = new HylianTreasure(item, xp, dropChance, dropLevel);

View File

@@ -44,7 +44,7 @@ public interface DatabaseManager {
/**
* Retrieve leaderboard info.
*
* @param skillName The skill to retrieve info on
* @param skill The skill to retrieve info on
* @param pageNumber Which page in the leaderboards to retrieve
* @param statsPerPage The number of stats per page
* @return the requested leaderboard information

View File

@@ -26,6 +26,9 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
import org.apache.commons.lang.ArrayUtils;
public final class FlatfileDatabaseManager implements DatabaseManager {
private final HashMap<SkillType, List<PlayerStat>> playerStatHash = new HashMap<SkillType, List<PlayerStat>>();
@@ -56,7 +59,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try {
in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder();
String line = "";
String line;
while ((line = in.readLine()) != null) {
String[] character = line.split(":");
@@ -111,7 +114,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try {
in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder();
String line = "";
String line;
while ((line = in.readLine()) != null) {
String[] character = line.split(":");
@@ -173,7 +176,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try {
in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder();
String line = "";
String line;
while ((line = in.readLine()) != null) {
// Write out the same file but when we get to the player we want to remove, we skip his line.
@@ -265,6 +268,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":");
MobHealthbarType mobHealthbarType = profile.getMobHealthbarType();
writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":");
writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
writer.append("\r\n");
}
}
@@ -354,7 +359,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
out.append("0:"); // Blast Mining
out.append(String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)).append(":"); // LastLogin
out.append(Config.getInstance().getMobHealthbarDefault().toString()).append(":"); // Mob Healthbar HUD
out.append("0:"); // Alchemy
out.append("0:"); // AlchemyXp
// Add more in the same format as the line above
out.newLine();
@@ -386,8 +393,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
continue;
}
PlayerProfile p = loadFromLine(character);
return p;
return loadFromLine(character);
}
// Didn't find the player, create a new one
@@ -503,6 +509,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
List<PlayerStat> unarmed = new ArrayList<PlayerStat>();
List<PlayerStat> taming = new ArrayList<PlayerStat>();
List<PlayerStat> fishing = new ArrayList<PlayerStat>();
List<PlayerStat> alchemy = new ArrayList<PlayerStat>();
BufferedReader in = null;
String playerName = null;
@@ -510,7 +517,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
synchronized (fileWritingLock) {
try {
in = new BufferedReader(new FileReader(usersFilePath));
String line = "";
String line;
while ((line = in.readLine()) != null) {
String[] data = line.split(":");
@@ -520,6 +527,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
Map<SkillType, Integer> skills = getSkillMapFromLine(data);
powerLevel += putStat(acrobatics, playerName, skills.get(SkillType.ACROBATICS));
powerLevel += putStat(alchemy, playerName, skills.get(SkillType.ALCHEMY));
powerLevel += putStat(archery, playerName, skills.get(SkillType.ARCHERY));
powerLevel += putStat(axes, playerName, skills.get(SkillType.AXES));
powerLevel += putStat(excavation, playerName, skills.get(SkillType.EXCAVATION));
@@ -557,6 +565,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
Collections.sort(acrobatics, c);
Collections.sort(taming, c);
Collections.sort(fishing, c);
Collections.sort(alchemy, c);
Collections.sort(powerLevels, c);
playerStatHash.put(SkillType.MINING, mining);
@@ -571,6 +580,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
playerStatHash.put(SkillType.ACROBATICS, acrobatics);
playerStatHash.put(SkillType.TAMING, taming);
playerStatHash.put(SkillType.FISHING, fishing);
playerStatHash.put(SkillType.ALCHEMY, alchemy);
}
/**
@@ -586,7 +596,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try {
in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder();
String line = "";
String line;
HashSet<String> players = new HashSet<String>();
while ((line = in.readLine()) != null) {
@@ -597,7 +607,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
// Length checks depend on last character being ':'
if (line.charAt(line.length() - 1) != ':') {
line = line + ":";
line = line.concat(":");
}
String[] character = line.split(":");
@@ -614,29 +624,33 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
String oldVersion = null;
if (character.length <= 33) {
// Introduction of HUDType
// Version 1.1.06
// commit 78f79213cdd7190cd11ae54526f3b4ea42078e8a
line = line.concat(" :");
character = line.split(":");
oldVersion = "1.1.06";
}
if (!character[33].isEmpty()) {
// Removal of Spout Support
// Version 1.4.07-dev2
// commit 7bac0e2ca5143bce84dc160617fed97f0b1cb968
line = line.replace(character[33], "");
oldVersion = "1.4.07";
if (oldVersion == null) {
oldVersion = "1.4.07";
}
}
// If they're valid, rewrite them to the file.
if (character.length > 38) {
if (character.length == 41) {
writer.append(line).append("\r\n");
continue;
}
StringBuilder newLine = new StringBuilder(line);
if (character.length <= 33) {
// Introduction of HUDType
// Version 1.1.06
// commit 78f79213cdd7190cd11ae54526f3b4ea42078e8a
newLine.append(":");
oldVersion = "1.1.06";
}
if (character.length <= 35) {
// Introduction of Fishing
// Version 1.2.00
@@ -675,6 +689,55 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
oldVersion = "1.4.06";
}
}
if (character.length <= 39) {
// Addition of Alchemy
// Version 1.4.08
newLine.append("0").append(":");
newLine.append("0").append(":");
if (oldVersion == null) {
oldVersion = "1.4.08";
}
}
// Remove any blanks that shouldn't be there, and validate the other fields
String[] newCharacter = newLine.toString().split(":");
boolean corrupted = false;
for (int i = 0; i < newCharacter.length; i++) {
if (newCharacter[i].isEmpty() && !(i == 2 || i == 3 || i == 23 || i == 33)) {
corrupted = true;
if (newCharacter.length != 41) {
newCharacter = (String[]) ArrayUtils.remove(newCharacter, i);
}
else {
if (i == 37) {
newCharacter[i] = String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR);
}
else if (i == 38) {
newCharacter[i] = Config.getInstance().getMobHealthbarDefault().toString();
}
else {
newCharacter[i] = "0";
}
}
}
if (StringUtils.isInt(newCharacter[i]) && i == 38) {
corrupted = true;
newCharacter[i] = Config.getInstance().getMobHealthbarDefault().toString();
}
if (!StringUtils.isInt(newCharacter[i]) && !(i == 0 || i == 2 || i == 3 || i == 23 || i == 33 || i == 38)) {
corrupted = true;
newCharacter[i] = "0";
}
}
if (corrupted) {
mcMMO.p.debug("Updating corrupted database line for player " + newCharacter[0]);
newLine = new StringBuilder(org.apache.commons.lang.StringUtils.join(newCharacter, ":"));
}
if (oldVersion != null) {
mcMMO.p.debug("Updating database line for player " + character[0] + " from before version " + oldVersion);
@@ -751,7 +814,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
}
}
private PlayerProfile loadFromLine(String[] character) throws Exception {
private PlayerProfile loadFromLine(String[] character) {
Map<SkillType, Integer> skills = getSkillMapFromLine(character); // Skill levels
Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP
Map<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>(); // Ability & Cooldown
@@ -771,6 +834,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.AXES, (float) Integer.valueOf(character[21]));
skillsXp.put(SkillType.ACROBATICS, (float) Integer.valueOf(character[22]));
skillsXp.put(SkillType.FISHING, (float) Integer.valueOf(character[35]));
skillsXp.put(SkillType.ALCHEMY, (float) Integer.valueOf(character[40]));
// Taming - Unused
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
@@ -810,6 +874,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
skills.put(SkillType.AXES, Integer.valueOf(character[13]));
skills.put(SkillType.ACROBATICS, Integer.valueOf(character[14]));
skills.put(SkillType.FISHING, Integer.valueOf(character[34]));
skills.put(SkillType.ALCHEMY, Integer.valueOf(character[39]));
return skills;
}

View File

@@ -152,7 +152,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ " taming = ?, mining = ?, repair = ?, woodcutting = ?"
+ ", unarmed = ?, herbalism = ?, excavation = ?"
+ ", archery = ?, swords = ?, axes = ?, acrobatics = ?"
+ ", fishing = ? WHERE user_id = ?",
+ ", fishing = ?, alchemy = ? WHERE user_id = ?",
profile.getSkillLevel(SkillType.TAMING),
profile.getSkillLevel(SkillType.MINING),
profile.getSkillLevel(SkillType.REPAIR),
@@ -165,13 +165,14 @@ public final class SQLDatabaseManager implements DatabaseManager {
profile.getSkillLevel(SkillType.AXES),
profile.getSkillLevel(SkillType.ACROBATICS),
profile.getSkillLevel(SkillType.FISHING),
profile.getSkillLevel(SkillType.ALCHEMY),
userId);
success &= saveIntegers(
"UPDATE " + tablePrefix + "experience SET "
+ " taming = ?, mining = ?, repair = ?, woodcutting = ?"
+ ", unarmed = ?, herbalism = ?, excavation = ?"
+ ", archery = ?, swords = ?, axes = ?, acrobatics = ?"
+ ", fishing = ? WHERE user_id = ?",
+ ", fishing = ?, alchemy = ? WHERE user_id = ?",
profile.getSkillXpLevel(SkillType.TAMING),
profile.getSkillXpLevel(SkillType.MINING),
profile.getSkillXpLevel(SkillType.REPAIR),
@@ -184,6 +185,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
profile.getSkillXpLevel(SkillType.AXES),
profile.getSkillXpLevel(SkillType.ACROBATICS),
profile.getSkillXpLevel(SkillType.FISHING),
profile.getSkillXpLevel(SkillType.ALCHEMY),
userId);
return success;
}
@@ -192,8 +194,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
List<PlayerStat> stats = new ArrayList<PlayerStat>();
if (checkConnected()) {
String query = skill == null ? "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing" : skill.name().toLowerCase();
ResultSet resultSet = null;
String query = skill == null ? "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy" : skill.name().toLowerCase();
ResultSet resultSet;
PreparedStatement statement = null;
try {
@@ -271,9 +273,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
"WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing > 0 " +
"AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing > " +
"(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing " +
"WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy > 0 " +
"AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy > " +
"(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy " +
"FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = ?)";
PreparedStatement statement = connection.prepareStatement(sql);
@@ -286,11 +288,11 @@ public final class SQLDatabaseManager implements DatabaseManager {
statement.close();
sql = "SELECT user, taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing " +
sql = "SELECT user, taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy " +
"FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
"WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing > 0 " +
"AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing = " +
"(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing " +
"WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy > 0 " +
"AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy = " +
"(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy " +
"FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = ?) ORDER BY user";
statement = connection.prepareStatement(sql);
@@ -359,8 +361,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
try {
statement = connection.prepareStatement(
"SELECT "
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, "
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, "
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
+ "h.mobhealthbar "
+ "FROM " + tablePrefix + "users u "
@@ -435,8 +437,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
try {
statement = connection.prepareStatement(
"SELECT "
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, "
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, "
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
+ "h.mobhealthbar "
+ "FROM " + tablePrefix + "users u "
@@ -446,16 +448,16 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ "JOIN " + tablePrefix + "huds h ON (u.id = h.user_id) "
+ "WHERE u.user = ?");
List<String> usernames = getStoredUsers();
ResultSet result = null;
ResultSet resultSet;
int convertedUsers = 0;
long startMillis = System.currentTimeMillis();
for (String playerName : usernames) {
statement.setString(1, playerName);
try {
result = statement.executeQuery();
result.next();
destination.saveUser(loadFromResult(playerName, result));
result.close();
resultSet = statement.executeQuery();
resultSet.next();
destination.saveUser(loadFromResult(playerName, resultSet));
resultSet.close();
}
catch (SQLException e) {
// Ignore
@@ -687,6 +689,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ "`axes` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`fishing` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`alchemy` int(10) unsigned NOT NULL DEFAULT '0',"
+ "PRIMARY KEY (`user_id`)) "
+ "DEFAULT CHARSET=latin1;");
write("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "experience` ("
@@ -703,6 +706,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ "`axes` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`fishing` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`alchemy` int(10) unsigned NOT NULL DEFAULT '0',"
+ "PRIMARY KEY (`user_id`)) "
+ "DEFAULT CHARSET=latin1;");
@@ -728,6 +732,10 @@ public final class SQLDatabaseManager implements DatabaseManager {
sql = "SELECT * FROM `" + tablePrefix + "experience` ORDER BY `" + tablePrefix + "experience`.`fishing` ASC LIMIT 0 , 30";
break;
case ALCHEMY:
sql = "SELECT * FROM `" + tablePrefix + "experience` ORDER BY `" + tablePrefix + "experience`.`alchemy` ASC LIMIT 0 , 30";
break;
case INDEX:
if (read("SHOW INDEX FROM " + tablePrefix + "skills").size() != 13 && checkConnected()) {
mcMMO.p.getLogger().info("Indexing tables, this may take a while on larger databases");
@@ -790,8 +798,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
break;
}
ResultSet resultSet = null;
HashMap<Integer, ArrayList<String>> rows = new HashMap<Integer, ArrayList<String>>();
ResultSet resultSet;
PreparedStatement statement = null;
try {
@@ -803,13 +810,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
resultSet = statement.executeQuery();
while (resultSet.next()) {
ArrayList<String> column = new ArrayList<String>();
for (int i = 1; i <= resultSet.getMetaData().getColumnCount(); i++) {
column.add(resultSet.getString(i));
}
rows.put(resultSet.getRow(), column);
// No reason to do anything here... we're just trying to catch exceptions
}
}
catch (SQLException ex) {
@@ -830,6 +831,12 @@ public final class SQLDatabaseManager implements DatabaseManager {
write("ALTER TABLE `" + tablePrefix + "huds` ADD `mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "' ;");
break;
case ALCHEMY:
mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Alchemy...");
write("ALTER TABLE `"+tablePrefix + "skills` ADD `alchemy` int(10) NOT NULL DEFAULT '0' ;");
write("ALTER TABLE `"+tablePrefix + "experience` ADD `alchemy` int(10) NOT NULL DEFAULT '0' ;");
break;
default:
break;
}
@@ -970,7 +977,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
int result = -1;
if (checkConnected()) {
ResultSet resultSet = null;
ResultSet resultSet;
try {
resultSet = statement.executeQuery();
@@ -1183,9 +1190,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
MobHealthbarType mobHealthbarType;
final int OFFSET_SKILLS = 0; // TODO update these numbers when the query changes (a new skill is added)
final int OFFSET_XP = 12;
final int OFFSET_DATS = 24;
final int OFFSET_OTHER = 36;
final int OFFSET_XP = 13;
final int OFFSET_DATS = 26;
final int OFFSET_OTHER = 38;
skills.put(SkillType.TAMING, result.getInt(OFFSET_SKILLS + 1));
skills.put(SkillType.MINING, result.getInt(OFFSET_SKILLS + 2));
@@ -1199,6 +1206,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
skills.put(SkillType.AXES, result.getInt(OFFSET_SKILLS + 10));
skills.put(SkillType.ACROBATICS, result.getInt(OFFSET_SKILLS + 11));
skills.put(SkillType.FISHING, result.getInt(OFFSET_SKILLS + 12));
skills.put(SkillType.ALCHEMY, result.getInt(OFFSET_SKILLS + 13));
skillsXp.put(SkillType.TAMING, result.getFloat(OFFSET_XP + 1));
skillsXp.put(SkillType.MINING, result.getFloat(OFFSET_XP + 2));
@@ -1212,6 +1220,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.AXES, result.getFloat(OFFSET_XP + 10));
skillsXp.put(SkillType.ACROBATICS, result.getFloat(OFFSET_XP + 11));
skillsXp.put(SkillType.FISHING, result.getFloat(OFFSET_XP + 12));
skillsXp.put(SkillType.ALCHEMY, result.getFloat(OFFSET_XP + 13));
// Taming - Unused - result.getInt(OFFSET_DATS + 1)
skillsDATS.put(AbilityType.SUPER_BREAKER, result.getInt(OFFSET_DATS + 2));

View File

@@ -7,6 +7,7 @@ public enum DatabaseUpdateType {
MOB_HEALTHBARS,
PARTY_NAMES,
KILL_ORPHANS,
DROPPED_SPOUT
DROPPED_SPOUT,
ALCHEMY
;
}

View File

@@ -13,4 +13,4 @@ public enum FormulaType {
return UNKNOWN;
}
}
};
}

View File

@@ -1,12 +1,23 @@
package com.gmail.nossr50.datatypes.party;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
public class Party {
private final LinkedHashSet<String> members = new LinkedHashSet<String>();
@@ -15,6 +26,9 @@ public class Party {
private String name;
private String password;
private boolean locked;
private Party ally;
private int level;
private float xp;
private ShareMode xpShareMode = ShareMode.NONE;
private ShareMode itemShareMode = ShareMode.NONE;
@@ -33,6 +47,7 @@ public class Party {
this.leader = leader;
this.name = name;
this.locked = true;
this.level = 0;
}
public Party(String leader, String name, String password) {
@@ -40,6 +55,7 @@ public class Party {
this.name = name;
this.password = password;
this.locked = true;
this.level = 0;
}
public Party(String leader, String name, String password, boolean locked) {
@@ -47,6 +63,7 @@ public class Party {
this.name = name;
this.password = password;
this.locked = locked;
this.level = 0;
}
public LinkedHashSet<String> getMembers() {
@@ -67,6 +84,19 @@ public class Party {
return onlineMembers;
}
public List<String> getOnlinePlayerNames(CommandSender sender) {
Player player = sender instanceof Player ? (Player) sender : null;
List<String> onlinePlayerNames = new ArrayList<String>();
for (Player onlinePlayer : getOnlineMembers()) {
if (player != null && player.canSee(onlinePlayer)) {
onlinePlayerNames.add(onlinePlayer.getName());
}
}
return onlinePlayerNames;
}
public String getName() {
return name;
}
@@ -83,6 +113,10 @@ public class Party {
return locked;
}
public Party getAlly() {
return ally;
}
public List<String> getItemShareCategories() {
List<String> shareCategories = new ArrayList<String>();
@@ -111,6 +145,99 @@ public class Party {
this.locked = locked;
}
public void setAlly(Party ally) {
this.ally = ally;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public float getXp() {
return xp;
}
public void setXp(float xp) {
this.xp = xp;
}
public void addXp(float xp) {
setXp(getXp() + xp);
}
protected float levelUp() {
float xpRemoved = getXpToLevel();
setLevel(getLevel() + 1);
setXp(getXp() - xpRemoved);
return xpRemoved;
}
public int getXpToLevel() {
FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType();
return (mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType)) * (getOnlineMembers().size() + Config.getInstance().getPartyXpCurveMultiplier());
}
public String getXpToLevelPercentage() {
DecimalFormat percent = new DecimalFormat("##0.00%");
return percent.format(this.getXp() / getXpToLevel());
}
/**
* Applies an experience gain
*
* @param xp Experience amount to add
*/
public void applyXpGain(float xp) {
if (!EventUtils.handlePartyXpGainEvent(this, xp)) {
return;
}
if (getXp() < getXpToLevel()) {
return;
}
int levelsGained = 0;
float xpRemoved = 0;
while (getXp() >= getXpToLevel()) {
if (hasReachedLevelCap()) {
setXp(0);
return;
}
xpRemoved += levelUp();
levelsGained++;
}
if (!EventUtils.handlePartyLevelChangeEvent(this, levelsGained, xpRemoved)) {
return;
}
if (!Config.getInstance().getPartyInformAllMembers()) {
Player leader = mcMMO.p.getServer().getPlayer(this.leader);
if (leader != null) {
leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel()));
if (Config.getInstance().getLevelUpSoundsEnabled()) {
leader.playSound(leader.getLocation(), Sound.LEVEL_UP, Misc.LEVELUP_VOLUME, Misc.LEVELUP_PITCH);
}
}
return;
}
PartyManager.informPartyMembersLevelUp(this, levelsGained, getLevel());
}
public boolean hasReachedLevelCap() {
return Config.getInstance().getPartyLevelCap() < getLevel() + 1;
}
public void setXpShareMode(ShareMode xpShareMode) {
this.xpShareMode = xpShareMode;
}
@@ -176,6 +303,36 @@ public class Party {
}
}
public String createMembersList(String playerName, List<Player> nearMembers) {
StringBuilder memberList = new StringBuilder();
for (String memberName : this.getMembers()) {
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
if (this.getLeader().equalsIgnoreCase(memberName)) {
memberList.append(ChatColor.GOLD);
if (member == null) {
memberName = memberName.substring(0, 1) + ChatColor.GRAY + ChatColor.ITALIC + "" + memberName.substring(1);
}
}
else if (member != null) {
memberList.append(ChatColor.WHITE);
}
else {
memberList.append(ChatColor.GRAY);
}
if (!nearMembers.contains(member) && !playerName.equalsIgnoreCase(memberName)) {
memberList.append(ChatColor.ITALIC).append("");
}
memberList.append(memberName).append(ChatColor.RESET).append(" ");
}
return memberList.toString();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
@@ -194,9 +351,4 @@ public class Party {
return this.getName().equals(other.getName());
}
@Override
public int hashCode() {
return super.hashCode();
}
}

View File

@@ -0,0 +1,51 @@
package com.gmail.nossr50.datatypes.party;
import org.bukkit.entity.Player;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
public enum PartyFeature {
CHAT,
TELEPORT,
ALLIANCE,
ITEM_SHARE,
XP_SHARE;
public String getLocaleString() {
return LocaleLoader.getString("Party.Feature." + StringUtils.getPrettyPartyFeatureString(this).replace(" ", ""));
}
public String getFeatureLockedLocaleString() {
return LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Party.Feature.Locked." + StringUtils.getPrettyPartyFeatureString(this).replace(" ", ""), Config.getInstance().getPartyFeatureUnlockLevel(this)));
}
public boolean hasPermission(Player player) {
PartySubcommandType partySubCommandType;
switch (this) {
case CHAT:
partySubCommandType = PartySubcommandType.CHAT;
break;
case TELEPORT:
partySubCommandType = PartySubcommandType.TELEPORT;
break;
case ALLIANCE:
partySubCommandType = PartySubcommandType.ALLIANCE;
break;
case ITEM_SHARE:
partySubCommandType = PartySubcommandType.ITEMSHARE;
break;
case XP_SHARE:
partySubCommandType = PartySubcommandType.XPSHARE;
break;
default:
return false;
}
return Permissions.partySubcommand(player, partySubCommandType);
}
}

View File

@@ -22,4 +22,4 @@ public enum ShareMode {
return null;
}
}
};
}

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