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

Compare commits

..

46 Commits

Author SHA1 Message Date
TfT_02
a38d1176cb Fix casing 2014-08-01 19:25:49 +02:00
TfT_02
7d65b9422a Make the profile loaded message optional
People will complain if we don’t
2014-07-31 23:16:43 +02:00
TfT_02
e7ee31c291 Revert "Hide loading messages when at the first attempt"
This reverts commit 216ecc465d.
2014-07-31 23:10:46 +02:00
TfT_02
23cbfc9038 Revert "Increase attempt counter after the apply"
This reverts commit c24c19f5f5.
2014-07-31 23:10:39 +02:00
TfT_02
c24c19f5f5 Increase attempt counter after the apply 2014-07-31 22:37:22 +02:00
TfT_02
216ecc465d Hide loading messages when at the first attempt 2014-07-31 22:06:42 +02:00
TfT_02
635f2bdb43 Fix formatting 2014-07-31 22:04:53 +02:00
t00thpick1
2286728308 Riking fix this or its gone. 2014-07-31 15:06:12 -04:00
t00thpick1
f809bca47b Avoid race conditions in multiple load attempts. 2014-07-31 12:59:36 -04:00
t00thpick1
71d6cb661f Actually make multiple load attempts 2014-07-31 12:59:21 -04:00
t00thpick1
2248316ed3 some of zreeds work, because too lazy to fix merge compatability 2014-07-31 12:44:41 -04:00
riking
9668bb2ee7 Abort onEnable() when driver not found 2014-07-30 12:31:56 -07:00
t00thpick1
f0503c7797 Unused 2014-07-29 16:27:54 -04:00
t00thpick1
9a12d86eac Configurable :P 2014-07-28 16:46:55 -04:00
t00thpick1
ed82a838c8 I like these to be explictly closed rather than in a new method. 2014-07-27 14:56:34 -04:00
t00thpick1
e6a7c8f5d2 We need both UUID and username to create new. 2014-07-27 12:57:12 -04:00
t00thpick1
fc393e1047 start 2014-07-27 12:01:08 -04:00
t00thpick1
f8f73a49b5 comma 2014-07-27 11:50:12 -04:00
t00thpick1
a7841adec5 Missed some usages 2014-07-27 11:14:46 -04:00
t00thpick1
7917b84eca Hopefully this works. 2014-07-27 11:03:16 -04:00
TfT_02
49f2bf5452 Fix formatting in SQLDatabaseManager 2014-07-27 12:32:48 +02:00
zreed
16b40c3eba Create the UUID index on the right table as well as on table creation 2014-07-26 01:42:27 -04:00
t00thpick1
1396d6d9ad Explicitly close every resource 2014-07-26 00:00:40 -04:00
zreed
b2015d68d1 Work by Zreed 2014-07-25 23:31:41 -04:00
t00thpick1
a3066803d0 Completely untested, needs some more work as follows:
A.  Handle reconnecting on full disconnects.
B.  refactor code to use same connection object in same task(Some tasks go through many methods that each get their own connection object)
C.  Test that it actually works :P
2014-07-24 23:27:56 -04:00
SLiPCoR
d02058ca13 Update player name in case it has changed.
TODO: Check for double names if that happens? In general?
2014-07-24 19:31:38 +02:00
zreed
7d0fd36a2a Further cleanup of SQLDatabaseManager upgrades 2014-07-24 12:12:41 +02:00
TfT_02
1c4ac1d766 Remove hidden interval option 2014-07-24 12:12:41 +02:00
TfT_02
7861e93497 Fixed formatting! 2014-07-24 12:12:41 +02:00
TfT_02
7118f8850d Also update flatfile with uuids 2014-07-24 12:12:40 +02:00
zreed
384bb6306a Add saveUserUUIDs to FlatfileDatabaseManager so mcMMO compiles
Minimal changes were made but it hasn't been tested at all and almost certainly doesn't work.
2014-07-24 01:08:00 +02:00
zreed
8fd9982f69 Optimize SQL side of UUID update 2014-07-24 01:08:00 +02:00
SLiPCoR
c5e1a735f9 Check for uuids instead of usernames when loading a player 2014-07-24 01:08:00 +02:00
SLiPCoR
80754b4426 Add a new fallback method that does the exact same thing; add it when the retry on getting a UUID player would have failed twice 2014-07-24 01:08:00 +02:00
SLiPCoR
4524a3e437 Add saving of UUIDs (used in the UUID Fetcher update task) 2014-07-24 01:08:00 +02:00
TfT_02
83c8d3cdb9 Save if uuid conversion is complete 2014-07-24 01:08:00 +02:00
TfT_02
ed95cfcbfc Update to UUIDFetcher v3 2014-07-24 01:08:00 +02:00
TfT_02
69ebde052d Load UUID with SQL 2014-07-24 01:08:00 +02:00
TfT_02
072e7c8b19 Update playername in database when a name changes 2014-07-24 01:07:59 +02:00
TfT_02
792f21bc20 Save and load profiles using UUIDs
fall back on usernames if neccesary
2014-07-24 01:07:59 +02:00
TfT_02
e619e01c23 UUID flatfile stuff 2014-07-24 01:07:59 +02:00
TfT_02
e7d5aa17bf Add hidden options for uuid conversion 2014-07-24 01:07:59 +02:00
TfT_02
8d6f151a54 Deprecate PlayerProfiles relying on names 2014-07-24 01:07:59 +02:00
TfT_02
d3faff67ad UUID Conversion stuff 2014-07-24 01:07:59 +02:00
TfT_02
dc21e18cc2 Deprecate methods in ExperienceAPI 2014-07-24 01:07:59 +02:00
TfT_02
7643edfdcd Prepare for UUID update 2014-07-24 01:07:58 +02:00
155 changed files with 921 additions and 4473 deletions

View File

@@ -7,37 +7,17 @@ Key:
! Change ! Change
- Removal - Removal
Version 1.5.02-dev Version 1.5.01-dev
+ Added new active ability "Charge" to Taming!
+ Added option to config.yml for Chimaera Wings to stop using bed spawn points
= Fixed bug where no Mining XP was granted when Flux Mining was successful
= Fixed bug where MobHealthbarTypes were not saved between server restarts
! Changed Flux Mining mechanics. In order to use the ability, you need to infuse a pickaxe with furnace powers first.
! Scoreboard tips are only shown a couple of times to the player, instead of once per login session
Version 1.5.01
+ Added new child skill; Salvage + Added new child skill; Salvage
+ Added UUID support!
+ Added SQL connection pooling and async loading!
+ Added the long awaited Diminished Returns feature
+ Added new feature to Herbalism. Instantly-regrown crops are protected from being broken for 1 second + 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 to show the /mcstats scoreboard automatically after logging in
+ Added option to config.yml for Alchemy. Skills.Alchemy.Prevent_Hopper_Transfer_Bottles + Added option to config.yml for Alchemy. Skills.Alchemy.Prevent_Hopper_Transfer_Bottles
+ Added option to config.yml for Scoreboards, display "Ability" instead of ability names on the scoreboards
+ Added options to experience.yml for Dirt and Sand variations
+ Added support for `MATERIAL|data` format in treasures.yml + Added support for `MATERIAL|data` format in treasures.yml
+ Added API to experience events to get XP gain reason + Added API to experience events to get XP gain reason
+ Added API to check if an entity is bleeding + Added API to check if an entity is bleeding
+ Added API to ExperienceAPI to get the amount of XP needed for a level
+ Added API class SkillAPI used to get a list of valid skill names
+ Added API events for hardcore features, McMMOPlayerPreDeathPenaltyEvent, McMMOPlayerStatLossEvent and McMMOPlayerVampirismEvent
+ Added API to ExperienceAPI to specify if XP can be shared
+ Added options to tools.yml and armor.yml config files to set a pretty repair material name + Added options to tools.yml and armor.yml config files to set a pretty repair material name
+ Added full support for repairables in tools.yml and armor.yml config files + Added full support for repairables in tools.yml and armor.yml config files
+ Added magical mod config file import command, for Cauldron 1.7+. Check wiki for usage + Added new API class SkillAPI used to get a list of valid skill names
+ Added particle effects and sounds to "Call of the Wild" (Taming)
+ Added summon length to "Call of the Wild". Summons will now commit suicide after their lifespan expires
+ Added feature which makes tamed wolves attack a target shot by the owner
= Fixed bug where pistons would mess with the block tracking = Fixed bug where pistons would mess with the block tracking
= Fixed bug where the Updater was running on the main thread. = 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 when players would use /ptp without being in a party
@@ -55,7 +35,6 @@ Version 1.5.01
= Fixed bug where party chat was using non thread safe methods = Fixed bug where party chat was using non thread safe methods
= Fixed bug where Blast Mining unlock levels could be to high in certain occasions = Fixed bug where Blast Mining unlock levels could be to high in certain occasions
= Fixed bug where Blast Minings ability "Demolition Expert" would not work = Fixed bug where Blast Minings ability "Demolition Expert" would not work
= Fixed bug where Repair_Material_Quantity wasn't read in mod config files
! Changed SecondaryAbilityEvent to implement Cancellable and it now gets fired for damage related secondary abilities ! Changed SecondaryAbilityEvent to implement Cancellable and it now gets fired for damage related secondary abilities
! Changed the way mcMMO handles bonus damage, updated for the new damage event API ! Changed the way mcMMO handles bonus damage, updated for the new damage event API
! Changed player data saving. Save tasks are now asynchronous ! Changed player data saving. Save tasks are now asynchronous
@@ -64,9 +43,6 @@ Version 1.5.01
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion. ! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
! Changed behavior of the Blast Mining ability "Demolition Expert"; now only decreases damage for the ability user ! Changed behavior of the Blast Mining ability "Demolition Expert"; now only decreases damage for the ability user
! Updated for new getOnlinePlayers() behavior ! Updated for new getOnlinePlayers() behavior
! Updated for new blocks and entities
! Changed McMMOPlayerDeathPenaltyEvent to get fired after hardcore penalty calculations, use McMMOPlayerPreDeathPenaltyEvent for old behavior
! Moved Refresh_Chunks setting from hidden.yml to config.yml
- Removed salvage ability from Repair, salvage has it's own (child) skill now - Removed salvage ability from Repair, salvage has it's own (child) skill now
Version 1.5.00 Version 1.5.00

View File

@@ -1,8 +1,8 @@
# mcMMO # mcMMO
## The RPG lovers mod ## The RPG lovers mod
### Builds ### Dev builds
Currently, you can obtain our builds via the Spigot resource page: http://www.spigotmc.org/resources/mcmmo.2445/ 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 ### Brief Description
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update. 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.
@@ -10,10 +10,11 @@ The goal of mcMMO is to take core Minecraft game mechanics and expand them into
## About the Team ## About the Team
mcMMO is currently developed by a team of individuals from all over the world. mcMMO is currently developed by a team of individuals from all over the world.
### Glorious Leader
### Developers
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)] [![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)]
(https://github.com/gmcferrin) (https://github.com/gmcferrin)
### Developers
[![bm01](http://www.gravatar.com/avatar/ec8146f5358177f12e9a252271bbc391.png)] [![bm01](http://www.gravatar.com/avatar/ec8146f5358177f12e9a252271bbc391.png)]
(https://github.com/bm01) (https://github.com/bm01)
[![Glitchfinder](http://www.gravatar.com/avatar/5aa4cce22f72ae9c002ecec30f061d00.png)] [![Glitchfinder](http://www.gravatar.com/avatar/5aa4cce22f72ae9c002ecec30f061d00.png)]
@@ -47,4 +48,4 @@ Required Libraries:
* EMetrics * EMetrics
* Bukkit * Bukkit
http://www.spigotmc.org/resources/mcmmo.2445/ for more up to date information. http://dev.bukkit.org/server-mods/mcmmo for more up to date information.

View File

@@ -1,14 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Advanced Genetics 1.4.3
Bows:
# Genetic
X31179:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X31197
Repair_Material_Pretty_Name: "Cell"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 1501

View File

@@ -1,9 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Applied Energistics rv14-finale3
Mining:
# Certus Quartz Ore
X4076|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,65 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Applied Energistics rv14-finale3
Axes:
# Quartz
X4365:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X4362
Repair_Material_Pretty_Name: "Certus Quartz"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 3
Durability: 250
Hoes:
# Quartz
X4366:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X4362
Repair_Material_Pretty_Name: "Certus Quartz"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 2
Pickaxes:
# Quartz
X4368:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X4362
Repair_Material_Pretty_Name: "Certus Quartz"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 3
Durability: 250
Shovels:
# Quartz
X4367:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X4362
Repair_Material_Pretty_Name: "Certus Quartz"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 1
Durability: 750
Swords:
# Quartz
X4369:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X4362
Repair_Material_Pretty_Name: "Certus Quartz"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 2
Durability: 250

View File

@@ -1,9 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Big Reactors 0.3.4A2
Mining:
# Yellorite
X1750|0:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,77 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of BoP 1.2.1.434
Boots:
# Wading
X21269:
Repairable: false
Durability: 9999
# Muddy
X21283:
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4
Durability: 26
# Amethyst
X21293:
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4
Durability: 520
Chestplates:
# Muddy
X21281:
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8
Durability: 32
# Amethyst
X21291:
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8
Durability: 640
Helmets:
# Muddy
X21280:
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5
Durability: 22
# Amethyst
X21290:
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5
Durability: 440
Leggings:
# Muddy
X21280:
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7
Durability: 30
# Amethyst
X21290:
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7
Durability: 600

View File

@@ -1,44 +0,0 @@
# Config wrote by M1cr0man
# Incomplete! Only covers ores
# Up to date as of BoP 1.2.1.434
Mining:
# Red Rock
X162|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Amethyst
X1921|0:
XP_Gain: 200
Double_Drops_Enabled: true
Is_Ore: true
# Ruby
X1921|2:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Peridot
X1921|4:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Topaz
X1921|6:
XP_Gain: 200
Double_Drops_Enabled: true
Is_Ore: true
# Tanzanite
X1921|8:
XP_Gain: 200
Double_Drops_Enabled: true
Is_Ore: true
# Malachite
X1921|10:
XP_Gain: 200
Double_Drops_Enabled: true
Is_Ore: true
# Sapphire
X1921|12:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,121 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of BoP 1.2.1.434
Axes:
# Amethyst
X21287:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 2013
# Muddy
X21277:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 32
Hoes:
# Amethyst
X21288:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 2013
# Muddy
X21278:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 32
Pickaxes:
# Amethyst
X21286:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 2013
# Muddy
X21276:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 32
Shovels:
# Amethyst
X21285:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 2013
# Muddy
X21275:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 32
Swords:
# Amethyst
X21284:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X21264
Repair_Material_Pretty_Name: "Amethyst"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 2013
# Muddy
X21274:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 1
Repairable: true
Repair_Material: X21263
Repair_Material_Pretty_Name: "Mud Ball"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 32

View File

@@ -1,31 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Emasher Resource 1.2.3.5
Boots:
# Hemp
X9301:
Repairable: true
Repair_Material: X9291
Repair_Material_Pretty_Name: "Hemp"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4
Durability: 65
Chestplates:
# Hemp
X9299:
Repairable: true
Repair_Material: X9291
Repair_Material_Pretty_Name: "Hemp"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8
Durability: 80
Leggings:
# Hemp
X9300:
Repairable: true
Repair_Material: X9291
Repair_Material_Pretty_Name: "Hemp"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7
Durability: 75

View File

@@ -1,44 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Emasher Resource 1.2.3.5
Mining:
# Bauxite
X1565|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true
# Cassiterite
X1565|1:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Emery
X1565|2:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Galena
X1565|3:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true
# Native Copper
X1565|4:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Petlandite
X1565|5:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true
# Ruby
X1565|6:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Sapphire
X1565|7:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,54 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Extra Utilities 1.0.3c
Axes:
# Healing
X10264:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X10258
Repair_Material_Pretty_Name: "Unstable Ingot"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 1561
Hoes:
# Reversing
X10265:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: true
Repair_Material: X10258
Repair_Material_Pretty_Name: "Unstable Ingot"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 1561
Pickaxes:
# Destruction
X10263:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: false
Durability: 6244
Shovels:
# Erosion
X10262:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: false
Durability: 6244
Swords:
# Etheric
X10261:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 4
Repairable: false
Durability: 1561

View File

@@ -1,9 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Factorization 0.8.34
Mining:
# Dark Iron Ore
X1004|0:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,19 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Forestry 2.3.1.1
Mining:
# Apatite
X1398|0:
XP_Gain: 100
Double_Drops_Enabled: true
Is_Ore: true
# Copper
X1398|1:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Tin
X1398|2:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,27 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Forestry 2.3.1.1
Pickaxes:
# Survivalist
X13261:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X5261
Repair_Material_Pretty_Name: "Bronze Ingot"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 200
Shovels:
# Survivalist
X13264:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X5261
Repair_Material_Pretty_Name: "Bronze Ingot"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 200

View File

@@ -1,11 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Minefactory Reloaded 2.7.9 Final
Boots:
# Plastic
X12306:
Repairable: true
Repair_Material: X12249
Repair_Material_Pretty_Name: "Plastic Sheets"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4
Durability: 39

View File

@@ -1,41 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Natura 2.1.14
Boots:
# Impskin
X12712:
Repairable: true
Repair_Material: X12660
Repair_Material_Pretty_Name: "Imp Leather"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 4
Durability: 429
Chestplates:
# Impskin
X12710:
Repairable: true
Repair_Material: X12660
Repair_Material_Pretty_Name: "Imp Leather"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 8
Durability: 528
Helmets:
# Impskin
X12709:
Repairable: true
Repair_Material: X12660
Repair_Material_Pretty_Name: "Imp Leather"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 5
Durability: 363
Leggings:
# Impskin
X12709:
Repairable: true
Repair_Material: X12660
Repair_Material_Pretty_Name: "Imp Leather"
Repair_Material_Data_Value: 6
Repair_Material_Quantity: 7
Durability: 495

View File

@@ -1,272 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Natura 2.1.14
Axes:
# Bloodwood
X12685:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Bloodwood Planks"
Repair_Material_Data_Value: 4
Repair_Material_Quantity: 3
Durability: 350
# Darkwood
X12689:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Darkwood Planks"
Repair_Material_Data_Value: 11
Repair_Material_Quantity: 3
Durability: 131
# Fusewood
X12693:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Fusewood Planks"
Repair_Material_Data_Value: 12
Repair_Material_Quantity: 3
Durability: 250
# Ghostwood
X12681:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Ghostwood Planks"
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 3
Durability: 59
# Quartz
X12697:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: QUARTZ_BLOCK
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 131
Bows:
# Bloodwood
X12706:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X12677
Repair_Material_Pretty_Name: "Bloodwood Stick"
Repair_Material_Data_Value: 4
Repair_Material_Quantity: 3
Durability: 1501
# Darkwood
X12707:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X12677
Repair_Material_Pretty_Name: "Darkwood Stick"
Repair_Material_Data_Value: 11
Repair_Material_Quantity: 3
Durability: 162
# Fusewood
X12708:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X12677
Repair_Material_Pretty_Name: "Fusewood Stick"
Repair_Material_Data_Value: 12
Repair_Material_Quantity: 3
Durability: 28
# Ghostwood
X12705:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X12677
Repair_Material_Pretty_Name: "Ghostwood Stick"
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 3
Durability: 384
Pickaxes:
# Bloodwood
X12683:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Bloodwood Planks"
Repair_Material_Data_Value: 4
Repair_Material_Quantity: 3
Durability: 350
# Darkwood
X12687:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Darkwood Planks"
Repair_Material_Data_Value: 11
Repair_Material_Quantity: 3
Durability: 131
# Fusewood
X12691:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Fusewood Planks"
Repair_Material_Data_Value: 12
Repair_Material_Quantity: 3
Durability: 250
# Ghostwood
X12679:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Ghostwood Planks"
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 3
Durability: 59
# Quartz
X12695:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: QUARTZ_BLOCK
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 3
Durability: 131
Shovels:
# Bloodwood
X12684:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Bloodwood Planks"
Repair_Material_Data_Value: 4
Repair_Material_Quantity: 1
Durability: 350
# Darkwood
X12688:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Darkwood Planks"
Repair_Material_Data_Value: 11
Repair_Material_Quantity: 1
Durability: 131
# Fusewood
X12692:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Fusewood Planks"
Repair_Material_Data_Value: 12
Repair_Material_Quantity: 1
Durability: 250
# Ghostwood
X12680:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Ghostwood Planks"
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 1
Durability: 59
# Quartz
X12696:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: QUARTZ_BLOCK
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 1
Durability: 131
Swords:
# Bloodwood
X12682:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Bloodwood Planks"
Repair_Material_Data_Value: 4
Repair_Material_Quantity: 2
Durability: 350
# Darkwood
X12686:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Darkwood Planks"
Repair_Material_Data_Value: 11
Repair_Material_Quantity: 2
Durability: 131
# Fusewood
X12690:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Fusewood Planks"
Repair_Material_Data_Value: 12
Repair_Material_Quantity: 2
Durability: 250
# Ghostwood
X12678:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: X3262
Repair_Material_Pretty_Name: "Ghostwood Planks"
Repair_Material_Data_Value: 2
Repair_Material_Quantity: 2
Durability: 59
# Quartz
X12694:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: true
Repair_Material: QUARTZ_BLOCK
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 131

View File

@@ -1,29 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Project Red 4.3.5.30
Mining:
# Ruby
X2130|0:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Sapphire
X2130|1:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Peridot
X2130|2:
XP_Gain: 350
Double_Drops_Enabled: true
Is_Ore: true
# Marble
X2131|0:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false
# Basalt
X2131|3:
XP_Gain: 30
Double_Drops_Enabled: true
Is_Ore: false

View File

@@ -1,176 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Project Red 4.3.5.30
Axes:
# Ruby
X9353:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Ruby"
Repair_Material_Data_Value: 37
Repair_Material_Quantity: 3
Durability: 500
# Sapphire
X9354:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Sapphire"
Repair_Material_Data_Value: 38
Repair_Material_Quantity: 3
Durability: 500
# Peridot
X9355:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Peridot"
Repair_Material_Data_Value: 39
Repair_Material_Quantity: 3
Durability: 500
Hoes:
# Ruby
X9356:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Ruby"
Repair_Material_Data_Value: 37
Repair_Material_Quantity: 2
Durability: 500
# Sapphire
X9357:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Sapphire"
Repair_Material_Data_Value: 38
Repair_Material_Quantity: 2
Durability: 500
# Peridot
X9358:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Peridot"
Repair_Material_Data_Value: 39
Repair_Material_Quantity: 2
Durability: 500
Pickaxes:
# Ruby
X9359:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Ruby"
Repair_Material_Data_Value: 37
Repair_Material_Quantity: 3
Durability: 500
# Sapphire
X9360:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Sapphire"
Repair_Material_Data_Value: 38
Repair_Material_Quantity: 3
Durability: 500
# Peridot
X9361:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Peridot"
Repair_Material_Data_Value: 39
Repair_Material_Quantity: 3
Durability: 500
Shovels:
# Ruby
X9362:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Ruby"
Repair_Material_Data_Value: 37
Repair_Material_Quantity: 1
Durability: 500
# Sapphire
X9363:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Sapphire"
Repair_Material_Data_Value: 38
Repair_Material_Quantity: 1
Durability: 500
# Peridot
X9364:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Peridot"
Repair_Material_Data_Value: 39
Repair_Material_Quantity: 1
Durability: 500
Swords:
# Ruby
X9365:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Ruby"
Repair_Material_Data_Value: 37
Repair_Material_Quantity: 2
Durability: 500
# Sapphire
X9366:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Sapphire"
Repair_Material_Data_Value: 38
Repair_Material_Quantity: 2
Durability: 500
# Peridot
X9368:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X9281
Repair_Material_Pretty_Name: "Peridot"
Repair_Material_Data_Value: 39
Repair_Material_Quantity: 2
Durability: 500

View File

@@ -1,49 +1,44 @@
# Config wrote by Dragyn, updated by M1cr0man # Config created by Dragyn
# Up to date as of Railcraft 8.4.0.0 # Created For Railcraft_1.6.2-8.1.0.0
#
#
# Settings for Boots
###
Boots: Boots:
# Steel
X7758: X7758:
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4 Repair_Material_Quantity: 2
Durability: 325 Durability: 500
#
# Settings for Chestplates
###
Chestplates: Chestplates:
# Steel
X7761: X7761:
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8 Repair_Material_Quantity: 2
Durability: 400 Durability: 500
#
# Settings for Helmets
###
Helmets: Helmets:
# Steel
X7759: X7759:
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5 Repair_Material_Quantity: 2
Durability: 275 Durability: 500
#
# Settings for Leggings
###
Leggings: Leggings:
# Steel
X7760: X7760:
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7 Repair_Material_Quantity: 2
Durability: 375 Durability: 500
# Overalls
X7757:
Repairable: true
Repair_Material: WOOL
Repair_Material_Pretty_Name: "Light Blue Wool"
Repair_Material_Data_Value: 3
Repair_Material_Quantity: 7
Durability: 75

View File

@@ -1,66 +1,76 @@
# Config wrote by Dragyn, updated by M1cr0man # Config created by Dragyn
# Up to date as of Railcraft 8.4.0.0 # Created For Railcraft_1.6.2-8.1.0.0
#
#
# Settings for Axes
###
Axes: Axes:
# Steel # Steel
X7819: X7819:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 500 Durability: 500
#
# Settings for Hoes
###
Hoes: Hoes:
# Steel # Steel
X7820: X7820:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 500 Durability: 500
#
# Settings for Pickaxes
###
Pickaxes: Pickaxes:
# Steel # Steel
X7821: X7821:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 500 Durability: 500
#
# Settings for Shovels
###
Shovels: Shovels:
# Steel # Steel
X7823: X7823:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 500 Durability: 500
#
# Settings for Swords
###
Swords: Swords:
# Steel # Steel
X7824: X7824:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X7796 Repair_Material: X7796
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 500 Durability: 500

View File

@@ -1,9 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Stargate Tech 2 Alpha 0.7.3
Mining:
# Naquadah Ore
X1005|0:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,41 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Thermal Expansion 3.0.0.7
Boots:
# Invar
X31973:
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 4
Durability: 325
Chestplates:
# Invar
X31975:
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 8
Durability: 400
Helmets:
# Invar
X31976:
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 5
Durability: 275
Leggings:
# Invar
X31976:
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 7
Durability: 375

View File

@@ -1,29 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Thermal Expansion 3.0.0.7
Mining:
# Copper
X4064|0:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Tin
X4064|1:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Silver
X4064|2:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true
# Lead
X4064|3:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true
# Ferrous
X4064|4:
XP_Gain: 300
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,66 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Thermal Expansion 3.0.0.7
Axes:
# Invar
X31969:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 3
Durability: 450
Hoes:
# Invar
X31968:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 2
Durability: 450
Pickaxes:
# Invar
X31970:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 3
Durability: 450
Shovels:
# Invar
X31971:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 1
Durability: 450
Swords:
# Invar
X31972:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 3
Repairable: true
Repair_Material: X31978
Repair_Material_Pretty_Name: "Invar Ingot"
Repair_Material_Data_Value: 71
Repair_Material_Quantity: 2
Durability: 450

View File

@@ -1,74 +0,0 @@
# Config wrote by M1cr0man
# Up to date as of Tinker's Construct 1.5.5.7
# Also covers Tinker's Steelworks 0.0.4.2-fix2
Boots:
# Wooden (Repaired with Oak Wood)
X14366:
Repairable: true
Repair_Material: LOG
Repair_Material_Pretty_Name: "Oak Wood"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4
Durability: 26
# Steel
X14771:
Repairable: true
Repair_Material: X14276
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 16
Repair_Material_Quantity: 4
Durability: 325
Chestplates:
# Wooden (Repaired with Oak Wood)
X14364:
Repairable: true
Repair_Material: LOG
Repair_Material_Pretty_Name: "Oak Wood"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8
Durability: 32
# Steel
X14769:
Repairable: true
Repair_Material: X14276
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 16
Repair_Material_Quantity: 8
Durability: 400
Helmets:
# Wooden (Repaired with Oak Wood)
X14362:
Repairable: true
Repair_Material: LOG
Repair_Material_Pretty_Name: "Oak Wood"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5
Durability: 22
# Steel
X14768:
Repairable: true
Repair_Material: X14276
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 16
Repair_Material_Quantity: 5
Durability: 275
Leggings:
# Wooden (Repaired with Oak Wood)
X14362:
Repairable: true
Repair_Material: LOG
Repair_Material_Pretty_Name: "Oak Wood"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7
Durability: 30
# Steel
X14768:
Repairable: true
Repair_Material: X14276
Repair_Material_Pretty_Name: "Steel Ingot"
Repair_Material_Data_Value: 16
Repair_Material_Quantity: 7
Durability: 375

View File

@@ -1,55 +0,0 @@
# Config wrote by M1cr0man
# Possibly incomplete. Only covers ores
# Up to date as of Tinker's Construct 1.5.5.7
Excavation:
# Iron
X1488|0:
XP_Gain: 250
Double_Drops_Enabled: true
# Gold
X1488|1:
XP_Gain: 350
Double_Drops_Enabled: true
# Copper
X1488|2:
XP_Gain: 175
Double_Drops_Enabled: true
# Tin
X1488|3:
XP_Gain: 175
Double_Drops_Enabled: true
# Aluminum
X1488|4:
XP_Gain: 250
Double_Drops_Enabled: true
# Cobalt
X1488|5:
XP_Gain: 500
Double_Drops_Enabled: true
Mining:
# Cobalt
X1475|1:
XP_Gain: 500
Double_Drops_Enabled: true
Is_Ore: true
# Ardite
X1475|2:
XP_Gain: 500
Double_Drops_Enabled: true
Is_Ore: true
# Copper
X1475|3:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Tin
X1475|4:
XP_Gain: 175
Double_Drops_Enabled: true
Is_Ore: true
# Aluminium
X1475|5:
XP_Gain: 250
Double_Drops_Enabled: true
Is_Ore: true

View File

@@ -1,149 +0,0 @@
# Config wrote by M1cr0man
# Abilites for Pickaxes and Shovels disabled due to a bug
# Repair disabled as mcMMO does not support NBTTag - based tools
# Up to date as of Tinker's Construct 1.5.5.7
# Also covers Tinker's Steelworks 0.0.4.2-fix2
Axes:
# Hatchets
X14309:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Mattocks
X14316:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Lumber Axes
X14317:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Battle Axes
X14327:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
Bows:
# Shortbows
X14319:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
Hoes:
# Mattocks
X14316:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Scythes
X14323:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
Pickaxes:
# Pickaxes
X14307:
XP_Modifier: 1.0
Ability_Enabled: false
Tier: 2
Repairable: false
Durability: 500
# Hammers
X14326:
XP_Modifier: 1.0
Ability_Enabled: false
Tier: 2
Repairable: false
Durability: 500
Shovels:
# Shovels
X14308:
XP_Modifier: 1.0
Ability_Enabled: false
Tier: 2
Repairable: false
Durability: 500
# Mattocks
X14316:
XP_Modifier: 1.0
Ability_Enabled: false
Tier: 2
Repairable: false
Durability: 500
# Excavators
X14325:
XP_Modifier: 1.0
Ability_Enabled: false
Tier: 2
Repairable: false
Durability: 500
Swords:
# Broadswords
X14311:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Longswords
X14312:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Rapiers
X14313:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Daggers
X14321:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Cleavers
X14324:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Battle Axes
X14327:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500
# Cutlasses
X14328:
XP_Modifier: 1.0
Ability_Enabled: true
Tier: 2
Repairable: false
Durability: 500

View File

@@ -1,161 +1,134 @@
# Config wrote by Dragyn, updated by M1cr0man # Config created by Dragyn
# Up to date as of Twilight Forest 1.20.5 # Created For twilightforest-1.20.3
Boots: #
#
# Settings for Boots
###
Boots:
# Ironwood # Ironwood
X27978: X27978:
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4 Repair_Material_Quantity: 2
Durability: 260 Durability: 500
# Fiery # Fiery
X27995: X27995:
Repairable: true Repairable: true
Repair_Material: X27991 Repair_Material: X27991
Repair_Material_Pretty_Name: "Fiery Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4 Repair_Material_Quantity: 2
Durability: 325 Durability: 500
# Stealeaf # Stealeaf
X28002: X28002:
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4 Repair_Material_Quantity: 2
Durability: 260 Durability: 500
# Knightmetal # Knightmetal
X28037: X28037:
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 4 Repair_Material_Quantity: 2
Durability: 260 Durability: 500
#
# Settings for Chestplates
###
Chestplates: Chestplates:
# Ironwood # Ironwood
X27976: X27976:
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8 Repair_Material_Quantity: 2
Durability: 320 Durability: 500
# Naga Scale
X27958:
Repairable: true
Repair_Material: X27957
Repair_Material_Pretty_Name: "Naga Scale"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8
Durability: 336
# Fiery # Fiery
X27993: X27993:
Repairable: true Repairable: true
Repair_Material: X27991 Repair_Material: X27991
Repair_Material_Pretty_Name: "Fiery Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8 Repair_Material_Quantity: 2
Durability: 400 Durability: 500
# Stealeaf # Stealeaf
X28000: X28000:
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8 Repair_Material_Quantity: 2
Durability: 320 Durability: 500
# Knightmetal # Knightmetal
X28035: X28035:
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 8 Repair_Material_Quantity: 2
Durability: 320 Durability: 500
# Phantom
X28035:
Repairable: false
Durability: 480
#
# Settings for Helmets
###
Helmets: Helmets:
# Ironwood # Ironwood
X27975: X27975:
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5 Repair_Material_Quantity: 2
Durability: 220 Durability: 500
# Fiery # Fiery
X27992: X27992:
Repairable: true Repairable: true
Repair_Material: X27991 Repair_Material: X27991
Repair_Material_Pretty_Name: "Fiery Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5 Repair_Material_Quantity: 2
Durability: 275 Durability: 500
# Stealeaf # Stealeaf
X27999: X27999:
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5 Repair_Material_Quantity: 2
Durability: 220 Durability: 500
# Knightmetal # Knightmetal
X28034: X28034:
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 5 Repair_Material_Quantity: 2
Durability: 220 Durability: 500
# Phantom
X28034:
Repairable: false
Durability: 330
#
# Settings for Leggings
###
Leggings: Leggings:
# Ironwood # Ironwood
X27977: X27977:
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7 Repair_Material_Quantity: 2
Durability: 300 Durability: 500
# Naga Scale
X27959:
Repairable: true
Repair_Material: X27957
Repair_Material_Pretty_Name: "Naga Scale"
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7
Durability: 315
# Fiery # Fiery
X27994: X27994:
Repairable: true Repairable: true
Repair_Material: X27991 Repair_Material: X27991
Repair_Material_Pretty_Name: "Fiery Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7 Repair_Material_Quantity: 2
Durability: 375 Durability: 500
# Stealeaf # Stealeaf
X28001: X28001:
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7 Repair_Material_Quantity: 2
Durability: 300 Durability: 500
# Knightmetal # Knightmetal
X28036: X28036:
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 7 Repair_Material_Quantity: 2
Durability: 300 Durability: 500

View File

@@ -1,181 +1,186 @@
# Config wrote by Dragyn, updated by M1cr0man # Config created by Dragyn
# Up to date as of Twilight Forest 1.20.5 # Created For twilightforest-1.20.3
#
#
# Settings for Axes
###
Axes: Axes:
# Ironwood # Ironwood
X27982: X27982:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
# Steeleaf # Steeleaf
X28006: X31989:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 131 Durability: 500
# Knightmetal # Knightmetal
X28040: X28040:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
# Minotaur # Minotaur
X28008: X31984:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: false Repairable: true
Durability: 1561 Repair_Material: X264
Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2
Durability: 500
#
# Settings for Hoes
###
Hoes: Hoes:
# Ironwood # Ironwood
X27983: X27983:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
# Steeleaf # Steeleaf
X28007: X31988:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 131 Durability: 500
#
# Settings for Pickaxes
###
Pickaxes: Pickaxes:
# Ironwood # Ironwood
X27981: X27981:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
# Fiery # Fiery
X27997: X27997:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27991 Repair_Material: X27991
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 1024 Durability: 500
# Steeleaf # Steeleaf
X28005: X28005:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 131 Durability: 500
# Knightmetal # Knightmetal
X28039: X28039:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
#
# Settings for Shovels
###
Shovels: Shovels:
# Ironwood # Ironwood
X27980: X27980:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
# Steeleaf # Steeleaf
X28004: X28004:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 131 Durability: 500
#
# Settings for Swords
###
Swords: Swords:
# Ironwood # Ironwood
X27979: X27979:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27974 Repair_Material: X27974
Repair_Material_Pretty_Name: "Ironwood Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500
# Fiery # Fiery
X27996: X27996:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27991 Repair_Material: X27991
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 1024 Durability: 500
# Steeleaf # Steeleaf
X28003: X28003:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X27998 Repair_Material: X27998
Repair_Material_Pretty_Name: "Steeleaf"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 131 Durability: 500
# Knightmetal # Knightmetal
X28038: X28038:
XP_Modifier: 1.0 XP_Modifer: 1.0
Ability_Enabled: true Ability_Enabled: true
Tier: 1 Tier: 1
Repairable: true Repairable: true
Repair_Material: X28032 Repair_Material: X28032
Repair_Material_Pretty_Name: "Knightmetal Ingot"
Repair_Material_Data_Value: 0 Repair_Material_Data_Value: 0
Repair_Material_Quantity: 2 Repair_Material_Quantity: 2
Durability: 512 Durability: 500

42
pom.xml
View File

@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId> <groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId> <artifactId>mcMMO</artifactId>
<version>1.5.02-SNAPSHOT</version> <version>1.5.01-SNAPSHOT</version>
<name>mcMMO</name> <name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url> <url>https://github.com/mcMMO-Dev/mcMMO</url>
<issueManagement> <issueManagement>
@@ -77,8 +77,7 @@
<includes> <includes>
<include>com.turt2live.metrics:MetricsExtension</include> <include>com.turt2live.metrics:MetricsExtension</include>
<include>commons-logging:commons-logging</include> <include>commons-logging:commons-logging</include>
<include>org.apache.tomcat:tomcat-jdbc</include> <include>net.snaq:dbpool</include>
<include>org.apache.tomcat:tomcat-juli</include>
</includes> </includes>
</artifactSet> </artifactSet>
<relocations> <relocations>
@@ -91,12 +90,8 @@
<shadedPattern>com.gmail.nossr50.commons.logging</shadedPattern> <shadedPattern>com.gmail.nossr50.commons.logging</shadedPattern>
</relocation> </relocation>
<relocation> <relocation>
<pattern>org.apache.juli</pattern> <pattern>net.snaq</pattern>
<shadedPattern>com.gmail.nossr50.database.tomcat.juli</shadedPattern> <shadedPattern>com.gmail.nossr50.dbpool</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.tomcat</pattern>
<shadedPattern>com.gmail.nossr50.database.tomcat</shadedPattern>
</relocation> </relocation>
</relocations> </relocations>
</configuration> </configuration>
@@ -120,8 +115,12 @@
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>spigot-repo</id> <id>bukkit-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url> <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>
<repository> <repository>
<id>Plugin MetricsExtension</id> <id>Plugin MetricsExtension</id>
@@ -132,9 +131,9 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.8-R0.1-SNAPSHOT</version> <version>LATEST</version>
<type>jar</type> <type>jar</type>
<scope>provided</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@@ -148,23 +147,26 @@
<version>0.0.5-SNAPSHOT</version> <version>0.0.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.tomcat</groupId> <groupId>net.snaq</groupId>
<artifactId>tomcat-jdbc</artifactId> <artifactId>dbpool</artifactId>
<version>7.0.52</version> <version>5.1</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>drtshock-releases</id> <id>md_5-releases</id>
<url>https://ci.drtshock.net/plugin/repository/everything/com/gmail/nossr50/mcMMO/</url> <url>http://repo.md-5.net/content/repositories/releases/</url>
</repository> </repository>
<snapshotRepository>
<id>md_5-snapshots</id>
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement> </distributionManagement>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<ciManagement> <ciManagement>
<system>Jenkins</system> <system>Jenkins</system>
<url>https://ci.drtshock.net/job/mcmmo/</url> <url>http://ci.ecocitycraft.com/job/mcMMO</url>
</ciManagement> </ciManagement>
</project> </project>

View File

@@ -6,15 +6,11 @@ import java.util.UUID;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.api.exceptions.InvalidFormulaTypeException;
import com.gmail.nossr50.api.exceptions.InvalidPlayerException; import com.gmail.nossr50.api.exceptions.InvalidPlayerException;
import com.gmail.nossr50.api.exceptions.InvalidSkillException; import com.gmail.nossr50.api.exceptions.InvalidSkillException;
import com.gmail.nossr50.api.exceptions.InvalidXPGainReasonException; import com.gmail.nossr50.api.exceptions.InvalidXPGainReasonException;
import com.gmail.nossr50.api.exceptions.McMMOPlayerNotFoundException;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason; import com.gmail.nossr50.datatypes.skills.XPGainReason;
@@ -88,30 +84,7 @@ public final class ExperienceAPI {
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/ */
public static void addRawXP(Player player, String skillType, float XP, String xpGainReason) { public static void addRawXP(Player player, String skillType, float XP, String xpGainReason) {
addRawXP(player, skillType, XP, xpGainReason, false); UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
}
/**
* 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
* @param isUnshared true if the XP cannot be shared with party members
*
* @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, boolean isUnshared) {
if (isUnshared) {
getPlayer(player).beginUnsharedXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
return;
}
getPlayer(player).applyXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
} }
/** /**
@@ -193,7 +166,7 @@ public final class ExperienceAPI {
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/ */
public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) { public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) {
getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason)); UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
} }
/** /**
@@ -243,32 +216,9 @@ public final class ExperienceAPI {
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/ */
public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason) { public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason) {
addModifiedXP(player, skillType, XP, xpGainReason, false);
}
/**
* 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
* @param isUnshared true if the XP cannot be shared with party members
*
* @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, boolean isUnshared) {
SkillType skill = getSkillType(skillType); SkillType skill = getSkillType(skillType);
if (isUnshared) { UserManager.getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
getPlayer(player).beginUnsharedXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
return;
}
getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
} }
/** /**
@@ -322,31 +272,7 @@ public final class ExperienceAPI {
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid
*/ */
public static void addXP(Player player, String skillType, int XP, String xpGainReason) { public static void addXP(Player player, String skillType, int XP, String xpGainReason) {
addXP(player, skillType, XP, xpGainReason, false); UserManager.getPlayer(player).beginXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
}
/**
* 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
* @param isUnshared true if the XP cannot be shared with party members
*
* @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, boolean isUnshared) {
if (isUnshared) {
getPlayer(player).beginUnsharedXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
return;
}
getPlayer(player).beginXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
} }
/** /**
@@ -362,7 +288,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill * @throws UnsupportedOperationException if the given skill is a child skill
*/ */
public static int getXP(Player player, String skillType) { public static int getXP(Player player, String skillType) {
return getPlayer(player).getSkillXpLevel(getNonChildSkillType(skillType)); return UserManager.getPlayer(player).getSkillXpLevel(getNonChildSkillType(skillType));
} }
/** /**
@@ -413,7 +339,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill * @throws UnsupportedOperationException if the given skill is a child skill
*/ */
public static float getXPRaw(Player player, String skillType) { public static float getXPRaw(Player player, String skillType) {
return getPlayer(player).getSkillXpLevelRaw(getNonChildSkillType(skillType)); return UserManager.getPlayer(player).getSkillXpLevelRaw(getNonChildSkillType(skillType));
} }
/** /**
@@ -464,7 +390,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill * @throws UnsupportedOperationException if the given skill is a child skill
*/ */
public static int getXPToNextLevel(Player player, String skillType) { public static int getXPToNextLevel(Player player, String skillType) {
return getPlayer(player).getXpToLevel(getNonChildSkillType(skillType)); return UserManager.getPlayer(player).getXpToLevel(getNonChildSkillType(skillType));
} }
/** /**
@@ -517,7 +443,7 @@ public final class ExperienceAPI {
public static int getXPRemaining(Player player, String skillType) { public static int getXPRemaining(Player player, String skillType) {
SkillType skill = getNonChildSkillType(skillType); SkillType skill = getNonChildSkillType(skillType);
PlayerProfile profile = getPlayer(player).getProfile(); PlayerProfile profile = UserManager.getPlayer(player).getProfile();
return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill); return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
} }
@@ -575,7 +501,7 @@ public final class ExperienceAPI {
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
*/ */
public static void addLevel(Player player, String skillType, int levels) { public static void addLevel(Player player, String skillType, int levels) {
getPlayer(player).addLevels(getSkillType(skillType), levels); UserManager.getPlayer(player).addLevels(getSkillType(skillType), levels);
} }
/** /**
@@ -653,7 +579,7 @@ public final class ExperienceAPI {
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
*/ */
public static int getLevel(Player player, String skillType) { public static int getLevel(Player player, String skillType) {
return getPlayer(player).getSkillLevel(getSkillType(skillType)); return UserManager.getPlayer(player).getSkillLevel(getSkillType(skillType));
} }
/** /**
@@ -698,7 +624,7 @@ public final class ExperienceAPI {
* @return the power level of the player * @return the power level of the player
*/ */
public static int getPowerLevel(Player player) { public static int getPowerLevel(Player player) {
return getPlayer(player).getPowerLevel(); return UserManager.getPlayer(player).getPowerLevel();
} }
/** /**
@@ -849,7 +775,7 @@ public final class ExperienceAPI {
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
*/ */
public static void setLevel(Player player, String skillType, int skillLevel) { public static void setLevel(Player player, String skillType, int skillLevel) {
getPlayer(player).modifySkill(getSkillType(skillType), skillLevel); UserManager.getPlayer(player).modifySkill(getSkillType(skillType), skillLevel);
} }
/** /**
@@ -898,7 +824,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill * @throws UnsupportedOperationException if the given skill is a child skill
*/ */
public static void setXP(Player player, String skillType, int newValue) { public static void setXP(Player player, String skillType, int newValue) {
getPlayer(player).setSkillXpLevel(getNonChildSkillType(skillType), newValue); UserManager.getPlayer(player).setSkillXpLevel(getNonChildSkillType(skillType), newValue);
} }
/** /**
@@ -949,7 +875,7 @@ public final class ExperienceAPI {
* @throws UnsupportedOperationException if the given skill is a child skill * @throws UnsupportedOperationException if the given skill is a child skill
*/ */
public static void removeXP(Player player, String skillType, int xp) { public static void removeXP(Player player, String skillType, int xp) {
getPlayer(player).removeXp(getNonChildSkillType(skillType), xp); UserManager.getPlayer(player).removeXp(getNonChildSkillType(skillType), xp);
} }
/** /**
@@ -987,33 +913,6 @@ public final class ExperienceAPI {
getOfflineProfile(uuid).removeXp(getNonChildSkillType(skillType), xp); getOfflineProfile(uuid).removeXp(getNonChildSkillType(skillType), xp);
} }
/**
* Check how much XP is needed for a specific level with the selected level curve.
* </br>
* This function is designed for API usage.
*
* @param level The level to get the amount of XP for
*
* @throws InvalidFormulaTypeException if the given formulaType is not valid
*/
public static int getXpNeededToLevel(int level) {
return mcMMO.getFormulaManager().getCachedXpToLevel(level, ExperienceConfig.getInstance().getFormulaType());
}
/**
* Check how much XP is needed for a specific level with the provided level curve.
* </br>
* This function is designed for API usage.
*
* @param level The level to get the amount of XP for
* @param formulaType The formula type to get the amount of XP for
*
* @throws InvalidFormulaTypeException if the given formulaType is not valid
*/
public static int getXpNeededToLevel(int level, String formulaType) {
return mcMMO.getFormulaManager().getCachedXpToLevel(level, getFormulaType(formulaType));
}
// Utility methods follow. // Utility methods follow.
private static void addOfflineXP(UUID playerUniqueId, SkillType skill, int XP) { private static void addOfflineXP(UUID playerUniqueId, SkillType skill, int XP) {
PlayerProfile profile = getOfflineProfile(playerUniqueId); PlayerProfile profile = getOfflineProfile(playerUniqueId);
@@ -1081,22 +980,4 @@ public final class ExperienceAPI {
return xpGainReason; return xpGainReason;
} }
private static FormulaType getFormulaType(String formula) throws InvalidFormulaTypeException {
FormulaType formulaType = FormulaType.getFormulaType(formula);
if (formulaType == null) {
throw new InvalidFormulaTypeException();
}
return formulaType;
}
private static McMMOPlayer getPlayer(Player player) throws McMMOPlayerNotFoundException {
if (!UserManager.hasPlayerDataKey(player)) {
throw new McMMOPlayerNotFoundException(player);
}
return UserManager.getPlayer(player);
}
} }

View File

@@ -1,17 +1,14 @@
package com.gmail.nossr50.api; package com.gmail.nossr50.api;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.UUID;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyLeader;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
@@ -82,7 +79,7 @@ public final class PartyAPI {
Party party = PartyManager.getParty(partyName); Party party = PartyManager.getParty(partyName);
if (party == null) { if (party == null) {
party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName); party = new Party(player.getName(), partyName);
} }
PartyManager.addToParty(UserManager.getPlayer(player), party); PartyManager.addToParty(UserManager.getPlayer(player), party);
@@ -108,7 +105,7 @@ public final class PartyAPI {
* @return the leader of the party * @return the leader of the party
*/ */
public static String getPartyLeader(String partyName) { public static String getPartyLeader(String partyName) {
return PartyManager.getPartyLeaderName(partyName); return PartyManager.getPartyLeader(partyName);
} }
/** /**
@@ -117,11 +114,10 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param partyName The name of the party to set the leader of * @param partyName The name of the party to set the leader of
* @param playerName The playerName to set as leader * @param player The player to set as leader
*/ */
@Deprecated public static void setPartyLeader(String partyName, String player) {
public static void setPartyLeader(String partyName, String playerName) { PartyManager.setPartyLeader(player, PartyManager.getParty(partyName));
PartyManager.setPartyLeader(mcMMO.p.getServer().getOfflinePlayer(playerName).getUniqueId(), PartyManager.getParty(partyName));
} }
/** /**
@@ -136,8 +132,8 @@ public final class PartyAPI {
public static List<OfflinePlayer> getOnlineAndOfflineMembers(Player player) { public static List<OfflinePlayer> getOnlineAndOfflineMembers(Player player) {
List<OfflinePlayer> members = new ArrayList<OfflinePlayer>(); List<OfflinePlayer> members = new ArrayList<OfflinePlayer>();
for (UUID memberUniqueId : PartyManager.getAllMembers(player).keySet()) { for (String memberName : PartyManager.getAllMembers(player)) {
OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberUniqueId); OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberName);
members.add(member); members.add(member);
} }
return members; return members;
@@ -151,20 +147,7 @@ public final class PartyAPI {
* @param player The player to check * @param player The player to check
* @return all the player names in the player's party * @return all the player names in the player's party
*/ */
@Deprecated
public static LinkedHashSet<String> getMembers(Player player) { public static LinkedHashSet<String> getMembers(Player player) {
return (LinkedHashSet<String>) PartyManager.getAllMembers(player).values();
}
/**
* Get a list of all player names and uuids in this player's party.
* </br>
* This function is designed for API usage.
*
* @param player The player to check
* @return all the player names and uuids in the player's party
*/
public static LinkedHashMap<UUID, String> getMembersMap(Player player) {
return PartyManager.getAllMembers(player); return PartyManager.getAllMembers(player);
} }

View File

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

View File

@@ -1,11 +0,0 @@
package com.gmail.nossr50.api.exceptions;
import org.bukkit.entity.Player;
public class McMMOPlayerNotFoundException extends RuntimeException {
private static final long serialVersionUID = 761917904993202836L;
public McMMOPlayerNotFoundException(Player player) {
super("McMMOPlayer object was not found for: " + player.getName() + " " + player.getUniqueId());
}
}

View File

@@ -29,10 +29,6 @@ public class KrakenCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
UserManager.getPlayer(sender.getName()).getFishingManager().unleashTheKraken(); UserManager.getPlayer(sender.getName()).getFishingManager().unleashTheKraken();
return true; return true;

View File

@@ -1,351 +0,0 @@
package com.gmail.nossr50.commands;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.skills.ModConfigType;
import com.gmail.nossr50.util.Misc;
public class McImportCommand implements CommandExecutor {
int fileAmount;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
importModConfig();
return true;
default:
return false;
}
}
public boolean importModConfig() {
String importFilePath = mcMMO.getModDirectory() + File.separator + "import";
File importFile = new File(importFilePath, "import.log");
mcMMO.p.getLogger().info("Starting import of mod materials...");
fileAmount = 0;
HashMap<ModConfigType, ArrayList<String>> materialNames = new HashMap<ModConfigType, ArrayList<String>>();
BufferedReader in = null;
try {
// Open the file
in = new BufferedReader(new FileReader(importFile));
String line;
String materialName;
String modName;
// While not at the end of the file
while ((line = in.readLine()) != null) {
String[] split1 = line.split("material ");
if (split1.length != 2) {
continue;
}
String[] split2 = split1[1].split(" with");
if (split2.length != 2) {
continue;
}
materialName = split2[0];
// Categorise each material under a mod config type
ModConfigType type = ModConfigType.getModConfigType(materialName);
if (!materialNames.containsKey(type)) {
materialNames.put(type, new ArrayList<String>());
}
materialNames.get(type).add(materialName);
continue;
}
}
catch (FileNotFoundException e) {
mcMMO.p.getLogger().warning("Could not find " + importFile.getAbsolutePath() + " ! (No such file or directory)");
mcMMO.p.getLogger().warning("Copy and paste latest.log to " + importFile.getParentFile().getAbsolutePath() + " and rename it to import.log");
return false;
}
catch (Exception e) {
e.printStackTrace();
return false;
}
finally {
tryClose(in);
}
createOutput(materialNames);
mcMMO.p.getLogger().info("Import finished! Created " + fileAmount + " files!");
return true;
}
private void createOutput(HashMap<ModConfigType, ArrayList<String>> materialNames) {
for (ModConfigType modConfigType : materialNames.keySet()) {
HashMap<String, ArrayList<String>> materialNamesType = new HashMap<String, ArrayList<String>>();
for (String materialName : materialNames.get(modConfigType)) {
String modName = Misc.getModName(materialName);
if (!materialNamesType.containsKey(modName)) {
materialNamesType.put(modName, new ArrayList<String>());
}
materialNamesType.get(modName).add(materialName);
}
createOutput(modConfigType, materialNamesType);
}
}
private void tryClose(Closeable c) {
if (c == null) {
return;
}
try {
c.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
private void createOutput(ModConfigType modConfigType, HashMap<String, ArrayList<String>> materialNames) {
File outputFilePath = new File(mcMMO.getModDirectory() + File.separator + "output");
if (!outputFilePath.exists() && !outputFilePath.mkdirs()) {
mcMMO.p.getLogger().severe("Could not create output directory! " + outputFilePath.getAbsolutePath());
}
FileWriter out = null;
String type = modConfigType.name().toLowerCase();
for (String modName : materialNames.keySet()) {
File outputFile = new File(outputFilePath, modName + "." + type + ".yml");
mcMMO.p.getLogger().info("Creating " + outputFile.getName());
try {
if (outputFile.exists() && !outputFile.delete()) {
mcMMO.p.getLogger().severe("Not able to delete old output file! " + outputFile.getAbsolutePath());
}
if (!outputFile.createNewFile()) {
mcMMO.p.getLogger().severe("Could not create output file! " + outputFile.getAbsolutePath());
continue;
}
StringBuilder writer = new StringBuilder();
HashMap<String, ArrayList<String>> configSections = getConfigSections(modConfigType, modName, materialNames);
if (configSections == null) {
mcMMO.p.getLogger().severe("Something went wrong!! type is " + type);
return;
}
// Write the file, go through each skill and write all the materials
for (String configSection : configSections.keySet()) {
if (configSection.equals("UNIDENTIFIED")) {
writer.append("# This isn't a valid config section and all materials in this category need to be").append("\r\n");
writer.append("# copy and pasted to a valid section of this config file.").append("\r\n");
}
writer.append(configSection).append(":").append("\r\n");
for (String line : configSections.get(configSection)) {
writer.append(line).append("\r\n");
}
writer.append("\r\n");
}
out = new FileWriter(outputFile);
out.write(writer.toString());
}
catch (IOException e) {
e.printStackTrace();
return;
}
catch (Exception e) {
e.printStackTrace();
return;
}
finally {
tryClose(out);
fileAmount++;
}
}
}
private HashMap<String, ArrayList<String>> getConfigSections(ModConfigType type, String modName, HashMap<String, ArrayList<String>> materialNames) {
switch (type) {
case BLOCKS:
return getConfigSectionsBlocks(modName, materialNames);
case TOOLS:
return getConfigSectionsTools(modName, materialNames);
case ARMOR:
return getConfigSectionsArmor(modName, materialNames);
case UNKNOWN:
return getConfigSectionsUnknown(modName, materialNames);
}
return null;
}
private HashMap<String, ArrayList<String>> getConfigSectionsBlocks(String modName, HashMap<String, ArrayList<String>> materialNames) {
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
// Go through all the materials and categorise them under a skill
for (String materialName : materialNames.get(modName)) {
String skillName = "UNIDENTIFIED";
if (materialName.contains("ORE")) {
skillName = "Mining";
}
else if (materialName.contains("LOG") || materialName.contains("LEAVES")) {
skillName = "Woodcutting";
}
else if (materialName.contains("GRASS") || materialName.contains("FLOWER") || materialName.contains("CROP")) {
skillName = "Herbalism";
}
else if (materialName.contains("DIRT") || materialName.contains("SAND")) {
skillName = "Excavation";
}
if (!configSections.containsKey(skillName)) {
configSections.put(skillName, new ArrayList<String>());
}
ArrayList<String> skillContents = configSections.get(skillName);
skillContents.add(" " + materialName + "|0:");
skillContents.add(" " + " " + "XP_Gain: 99");
skillContents.add(" " + " " + "Double_Drops_Enabled: true");
if (skillName.equals("Mining")) {
skillContents.add(" " + " " + "Smelting_XP_Gain: 9");
}
else if (skillName.equals("Woodcutting")) {
skillContents.add(" " + " " + "Is_Log: " + materialName.contains("LOG"));
}
}
return configSections;
}
private HashMap<String, ArrayList<String>> getConfigSectionsTools(String modName, HashMap<String, ArrayList<String>> materialNames) {
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
// Go through all the materials and categorise them under a tool type
for (String materialName : materialNames.get(modName)) {
String toolType = "UNIDENTIFIED";
if (materialName.contains("PICKAXE")) {
toolType = "Pickaxes";
}
else if (materialName.contains("AXE")) {
toolType = "Axes";
}
else if (materialName.contains("BOW")) {
toolType = "Bows";
}
else if (materialName.contains("HOE")) {
toolType = "Hoes";
}
else if (materialName.contains("SHOVEL") || materialName.contains("SPADE")) {
toolType = "Shovels";
}
else if (materialName.contains("SWORD")) {
toolType = "Swords";
}
if (!configSections.containsKey(toolType)) {
configSections.put(toolType, new ArrayList<String>());
}
ArrayList<String> skillContents = configSections.get(toolType);
skillContents.add(" " + materialName + ":");
skillContents.add(" " + " " + "XP_Modifier: 1.0");
skillContents.add(" " + " " + "Tier: 1");
skillContents.add(" " + " " + "Ability_Enabled: true");
addRepairableLines(materialName, skillContents);
}
return configSections;
}
private HashMap<String, ArrayList<String>> getConfigSectionsArmor(String modName, HashMap<String, ArrayList<String>> materialNames) {
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
// Go through all the materials and categorise them under an armor type
for (String materialName : materialNames.get(modName)) {
String toolType = "UNIDENTIFIED";
if (materialName.contains("BOOT") || materialName.contains("SHOE")) {
toolType = "Boots";
}
else if (materialName.contains("CHESTPLATE") || materialName.contains("CHEST")) {
toolType = "Chestplates";
}
else if (materialName.contains("HELM") || materialName.contains("HAT")) {
toolType = "Helmets";
}
else if (materialName.contains("LEGGINGS") || materialName.contains("LEGS") || materialName.contains("PANTS")) {
toolType = "Leggings";
}
if (!configSections.containsKey(toolType)) {
configSections.put(toolType, new ArrayList<String>());
}
ArrayList<String> skillContents = configSections.get(toolType);
skillContents.add(" " + materialName + ":");
addRepairableLines(materialName, skillContents);
}
return configSections;
}
private void addRepairableLines(String materialName, ArrayList<String> skillContents) {
skillContents.add(" " + " " + "Repairable: true");
skillContents.add(" " + " " + "Repair_Material: REPAIR_MATERIAL_NAME");
skillContents.add(" " + " " + "Repair_Material_Data_Value: 0");
skillContents.add(" " + " " + "Repair_Material_Quantity: 9");
skillContents.add(" " + " " + "Repair_Material_Pretty_Name: Repair Item Name");
skillContents.add(" " + " " + "Repair_MinimumLevel: 0");
skillContents.add(" " + " " + "Repair_XpMultiplier: 1.0");
Material material = Material.matchMaterial(materialName);
short durability = (material == null) ? (short) 9999 : material.getMaxDurability();
skillContents.add(" " + " " + "Durability: " + ((durability > 0) ? durability : (short) 9999));
}
private HashMap<String, ArrayList<String>> getConfigSectionsUnknown(String modName, HashMap<String, ArrayList<String>> materialNames) {
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
// Go through all the materials and print them
for (String materialName : materialNames.get(modName)) {
String configKey = "UNIDENTIFIED";
if (!configSections.containsKey(configKey)) {
configSections.put(configKey, new ArrayList<String>());
}
ArrayList<String> skillContents = configSections.get(configKey);
skillContents.add(" " + materialName);
}
return configSections;
}
}

View File

@@ -27,7 +27,7 @@ public class McmmoCommand implements CommandExecutor {
if (Config.getInstance().getDonateMessageEnabled()) { if (Config.getInstance().getDonateMessageEnabled()) {
sender.sendMessage(LocaleLoader.getString("MOTD.Donate")); sender.sendMessage(LocaleLoader.getString("MOTD.Donate"));
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "tft_02@hotmail.com" + ChatColor.GOLD + " Paypal"); sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "gjmcferrin@gmail.com" + ChatColor.GOLD + " Paypal");
} }
if (Permissions.showversion(sender)) { if (Permissions.showversion(sender)) {

View File

@@ -37,10 +37,6 @@ public class MobhealthCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) { switch (args.length) {
case 1: case 1:
try { try {

View File

@@ -28,10 +28,6 @@ public abstract class ToggleCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
applyCommandAction(UserManager.getPlayer(sender.getName())); applyCommandAction(UserManager.getPlayer(sender.getName()));
return true; return true;

View File

@@ -41,10 +41,6 @@ public abstract class ChatCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
mcMMOPlayer = UserManager.getPlayer(sender.getName()); mcMMOPlayer = UserManager.getPlayer(sender.getName());
if (mcMMOPlayer.isChatEnabled(chatMode)) { if (mcMMOPlayer.isChatEnabled(chatMode)) {
@@ -57,10 +53,6 @@ public abstract class ChatCommand implements TabExecutor {
return true; return true;
case 1: case 1:
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
if (CommandUtils.shouldEnableToggle(args[0])) { if (CommandUtils.shouldEnableToggle(args[0])) {
if (CommandUtils.noConsoleUsage(sender)) { if (CommandUtils.noConsoleUsage(sender)) {
return true; return true;

View File

@@ -62,7 +62,7 @@ public class ConvertDatabaseCommand implements CommandExecutor {
mcMMO.getDatabaseManager().saveUser(profile); mcMMO.getDatabaseManager().saveUser(profile);
} }
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading new PlayerProfileLoadingTask(player).runTaskTimerAsynchronously(mcMMO.p, 1, 20); // 1 Tick delay to ensure the player is marked as online before we begin loading
} }
new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p); new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p);

View File

@@ -38,7 +38,7 @@ public class ConvertExperienceCommand implements CommandExecutor {
new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1); new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1);
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading new PlayerProfileLoadingTask(player).runTaskTimerAsynchronously(mcMMO.p, 1, 20); // 1 Tick delay to ensure the player is marked as online before we begin loading
} }
return true; return true;

View File

@@ -1,12 +1,10 @@
package com.gmail.nossr50.commands.party; package com.gmail.nossr50.commands.party;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
@@ -20,14 +18,13 @@ public class PartyChangeOwnerCommand implements CommandExecutor {
case 2: case 2:
Party playerParty = UserManager.getPlayer((Player) sender).getParty(); Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = CommandUtils.getMatchedPlayerName(args[1]); String targetName = CommandUtils.getMatchedPlayerName(args[1]);
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);
if (!playerParty.hasMember(target.getUniqueId())) { if (!playerParty.getMembers().contains(targetName)) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
return true; return true;
} }
PartyManager.setPartyLeader(target.getUniqueId(), playerParty); PartyManager.setPartyLeader(targetName, playerParty);
return true; return true;
default: default:

View File

@@ -71,11 +71,6 @@ public class PartyCommand implements TabExecutor {
} }
Player player = (Player) sender; Player player = (Player) sender;
if (!UserManager.hasPlayerDataKey(player)) {
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (args.length < 1) { if (args.length < 1) {
@@ -134,7 +129,7 @@ public class PartyCommand implements TabExecutor {
} }
// Party leader commands // Party leader commands
if (!mcMMOPlayer.getParty().getLeader().getUniqueId().equals(player.getUniqueId())) { if (!mcMMOPlayer.getParty().getLeader().equalsIgnoreCase(player.getName())) {
sender.sendMessage(LocaleLoader.getString("Party.NotOwner")); sender.sendMessage(LocaleLoader.getString("Party.NotOwner"));
return true; return true;
} }

View File

@@ -22,7 +22,7 @@ public class PartyKickCommand implements CommandExecutor {
Party playerParty = UserManager.getPlayer((Player) sender).getParty(); Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = CommandUtils.getMatchedPlayerName(args[1]); String targetName = CommandUtils.getMatchedPlayerName(args[1]);
if (!playerParty.hasMember(targetName)) { if (!playerParty.getMembers().contains(targetName)) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
return true; return true;
} }

View File

@@ -36,7 +36,7 @@ public class PartyRenameCommand implements CommandExecutor {
return true; return true;
} }
String leaderName = playerParty.getLeader().getPlayerName(); String leaderName = playerParty.getLeader();
for (Player member : playerParty.getOnlineMembers()) { for (Player member : playerParty.getOnlineMembers()) {
if (!PartyManager.handlePartyChangeEvent(member, oldPartyName, newPartyName, EventReason.CHANGED_PARTIES)) { if (!PartyManager.handlePartyChangeEvent(member, oldPartyName, newPartyName, EventReason.CHANGED_PARTIES)) {

View File

@@ -44,7 +44,7 @@ public class PartyAllianceInviteCommand implements CommandExecutor {
return true; return true;
} }
if (!mcMMOTarget.getParty().getLeader().getUniqueId().equals(target.getUniqueId())) { if (!mcMMOTarget.getParty().getLeader().equalsIgnoreCase(targetName)) {
player.sendMessage(LocaleLoader.getString("Party.Target.NotOwner", targetName)); player.sendMessage(LocaleLoader.getString("Party.Target.NotOwner", targetName));
return true; return true;
} }

View File

@@ -42,11 +42,6 @@ public class PtpCommand implements TabExecutor {
} }
Player player = (Player) sender; Player player = (Player) sender;
if (!UserManager.hasPlayerDataKey(player)) {
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (!mcMMOPlayer.inParty()) { if (!mcMMOPlayer.inParty()) {

View File

@@ -34,10 +34,6 @@ public class InspectCommand implements TabExecutor {
if (mcMMOPlayer == null) { if (mcMMOPlayer == null) {
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false); // Temporary Profile PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false); // Temporary Profile
if (!CommandUtils.isLoaded(sender, profile)) {
return true;
}
if (CommandUtils.inspectOffline(sender, profile, Permissions.inspectOffline(sender))) { if (CommandUtils.inspectOffline(sender, profile, Permissions.inspectOffline(sender))) {
return true; return true;
} }

View File

@@ -24,10 +24,6 @@ public class MccooldownCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) { switch (args.length) {
case 0: case 0:
Player player = (Player) sender; Player player = (Player) sender;

View File

@@ -7,7 +7,6 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor; import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@@ -35,10 +34,6 @@ public class McrankCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
display(sender, sender.getName()); display(sender, sender.getName());
return true; return true;
@@ -49,10 +44,6 @@ public class McrankCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = CommandUtils.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName); McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
@@ -97,13 +88,6 @@ public class McrankCommand implements TabExecutor {
return; return;
} }
if (((Player) sender).hasMetadata(mcMMO.databaseCommandKey)) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Processing"));
return;
} else {
((Player) sender).setMetadata(mcMMO.databaseCommandKey, new FixedMetadataValue(mcMMO.p, null));
}
mcMMOPlayer.actualizeDatabaseATS(); mcMMOPlayer.actualizeDatabaseATS();
} }

View File

@@ -22,10 +22,6 @@ public class McstatsCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) { switch (args.length) {
case 0: case 0:
Player player = (Player) sender; Player player = (Player) sender;

View File

@@ -7,7 +7,6 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor; import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@@ -20,6 +19,7 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils; import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class MctopCommand implements TabExecutor { public class MctopCommand implements TabExecutor {
@@ -83,10 +83,6 @@ public class MctopCommand implements TabExecutor {
} }
if (sender instanceof Player) { if (sender instanceof Player) {
if (!CommandUtils.hasPlayerDataKey(sender)) {
return;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName()); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750); long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
@@ -95,13 +91,6 @@ public class MctopCommand implements TabExecutor {
return; return;
} }
if (((Player) sender).hasMetadata(mcMMO.databaseCommandKey)) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Processing"));
return;
} else {
((Player) sender).setMetadata(mcMMO.databaseCommandKey, new FixedMetadataValue(mcMMO.p, null));
}
mcMMOPlayer.actualizeDatabaseATS(); mcMMOPlayer.actualizeDatabaseATS();
} }

View File

@@ -48,10 +48,6 @@ public abstract class SkillCommand implements TabExecutor {
return true; return true;
} }
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) { switch (args.length) {
case 0: case 0:
Player player = (Player) sender; Player player = (Player) sender;

View File

@@ -12,13 +12,11 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.taming.Taming; import com.gmail.nossr50.skills.taming.Taming;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
public class TamingCommand extends SkillCommand { public class TamingCommand extends SkillCommand {
private String goreChance; private String goreChance;
private String goreChanceLucky; private String goreChanceLucky;
private boolean canCharge;
private boolean canBeastLore; private boolean canBeastLore;
private boolean canGore; private boolean canGore;
private boolean canSharpenedClaws; private boolean canSharpenedClaws;
@@ -44,7 +42,6 @@ public class TamingCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(Player player) { protected void permissionsCheck(Player player) {
canCharge = Permissions.charge(player);
canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BEAST_LORE); canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BEAST_LORE);
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT); canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ENVIROMENTALLY_AWARE); canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ENVIROMENTALLY_AWARE);
@@ -60,10 +57,6 @@ public class TamingCommand extends SkillCommand {
protected List<String> effectsDisplay() { protected List<String> effectsDisplay() {
List<String> messages = new ArrayList<String>(); List<String> messages = new ArrayList<String>();
if (canCharge) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.20"), LocaleLoader.getString("Taming.Effect.21")));
}
if (canBeastLore) { if (canBeastLore) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1"))); messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1")));
} }
@@ -98,13 +91,9 @@ public class TamingCommand extends SkillCommand {
if (canCallWild) { if (canCallWild) {
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13"))); messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13")));
int costOcelot = Config.getInstance().getTamingCOTWCost(EntityType.OCELOT); messages.add(LocaleLoader.getString("Taming.Effect.14", Config.getInstance().getTamingCOTWCost(EntityType.OCELOT)));
String itemOcelot = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)); messages.add(LocaleLoader.getString("Taming.Effect.15", Config.getInstance().getTamingCOTWCost(EntityType.WOLF)));
int costWolf = Config.getInstance().getTamingCOTWCost(EntityType.WOLF); messages.add(LocaleLoader.getString("Taming.Effect.20", Config.getInstance().getTamingCOTWCost(EntityType.HORSE)));
String itemWolf = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF));
int costHorse = Config.getInstance().getTamingCOTWCost(EntityType.HORSE);
String itemHorse = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE));
messages.add(LocaleLoader.getString("Taming.Effect.14", costOcelot, itemOcelot, costWolf, itemWolf, costHorse, itemHorse));
} }
return messages; return messages;

View File

@@ -200,7 +200,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
} }
if (getSkullSplitterModifier() < 1) { if (getSkullSplitterModifier() < 1) {
reason.add("Skills.Axes.SkullSplitter.DamageModifier should be at least 1!"); reason.add("Skills.Axes.SkullSplitter.DamagerModifier should be at least 1!");
} }
/* FISHING */ /* FISHING */
@@ -420,8 +420,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Salvage.MaxPercentageLevel should be at least 1!"); reason.add("Skills.Salvage.MaxPercentageLevel should be at least 1!");
} }
if (getAdvancedSalvageUnlockLevel() < 0) { if (getAdvancedSalvageUnlockLevel() < 1) {
reason.add("Skills.Salvage.AdvancedSalvage.UnlockLevel should be at least 0!"); reason.add("Skills.Salvage.AdvancedSalvage.UnlockLevel should be at least 1!");
} }
List<Salvage.Tier> salvageTierList = Arrays.asList(Salvage.Tier.values()); List<Salvage.Tier> salvageTierList = Arrays.asList(Salvage.Tier.values());
@@ -442,8 +442,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != Salvage.Tier.EIGHT) { if (tier != Salvage.Tier.EIGHT) {
Salvage.Tier nextTier = salvageTierList.get(salvageTierList.indexOf(tier) - 1); Salvage.Tier nextTier = salvageTierList.get(salvageTierList.indexOf(tier) - 1);
if (getArcaneSalvageRankLevel(tier) > getArcaneSalvageRankLevel(nextTier)) { if (getArcaneSalvageRankLevel(tier) >= getArcaneSalvageRankLevel(nextTier)) {
reason.add("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); 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)) { if (getArcaneSalvageExtractFullEnchantsChance(tier) > getArcaneSalvageExtractFullEnchantsChance(nextTier)) {
@@ -733,7 +733,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public double getImpactChance() { return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); } public double getImpactChance() { return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); }
public double getArmorImpactMaxDurabilityDamage() { return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); } public double getArmorImpactMaxDurabilityDamage() { return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); }
public double getSkullSplitterModifier() { return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); } public double getSkullSplitterModifier() { return config.getDouble("Skills.Axes.SkullSplitter.DamagerModifier", 2.0D); }
/* EXCAVATION */ /* EXCAVATION */
//Nothing to configure, everything is already configurable in config.yml //Nothing to configure, everything is already configurable in config.yml
@@ -802,9 +802,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); } public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
/* SWORDS */ /* SWORDS */
public double getBleedDamagePlayer() { return config.getDouble("Skills.Swords.Bleed.DamagePlayer", 1.0); }
public double getBleedDamageMobs() { return config.getDouble("Skills.Swords.Bleed.DamageMobs", 2.0); }
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); } public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); } public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }

View File

@@ -9,7 +9,6 @@ import org.bukkit.TreeSpecies;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import com.gmail.nossr50.database.SQLDatabaseManager.PoolIdentifier;
import com.gmail.nossr50.datatypes.MobHealthbarType; import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.party.PartyFeature; import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.AbilityType;
@@ -42,16 +41,6 @@ public class Config extends AutoUpdateConfigLoader {
reason.add("General.Save_Interval should be greater than 0!"); reason.add("General.Save_Interval should be greater than 0!");
} }
/* MySQL Settings */
for (PoolIdentifier identifier : PoolIdentifier.values()) {
if (getMySQLMaxConnections(identifier) <= 0) {
reason.add("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
}
if (getMySQLMaxPoolSize(identifier) <= 0) {
reason.add("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
}
}
/* Mob Healthbar */ /* Mob Healthbar */
if (getMobHealthbarTime() == 0) { if (getMobHealthbarTime() == 0) {
reason.add("Mob_Healthbar.Display_Time cannot be 0! Set to -1 to disable or set a valid value."); reason.add("Mob_Healthbar.Display_Time cannot be 0! Set to -1 to disable or set a valid value.");
@@ -263,7 +252,6 @@ public class Config extends AutoUpdateConfigLoader {
public long getDatabasePlayerCooldown() { return config.getLong("Commands.Database.Player_Cooldown", 1750); } public long getDatabasePlayerCooldown() { return config.getLong("Commands.Database.Player_Cooldown", 1750); }
public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); } public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); }
public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); }
/* Mob Healthbar */ /* Mob Healthbar */
public MobHealthbarType getMobHealthbarDefault() { public MobHealthbarType getMobHealthbarDefault() {
@@ -280,10 +268,8 @@ public class Config extends AutoUpdateConfigLoader {
/* Scoreboards */ /* Scoreboards */
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); } public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); } public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); }
public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); } public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); }
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); } public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); }
public boolean getRankUseChat() { return config.getBoolean("Scoreboard.Types.Rank.Print", false); } public boolean getRankUseChat() { return config.getBoolean("Scoreboard.Types.Rank.Print", false); }
public boolean getRankUseBoard() { return config.getBoolean("Scoreboard.Types.Rank.Board", true); } public boolean getRankUseBoard() { return config.getBoolean("Scoreboard.Types.Rank.Board", true); }
@@ -328,8 +314,8 @@ public class Config extends AutoUpdateConfigLoader {
public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); } public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); } public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); } public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
public int getMySQLMaxConnections(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); } public int getMySQLMaxConnections() { return config.getInt("MySQL.Database.MaxConnections"); }
public int getMySQLMaxPoolSize(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); } public int getMySQLMaxPoolSize() { return config.getInt("MySQL.Database.MaxPoolSize"); }
private String getStringIncludingInts(String key) { private String getStringIncludingInts(String key) {
String str = config.getString(key); String str = config.getString(key);
@@ -373,23 +359,17 @@ public class Config extends AutoUpdateConfigLoader {
public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); } public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); }
public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); }
public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); } public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); }
public boolean getChimaeraUseBedSpawn() { return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); }
public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); } public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); }
public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); } public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); }
public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); } public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); }
public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); } public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); }
public boolean getFluxPickaxeEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Enabled", true); }
public boolean getFluxPickaxeSoundEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); }
/* Particles */ /* Particles */
public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); } public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); }
public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); } public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); }
public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); } public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
public boolean getFluxEffectEnabled() { return config.getBoolean("Particles.Flux", true); } public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); } public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); }
public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); }
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); } public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); } public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); }
public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); } public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); }
@@ -503,8 +483,6 @@ public class Config extends AutoUpdateConfigLoader {
public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); } 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 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 int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); }
public int getTamingCOTWLength(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Length"); }
public int getTamingCOTWMaxAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Max_Amount"); }
public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); } public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); }
/* Woodcutting */ /* Woodcutting */

View File

@@ -6,17 +6,16 @@ import com.gmail.nossr50.mcMMO;
public class HiddenConfig { public class HiddenConfig {
private static HiddenConfig instance; private static HiddenConfig instance;
private String fileName; private static String fileName;
private YamlConfiguration config; private static YamlConfiguration config;
private boolean chunkletsEnabled; private static boolean chunkletsEnabled;
private int conversionRate; private static int conversionRate;
private boolean useEnchantmentBuffs; private static boolean useEnchantmentBuffs;
private int uuidConvertAmount; private static boolean resendChunksAfterBlockAbility;
private int mojangRateLimit; private static int uuidConvertAmount;
private long mojangLimitPeriod;
public HiddenConfig(String fileName) { public HiddenConfig(String fileName) {
this.fileName = fileName; HiddenConfig.fileName = fileName;
load(); load();
} }
@@ -34,9 +33,8 @@ public class HiddenConfig {
chunkletsEnabled = config.getBoolean("Options.Chunklets", true); chunkletsEnabled = config.getBoolean("Options.Chunklets", true);
conversionRate = config.getInt("Options.ConversionRate", 1); conversionRate = config.getInt("Options.ConversionRate", 1);
useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true); useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true);
resendChunksAfterBlockAbility = config.getBoolean("Options.RefreshChunks", false);
uuidConvertAmount = config.getInt("Options.UUIDConvertAmount", 5); uuidConvertAmount = config.getInt("Options.UUIDConvertAmount", 5);
mojangRateLimit = config.getInt("Options.MojangRateLimit", 50000);
mojangLimitPeriod = config.getLong("Options.MojangLimitPeriod", 600000);
} }
} }
@@ -52,15 +50,11 @@ public class HiddenConfig {
return useEnchantmentBuffs; return useEnchantmentBuffs;
} }
public boolean resendChunksAfterBlockAbility() {
return resendChunksAfterBlockAbility;
}
public int getUUIDConvertAmount() { public int getUUIDConvertAmount() {
return uuidConvertAmount; return uuidConvertAmount;
} }
public int getMojangRateLimit() {
return mojangRateLimit;
}
public long getMojangLimitPeriod() {
return mojangLimitPeriod;
}
} }

View File

@@ -179,11 +179,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Custom XP perk */ /* Custom XP perk */
public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); } public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); }
/* Diminished Returns */
public boolean getDiminishedReturnsEnabled() { return config.getBoolean("Diminished_Returns.Enabled", false); }
public int getDiminishedReturnsThreshold(SkillType skill) { return config.getInt("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); }
public int getDiminishedReturnsTimeInterval() { return config.getInt("Diminished_Returns.Time_Interval", 10); }
/* Conversion */ /* Conversion */
public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); } public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); }
@@ -198,7 +193,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); }
public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); } public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); } public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
public double getElderGuardianXP() { return config.getDouble("Experience.Combat.Multiplier.Elder_Guardian", 4.0); }
/* Materials */ /* Materials */
public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); } public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
@@ -213,41 +207,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Alchemy */ /* Alchemy */
public double getPotionXP(PotionStage stage) { return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); } public double getPotionXP(PotionStage stage) { return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); }
/* Excavation */
public int getDirtAndSandXp(MaterialData data) {
Material type = data.getItemType();
if (type == Material.DIRT) {
switch (data.getData()) {
case 0x0:
return config.getInt("Experience.Excavation.Dirt", 40);
case 0x1:
return config.getInt("Experience.Excavation.Coarse_Dirt", 40);
case 0x2:
return config.getInt("Experience.Excavation.Podzol", 40);
default:
return 0;
}
}
else if (type == Material.SAND) {
switch (data.getData()) {
case 0x0:
return config.getInt("Experience.Excavation.Sand", 40);
case 0x1:
return config.getInt("Experience.Excavation.Red_Sand", 40);
default:
return 0;
}
}
return 0;
}
/* Fishing */ /* Fishing */
public int getFishXp(MaterialData data) { public int getFishXp(MaterialData data) {
switch (data.getData()) { switch (data.getData()) {
@@ -369,5 +328,4 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public int getWoodcuttingTreeXP(TreeSpecies species) { return config.getInt("Experience.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); } 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 getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); } public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
} }

View File

@@ -72,7 +72,7 @@ public class CustomArmorConfig extends ConfigLoader {
boolean repairable = config.getBoolean(armorType + "." + armorName + ".Repairable"); boolean repairable = config.getBoolean(armorType + "." + armorName + ".Repairable");
Material repairMaterial = Material.matchMaterial(config.getString(armorType + "." + armorName + ".Repair_Material", "")); Material repairMaterial = Material.matchMaterial(config.getString(armorType + "." + armorName + ".Repair_Material", ""));
if (repairable && (repairMaterial == null)) { if (repairMaterial == null) {
plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName); plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName);
repairable = false; repairable = false;
} }
@@ -82,7 +82,7 @@ public class CustomArmorConfig extends ConfigLoader {
int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(armorMaterial), repairMaterial, repairData); int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(armorMaterial), repairMaterial, repairData);
if (repairQuantity == 0) { if (repairQuantity == 0) {
repairQuantity = config.getInt(armorType + "." + armorName + ".Repair_Material_Quantity", 2); repairQuantity = config.getInt(armorType + "." + armorName + ".Repair_Material_Data_Quantity", 2);
} }
String repairItemName = config.getString(armorType + "." + armorName + ".Repair_Material_Pretty_Name"); String repairItemName = config.getString(armorType + "." + armorName + ".Repair_Material_Pretty_Name");

View File

@@ -80,7 +80,7 @@ public class CustomToolConfig extends ConfigLoader {
boolean repairable = config.getBoolean(toolType + "." + toolName + ".Repairable"); boolean repairable = config.getBoolean(toolType + "." + toolName + ".Repairable");
Material repairMaterial = Material.matchMaterial(config.getString(toolType + "." + toolName + ".Repair_Material", "")); Material repairMaterial = Material.matchMaterial(config.getString(toolType + "." + toolName + ".Repair_Material", ""));
if (repairable && (repairMaterial == null)) { if (repairMaterial == null) {
plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + toolName); plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + toolName);
repairable = false; repairable = false;
} }
@@ -90,7 +90,7 @@ public class CustomToolConfig extends ConfigLoader {
int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(toolMaterial), repairMaterial, repairData); int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(toolMaterial), repairMaterial, repairData);
if (repairQuantity == 0) { if (repairQuantity == 0) {
repairQuantity = config.getInt(toolType + "." + toolName + ".Repair_Material_Quantity", 2); repairQuantity = config.getInt(toolType + "." + toolName + ".Repair_Material_Data_Quantity", 2);
} }
String repairItemName = config.getString(toolType + "." + toolName + ".Repair_Material_Pretty_Name"); String repairItemName = config.getString(toolType + "." + toolName + ".Repair_Material_Pretty_Name");

View File

@@ -5,7 +5,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@@ -118,14 +117,11 @@ public class PotionConfig extends ConfigLoader {
short dataValue = Short.parseShort(potion_section.getName()); short dataValue = Short.parseShort(potion_section.getName());
String name = potion_section.getString("Name"); String name = potion_section.getString("Name");
if (name != null) {
name = ChatColor.translateAlternateColorCodes('&', name);
}
List<String> lore = new ArrayList<String>(); List<String> lore = new ArrayList<String>();
if (potion_section.contains("Lore")) { if (potion_section.contains("Lore")) {
for (String line : potion_section.getStringList("Lore")) { for (String line : potion_section.getStringList("Lore")) {
lore.add(ChatColor.translateAlternateColorCodes('&', line)); lore.add(line);
} }
} }

View File

@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@@ -57,7 +56,6 @@ public class TreasureConfig extends ConfigLoader {
public List<ShakeTreasure> shakeFromMushroomCow = new ArrayList<ShakeTreasure>(); public List<ShakeTreasure> shakeFromMushroomCow = new ArrayList<ShakeTreasure>();
public List<ShakeTreasure> shakeFromPig = new ArrayList<ShakeTreasure>(); public List<ShakeTreasure> shakeFromPig = new ArrayList<ShakeTreasure>();
public List<ShakeTreasure> shakeFromPigZombie = new ArrayList<ShakeTreasure>(); public List<ShakeTreasure> shakeFromPigZombie = new ArrayList<ShakeTreasure>();
public List<ShakeTreasure> shakeFromPlayer = new ArrayList<ShakeTreasure>();
public List<ShakeTreasure> shakeFromSheep = new ArrayList<ShakeTreasure>(); public List<ShakeTreasure> shakeFromSheep = new ArrayList<ShakeTreasure>();
public List<ShakeTreasure> shakeFromSkeleton = new ArrayList<ShakeTreasure>(); public List<ShakeTreasure> shakeFromSkeleton = new ArrayList<ShakeTreasure>();
public List<ShakeTreasure> shakeFromSlime = new ArrayList<ShakeTreasure>(); public List<ShakeTreasure> shakeFromSlime = new ArrayList<ShakeTreasure>();
@@ -176,11 +174,6 @@ public class TreasureConfig extends ConfigLoader {
else if (materialName.contains("INK_SACK")) { else if (materialName.contains("INK_SACK")) {
material = Material.INK_SACK; material = Material.INK_SACK;
} }
else if (materialName.contains("INVENTORY")) {
// Use magic material BED_BLOCK to know that we're grabbing something from the inventory and not a normal treasure
shakeFromPlayer.add(new ShakeTreasure(new ItemStack(Material.BED_BLOCK, 1, (byte) 0), 1, getInventoryStealDropChance(), getInventoryStealDropLevel()));
continue;
}
else { else {
material = Material.matchMaterial(materialName); material = Material.matchMaterial(materialName);
} }
@@ -243,22 +236,6 @@ public class TreasureConfig extends ConfigLoader {
try { try {
item = new Potion(PotionType.valueOf(potionType.toUpperCase().trim())).toItemStack(amount); item = new Potion(PotionType.valueOf(potionType.toUpperCase().trim())).toItemStack(amount);
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name")));
item.setItemMeta(itemMeta);
}
if (config.contains(type + "." + treasureName + ".Lore")) {
ItemMeta itemMeta = item.getItemMeta();
List<String> lore = new ArrayList<String>();
for (String s : config.getStringList(type + "." + treasureName + ".Lore")) {
lore.add(ChatColor.translateAlternateColorCodes('&', s));
}
itemMeta.setLore(lore);
item.setItemMeta(itemMeta);
}
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
reason.add("Invalid Potion_Type: " + potionType); reason.add("Invalid Potion_Type: " + potionType);
@@ -272,22 +249,6 @@ public class TreasureConfig extends ConfigLoader {
dye.setColor(DyeColor.valueOf(color.toUpperCase().trim())); dye.setColor(DyeColor.valueOf(color.toUpperCase().trim()));
item = dye.toItemStack(amount); item = dye.toItemStack(amount);
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name")));
item.setItemMeta(itemMeta);
}
if (config.contains(type + "." + treasureName + ".Lore")) {
ItemMeta itemMeta = item.getItemMeta();
List<String> lore = new ArrayList<String>();
for (String s : config.getStringList(type + "." + treasureName + ".Lore")) {
lore.add(ChatColor.translateAlternateColorCodes('&', s));
}
itemMeta.setLore(lore);
item.setItemMeta(itemMeta);
}
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
reason.add("Invalid Dye_Color: " + color); reason.add("Invalid Dye_Color: " + color);
@@ -298,17 +259,13 @@ public class TreasureConfig extends ConfigLoader {
if (config.contains(type + "." + treasureName + ".Custom_Name")) { if (config.contains(type + "." + treasureName + ".Custom_Name")) {
ItemMeta itemMeta = item.getItemMeta(); ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name"))); itemMeta.setDisplayName(config.getString(type + "." + treasureName + ".Custom_Name"));
item.setItemMeta(itemMeta); item.setItemMeta(itemMeta);
} }
if (config.contains(type + "." + treasureName + ".Lore")) { if (config.contains(type + "." + treasureName + ".Lore")) {
ItemMeta itemMeta = item.getItemMeta(); ItemMeta itemMeta = item.getItemMeta();
List<String> lore = new ArrayList<String>(); itemMeta.setLore(config.getStringList(type + "." + treasureName + ".Lore"));
for (String s : config.getStringList(type + "." + treasureName + ".Lore")) {
lore.add(ChatColor.translateAlternateColorCodes('&', s));
}
itemMeta.setLore(lore);
item.setItemMeta(itemMeta); item.setItemMeta(itemMeta);
} }
} }
@@ -359,9 +316,6 @@ public class TreasureConfig extends ConfigLoader {
else if (type.equals("Shake.PIG_ZOMBIE")) { else if (type.equals("Shake.PIG_ZOMBIE")) {
shakeFromPigZombie.add(shakeTreasure); shakeFromPigZombie.add(shakeTreasure);
} }
else if (type.equals("Shake.PLAYER")) {
shakeFromPlayer.add(shakeTreasure);
}
else if (type.equals("Shake.SHEEP")) { else if (type.equals("Shake.SHEEP")) {
shakeFromSheep.add(shakeTreasure); shakeFromSheep.add(shakeTreasure);
} }
@@ -481,11 +435,6 @@ public class TreasureConfig extends ConfigLoader {
} }
} }
public boolean getInventoryStealEnabled() { return config.contains("Shake.PLAYER.INVENTORY"); }
public boolean getInventoryStealStacks() { return config.getBoolean("Shake.PLAYER.INVENTORY.Whole_Stacks"); }
public double getInventoryStealDropChance() { return config.getDouble("Shake.PLAYER.INVENTORY.Drop_Chance"); }
public int getInventoryStealDropLevel() { return config.getInt("Shake.PLAYER.INVENTORY.Drop_Level"); }
public double getItemDropRate(int tier, Rarity rarity) { return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); } public double getItemDropRate(int tier, Rarity rarity) { return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
public double getEnchantmentDropRate(int tier, Rarity rarity) { return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); } public double getEnchantmentDropRate(int tier, Rarity rarity) { return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
} }

View File

@@ -11,8 +11,8 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
public interface DatabaseManager { public interface DatabaseManager {
// One month in seconds // One month in milliseconds
public final long PURGE_TIME = 2630000L * Config.getInstance().getOldUsersCutoff(); public final long PURGE_TIME = 2630000000L * Config.getInstance().getOldUsersCutoff();
// During convertUsers, how often to output a status // During convertUsers, how often to output a status
public final int progressInterval = 200; public final int progressInterval = 200;
@@ -67,9 +67,8 @@ public interface DatabaseManager {
* Add a new user to the database. * Add a new user to the database.
* *
* @param playerName The name of the player to be added to the database * @param playerName The name of the player to be added to the database
* @param uuid The uuid of the player to be added to the database
*/ */
public void newUser(String playerName, UUID uuid); public void newUser(String playerName, String uuid);
/** /**
* Load a player from the database. * Load a player from the database.

View File

@@ -86,6 +86,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
} }
else { else {
purgedUsers++; purgedUsers++;
Misc.profileCleanup(character[0]);
} }
} }
@@ -154,6 +155,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
if (currentTime - lastPlayed > PURGE_TIME) { if (currentTime - lastPlayed > PURGE_TIME) {
removedPlayers++; removedPlayers++;
Misc.profileCleanup(name);
} }
else { else {
if (rewrite) { if (rewrite) {
@@ -300,7 +302,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
writer.append(profile.getSkillXpLevel(SkillType.SWORDS)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.SWORDS)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.AXES)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.AXES)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.ACROBATICS)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.ACROBATICS)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.CHARGE)).append(":"); writer.append(":");
writer.append(profile.getSkillLevel(SkillType.TAMING)).append(":"); writer.append(profile.getSkillLevel(SkillType.TAMING)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.TAMING)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.TAMING)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.BERSERK)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.BERSERK)).append(":");
@@ -320,7 +322,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":"); writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
writer.append(uuid.toString()).append(":"); writer.append(uuid.toString()).append(":");
writer.append(profile.getScoreboardTipsShown()).append(":");
writer.append("\r\n"); writer.append("\r\n");
} }
} }
@@ -366,7 +367,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
public Map<SkillType, Integer> readRank(String playerName) { public Map<SkillType, Integer> readRank(String playerName) {
updateLeaderboards(); updateLeaderboards();
Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); Map<SkillType, Integer> skills = new EnumMap<SkillType, Integer>(SkillType.class);
for (SkillType skill : SkillType.NON_CHILD_SKILLS) { for (SkillType skill : SkillType.NON_CHILD_SKILLS) {
skills.put(skill, getPlayerRank(playerName, playerStatHash.get(skill))); skills.put(skill, getPlayerRank(playerName, playerStatHash.get(skill)));
@@ -377,7 +378,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
return skills; return skills;
} }
public void newUser(String playerName, UUID uuid) { public void newUser(String playerName, String uuid) {
BufferedWriter out = null; BufferedWriter out = null;
synchronized (fileWritingLock) { synchronized (fileWritingLock) {
try { try {
@@ -408,7 +409,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
out.append("0:"); // SwordsXp out.append("0:"); // SwordsXp
out.append("0:"); // AxesXp out.append("0:"); // AxesXp
out.append("0:"); // AcrobaticsXp out.append("0:"); // AcrobaticsXp
out.append("0:"); // DATS out.append(":");
out.append("0:"); // Taming out.append("0:"); // Taming
out.append("0:"); // TamingXp out.append("0:"); // TamingXp
out.append("0:"); // DATS out.append("0:"); // DATS
@@ -426,8 +427,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
out.append(Config.getInstance().getMobHealthbarDefault().toString()).append(":"); // Mob Healthbar HUD out.append(Config.getInstance().getMobHealthbarDefault().toString()).append(":"); // Mob Healthbar HUD
out.append("0:"); // Alchemy out.append("0:"); // Alchemy
out.append("0:"); // AlchemyXp out.append("0:"); // AlchemyXp
out.append(uuid != null ? uuid.toString() : "NULL").append(":"); // UUID out.append(uuid).append(":"); // UUID
out.append("0:"); // Scoreboard tips shown
// Add more in the same format as the line above // Add more in the same format as the line above
out.newLine(); out.newLine();
@@ -450,14 +451,18 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
@Deprecated @Deprecated
public PlayerProfile loadPlayerProfile(String playerName, boolean create) { public PlayerProfile loadPlayerProfile(String playerName, boolean create) {
return loadPlayerProfile(playerName, null, false); return loadPlayerProfile(playerName, "", false);
} }
public PlayerProfile loadPlayerProfile(UUID uuid) { public PlayerProfile loadPlayerProfile(UUID uuid) {
return loadPlayerProfile("", uuid, false); return loadPlayerProfile("", uuid.toString(), false);
} }
public PlayerProfile loadPlayerProfile(String playerName, UUID uuid, boolean create) { public PlayerProfile loadPlayerProfile(String playerName, UUID uuid, boolean create) {
return loadPlayerProfile(playerName, uuid.toString(), create);
}
private PlayerProfile loadPlayerProfile(String playerName, String uuid, boolean create) {
BufferedReader in = null; BufferedReader in = null;
String usersFilePath = mcMMO.getUsersFilePath(); String usersFilePath = mcMMO.getUsersFilePath();
@@ -471,15 +476,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
// Find if the line contains the player we want. // Find if the line contains the player we want.
String[] character = line.split(":"); String[] character = line.split(":");
// Compare names because we don't have a valid uuid for that player even if (!character[41].equalsIgnoreCase(uuid) && !character[0].equalsIgnoreCase(playerName)) {
// if input uuid is not null
if (character[41].equalsIgnoreCase("NULL")) {
if (!character[0].equalsIgnoreCase(playerName)) {
continue;
}
}
// If input uuid is not null then we should compare uuids
else if ((uuid != null && !character[41].equalsIgnoreCase(uuid.toString())) || (uuid == null && !character[0].equalsIgnoreCase(playerName))) {
continue; continue;
} }
@@ -494,13 +491,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
// Didn't find the player, create a new one // Didn't find the player, create a new one
if (create) { if (create) {
if (uuid == null) { if (uuid.isEmpty()) {
newUser(playerName, uuid); newUser(playerName, uuid);
return new PlayerProfile(playerName, true); return new PlayerProfile(playerName, true);
} }
newUser(playerName, uuid); newUser(playerName, uuid);
return new PlayerProfile(playerName, uuid, true); return new PlayerProfile(playerName, UUID.fromString(uuid), true);
} }
} }
catch (Exception e) { catch (Exception e) {
@@ -521,11 +518,11 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
} }
// Return unloaded profile // Return unloaded profile
if (uuid == null) { if (uuid.isEmpty()) {
return new PlayerProfile(playerName); return new PlayerProfile(playerName);
} }
return new PlayerProfile(playerName, uuid); return new PlayerProfile(playerName, UUID.fromString(uuid));
} }
public void convertUsers(DatabaseManager destination) { public void convertUsers(DatabaseManager destination) {
@@ -644,11 +641,10 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
if (character.length < 42) { if (character.length < 42) {
mcMMO.p.getLogger().severe("Could not update UUID for " + character[0] + "!"); mcMMO.p.getLogger().severe("Could not update UUID for " + character[0] + "!");
mcMMO.p.getLogger().severe("Database entry is invalid."); mcMMO.p.getLogger().severe("Database entry is invalid.");
continue; return false;
} }
character[41] = fetchedUUIDs.remove(character[0]).toString(); line = line.replace(character[41], fetchedUUIDs.remove(character[0]).toString());
line = new StringBuilder(org.apache.commons.lang.StringUtils.join(character, ":")).append(":").toString();
} }
writer.append(line).append("\r\n"); writer.append(line).append("\r\n");
@@ -889,15 +885,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
} }
} }
if (character[23].isEmpty()) {
// Addition of "Charge" Taming ability
// Version 1.5.02
line = line.replace(character[23], "0:");
if (oldVersion == null) {
oldVersion = "1.5.02";
}
}
// If they're valid, rewrite them to the file. // If they're valid, rewrite them to the file.
if (character.length == 42) { if (character.length == 42) {
writer.append(line).append("\r\n"); writer.append(line).append("\r\n");
@@ -956,20 +943,12 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
if (character.length <= 41) { if (character.length <= 41) {
// Addition of UUIDs // Addition of UUIDs
// Version 1.5.01 // Version 1.5.01
// Add a value because otherwise it gets removed // Add a space because otherwise it gets removed
newLine.append("NULL:"); newLine.append(" :");
if (oldVersion == null) { if (oldVersion == null) {
oldVersion = "1.5.01"; oldVersion = "1.5.01";
} }
} }
if (character.length <= 42) {
// Addition of scoreboard tips auto disable
// Version 1.5.02
newLine.append("0").append(":");
if (oldVersion == null) {
oldVersion = "1.5.02";
}
}
// Remove any blanks that shouldn't be there, and validate the other fields // Remove any blanks that shouldn't be there, and validate the other fields
String[] newCharacter = newLine.toString().split(":"); String[] newCharacter = newLine.toString().split(":");
@@ -1105,7 +1084,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
Map<SkillType, Float> skillsXp = new EnumMap<SkillType, Float>(SkillType.class); // Skill & XP Map<SkillType, Float> skillsXp = new EnumMap<SkillType, Float>(SkillType.class); // Skill & XP
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown
MobHealthbarType mobHealthbarType; MobHealthbarType mobHealthbarType;
int scoreboardTipsShown;
// TODO on updates, put new values in a try{} ? // TODO on updates, put new values in a try{} ?
@@ -1123,7 +1101,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.FISHING, (float) Integer.valueOf(character[35])); skillsXp.put(SkillType.FISHING, (float) Integer.valueOf(character[35]));
skillsXp.put(SkillType.ALCHEMY, (float) Integer.valueOf(character[40])); skillsXp.put(SkillType.ALCHEMY, (float) Integer.valueOf(character[40]));
skillsDATS.put(AbilityType.CHARGE, Integer.valueOf(character[23])); // Taming - Unused
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32])); skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
// Repair - Unused // Repair - Unused
skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(character[28])); skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(character[28]));
@@ -1150,14 +1128,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
catch (Exception e) { catch (Exception e) {
uuid = null; uuid = null;
} }
try {
scoreboardTipsShown = Integer.valueOf(character[41]);
}
catch (Exception e) {
scoreboardTipsShown = 0;
}
return new PlayerProfile(character[0], uuid, skills, skillsXp, skillsDATS, mobHealthbarType, scoreboardTipsShown); return new PlayerProfile(character[0], uuid, skills, skillsXp, skillsDATS, mobHealthbarType);
} }
private Map<SkillType, Integer> getSkillMapFromLine(String[] character) { private Map<SkillType, Integer> getSkillMapFromLine(String[] character) {

View File

@@ -8,7 +8,5 @@ public enum UpgradeType {
DROP_SQL_PARTY_NAMES, DROP_SQL_PARTY_NAMES,
DROP_SPOUT, DROP_SPOUT,
ADD_ALCHEMY, ADD_ALCHEMY,
ADD_UUIDS, ADD_UUIDS;
ADD_UUIDS_PARTY,
ADD_SCOREBOARD_TIPS;
} }

View File

@@ -1,55 +0,0 @@
package com.gmail.nossr50.datatypes.experience;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.skills.SkillType;
public class SkillXpGain implements Delayed {
private final long expiryTime;
private final float xp;
private final SkillType type;
public SkillXpGain(SkillType type, float xp) {
this.expiryTime = System.currentTimeMillis() + getDuration();
this.xp = xp;
this.type = type;
}
public SkillType getSkill() {
return type;
}
public float getXp() {
return xp;
}
private static long getDuration() {
return TimeUnit.MINUTES.toMillis(ExperienceConfig.getInstance().getDiminishedReturnsTimeInterval());
}
public int compareTo(SkillXpGain other) {
if (this.expiryTime < other.expiryTime) {
return -1;
}
else if (this.expiryTime > other.expiryTime) {
return 1;
}
return 0;
}
@Override
public int compareTo(Delayed other) {
if (other instanceof SkillXpGain) {
// Use more efficient method if possible (private fields)
return this.compareTo((SkillXpGain) other);
}
return (int) (getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS));
}
@Override
public long getDelay(TimeUnit arg0) {
return arg0.convert(expiryTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS);
}
}

View File

@@ -2,10 +2,8 @@ package com.gmail.nossr50.datatypes.party;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Sound; import org.bukkit.Sound;
@@ -22,10 +20,9 @@ import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
public class Party { public class Party {
private final LinkedHashMap<UUID, String> members = new LinkedHashMap<UUID, String>(); private final LinkedHashSet<String> members = new LinkedHashSet<String>();
private final List<Player> onlineMembers = new ArrayList<Player>();
private PartyLeader leader; private String leader;
private String name; private String name;
private String password; private String password;
private boolean locked; private boolean locked;
@@ -46,14 +43,14 @@ public class Party {
this.name = name; this.name = name;
} }
public Party(PartyLeader leader, String name) { public Party(String leader, String name) {
this.leader = leader; this.leader = leader;
this.name = name; this.name = name;
this.locked = true; this.locked = true;
this.level = 0; this.level = 0;
} }
public Party(PartyLeader leader, String name, String password) { public Party(String leader, String name, String password) {
this.leader = leader; this.leader = leader;
this.name = name; this.name = name;
this.password = password; this.password = password;
@@ -61,7 +58,7 @@ public class Party {
this.level = 0; this.level = 0;
} }
public Party(PartyLeader leader, String name, String password, boolean locked) { public Party(String leader, String name, String password, boolean locked) {
this.leader = leader; this.leader = leader;
this.name = name; this.name = name;
this.password = password; this.password = password;
@@ -69,11 +66,21 @@ public class Party {
this.level = 0; this.level = 0;
} }
public LinkedHashMap<UUID, String> getMembers() { public LinkedHashSet<String> getMembers() {
return members; return members;
} }
public List<Player> getOnlineMembers() { public List<Player> getOnlineMembers() {
List<Player> onlineMembers = new ArrayList<Player>();
for (String memberName : members) {
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
if (member != null) {
onlineMembers.add(member);
}
}
return onlineMembers; return onlineMembers;
} }
@@ -90,19 +97,11 @@ public class Party {
return onlinePlayerNames; return onlinePlayerNames;
} }
public boolean addOnlineMember(Player player) {
return onlineMembers.add(player);
}
public boolean removeOnlineMember(Player player) {
return onlineMembers.remove(player);
}
public String getName() { public String getName() {
return name; return name;
} }
public PartyLeader getLeader() { public String getLeader() {
return leader; return leader;
} }
@@ -134,7 +133,7 @@ public class Party {
this.name = name; this.name = name;
} }
public void setLeader(PartyLeader leader) { public void setLeader(String leader) {
this.leader = leader; this.leader = leader;
} }
@@ -221,8 +220,7 @@ public class Party {
} }
if (!Config.getInstance().getPartyInformAllMembers()) { if (!Config.getInstance().getPartyInformAllMembers()) {
Player leader = mcMMO.p.getServer().getPlayer(this.leader.getUniqueId()); Player leader = mcMMO.p.getServer().getPlayer(this.leader);
if (leader != null) { if (leader != null) {
leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel())); leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel()));
@@ -305,24 +303,13 @@ public class Party {
} }
} }
public boolean hasMember(String memberName) {
return this.getMembers().values().contains(memberName);
}
public boolean hasMember(UUID uuid) {
return this.getMembers().keySet().contains(uuid);
}
public String createMembersList(String playerName, List<Player> nearMembers) { public String createMembersList(String playerName, List<Player> nearMembers) {
StringBuilder memberList = new StringBuilder(); StringBuilder memberList = new StringBuilder();
for (Entry<UUID, String> memberEntry : this.getMembers().entrySet()) { for (String memberName : this.getMembers()) {
UUID uuid = memberEntry.getKey(); Player member = mcMMO.p.getServer().getPlayerExact(memberName);
String memberName = memberEntry.getValue();
Player member = mcMMO.p.getServer().getPlayer(uuid); if (this.getLeader().equalsIgnoreCase(memberName)) {
if (this.getLeader().getUniqueId().equals(uuid)) {
memberList.append(ChatColor.GOLD); memberList.append(ChatColor.GOLD);
if (member == null) { if (member == null) {

View File

@@ -1,21 +0,0 @@
package com.gmail.nossr50.datatypes.party;
import java.util.UUID;
public class PartyLeader {
private UUID uuid;
private String playerName;
public PartyLeader(UUID uuid, String playerName) {
this.uuid = uuid;
this.playerName = playerName;
}
public UUID getUniqueId() {
return uuid;
}
public String getPlayerName() {
return playerName;
}
}

View File

@@ -7,12 +7,12 @@ import java.util.UUID;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
@@ -30,7 +30,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.party.ShareHandler; import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.runnables.skills.AbilityDisableTask; import com.gmail.nossr50.runnables.skills.AbilityDisableTask;
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
import com.gmail.nossr50.runnables.skills.ToolLowerTask; import com.gmail.nossr50.runnables.skills.ToolLowerTask;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
@@ -46,7 +45,6 @@ import com.gmail.nossr50.skills.repair.RepairManager;
import com.gmail.nossr50.skills.salvage.SalvageManager; import com.gmail.nossr50.skills.salvage.SalvageManager;
import com.gmail.nossr50.skills.smelting.SmeltingManager; import com.gmail.nossr50.skills.smelting.SmeltingManager;
import com.gmail.nossr50.skills.swords.SwordsManager; import com.gmail.nossr50.skills.swords.SwordsManager;
import com.gmail.nossr50.skills.taming.Taming;
import com.gmail.nossr50.skills.taming.TamingManager; import com.gmail.nossr50.skills.taming.TamingManager;
import com.gmail.nossr50.skills.unarmed.UnarmedManager; import com.gmail.nossr50.skills.unarmed.UnarmedManager;
import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
@@ -54,8 +52,6 @@ import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.ParticleEffectUtils;
import com.gmail.nossr50.util.skills.PerksUtils; import com.gmail.nossr50.util.skills.PerksUtils;
import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.skills.SkillUtils;
@@ -104,13 +100,9 @@ public class McMMOPlayer {
this.player = player; this.player = player;
playerMetadata = new FixedMetadataValue(mcMMO.p, playerName); playerMetadata = new FixedMetadataValue(mcMMO.p, playerName);
this.profile = profile; this.profile = profile;
party = PartyManager.getPlayerParty(playerName, uuid); party = PartyManager.getPlayerParty(playerName);
ptpRecord = new PartyTeleportRecord(); ptpRecord = new PartyTeleportRecord();
if (inParty()) {
loginParty();
}
if (profile.getUniqueId() == null) { if (profile.getUniqueId() == null) {
profile.setUniqueId(uuid); profile.setUniqueId(uuid);
} }
@@ -587,10 +579,6 @@ public class McMMOPlayer {
allianceInvite = null; allianceInvite = null;
} }
public void loginParty() {
party.addOnlineMember(this.getPlayer());
}
public int getItemShareModifier() { public int getItemShareModifier() {
if (itemShareModifier < 10) { if (itemShareModifier < 10) {
setItemShareModifier(10); setItemShareModifier(10);
@@ -742,21 +730,6 @@ public class McMMOPlayer {
return; return;
} }
LivingEntity livingEntity = null;
if (ability == AbilityType.CHARGE) {
livingEntity = this.getTamingManager().getTarget(20);
if (!this.getTamingManager().isEntityTypeNearby(EntityType.WOLF, Taming.wolfCommandRange, true)) {
player.sendMessage(LocaleLoader.getString("Taming.Skills.Charge.NoneNearby"));
return;
}
else if (livingEntity == null) {
player.sendMessage(LocaleLoader.getString("Taming.Skills.Charge.NoTarget"));
return;
}
}
if (EventUtils.callPlayerAbilityActivateEvent(player, skill).isCancelled()) { if (EventUtils.callPlayerAbilityActivateEvent(player, skill).isCancelled()) {
return; return;
} }
@@ -780,10 +753,6 @@ public class McMMOPlayer {
SkillUtils.handleAbilitySpeedIncrease(player); SkillUtils.handleAbilitySpeedIncrease(player);
} }
if (ability == AbilityType.CHARGE) {
this.getTamingManager().handleCharge(livingEntity);
}
new AbilityDisableTask(this, ability).runTaskLater(mcMMO.p, ticks * Misc.TICK_CONVERSION_FACTOR); new AbilityDisableTask(this, ability).runTaskLater(mcMMO.p, ticks * Misc.TICK_CONVERSION_FACTOR);
} }
@@ -825,11 +794,6 @@ public class McMMOPlayer {
} }
} }
if (ability == AbilityType.CHARGE && !this.getTamingManager().isEntityTypeNearby(EntityType.WOLF, Taming.wolfCommandRange, true)) {
player.sendMessage(LocaleLoader.getString("Taming.Skills.Charge.NoneNearby"));
return;
}
if (Config.getInstance().getAbilityMessagesEnabled()) { if (Config.getInstance().getAbilityMessagesEnabled()) {
player.sendMessage(tool.getRaiseTool()); player.sendMessage(tool.getRaiseTool());
} }
@@ -905,28 +869,4 @@ public class McMMOPlayer {
public FixedMetadataValue getPlayerMetadata() { public FixedMetadataValue getPlayerMetadata() {
return playerMetadata; return playerMetadata;
} }
/**
* This method is called by PlayerQuitEvent to tear down the mcMMOPlayer.
*
* @param syncSave if true, data is saved synchronously
*/
public void logout(boolean syncSave) {
Player thisPlayer = getPlayer();
resetAbilityMode();
BleedTimerTask.bleedOut(thisPlayer);
if (syncSave) {
getProfile().save();
} else {
getProfile().scheduleAsyncSave();
}
UserManager.remove(thisPlayer);
ScoreboardManager.teardownPlayer(thisPlayer);
if (inParty()) {
party.removeOnlineMember(thisPlayer);
}
}
} }

View File

@@ -4,14 +4,12 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.DelayQueue;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.MobHealthbarType; import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.experience.SkillXpGain;
import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
@@ -28,17 +26,12 @@ public class PlayerProfile {
/* HUDs */ /* HUDs */
private MobHealthbarType mobHealthbarType; private MobHealthbarType mobHealthbarType;
private int scoreboardTipsShown;
/* Skill Data */ /* Skill Data */
private final Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); // Skill & Level private final Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); // Skill & Level
private final Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP private final Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP
private final Map<AbilityType, Integer> abilityDATS = new HashMap<AbilityType, Integer>(); // Ability & Cooldown private final Map<AbilityType, Integer> abilityDATS = new HashMap<AbilityType, Integer>(); // Ability & Cooldown
// Store previous XP gains for deminished returns
private DelayQueue<SkillXpGain> gainedSkillsXp = new DelayQueue<SkillXpGain>();
private HashMap<SkillType, Float> rollingSkillsXp = new HashMap<SkillType, Float>();
@Deprecated @Deprecated
public PlayerProfile(String playerName) { public PlayerProfile(String playerName) {
this(playerName, null); this(playerName, null);
@@ -49,7 +42,6 @@ public class PlayerProfile {
this.playerName = playerName; this.playerName = playerName;
mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
scoreboardTipsShown = 0;
for (AbilityType abilityType : AbilityType.values()) { for (AbilityType abilityType : AbilityType.values()) {
abilityDATS.put(abilityType, 0); abilityDATS.put(abilityType, 0);
@@ -72,11 +64,10 @@ public class PlayerProfile {
this.loaded = isLoaded; this.loaded = isLoaded;
} }
public PlayerProfile(String playerName, UUID uuid, Map<SkillType, Integer> levelData, Map<SkillType, Float> xpData, Map<AbilityType, Integer> cooldownData, MobHealthbarType mobHealthbarType, int scoreboardTipsShown) { public PlayerProfile(String playerName, UUID uuid, Map<SkillType, Integer> levelData, Map<SkillType, Float> xpData, Map<AbilityType, Integer> cooldownData, MobHealthbarType mobHealthbarType) {
this.playerName = playerName; this.playerName = playerName;
this.uuid = uuid; this.uuid = uuid;
this.mobHealthbarType = mobHealthbarType; this.mobHealthbarType = mobHealthbarType;
this.scoreboardTipsShown = scoreboardTipsShown;
skills.putAll(levelData); skills.putAll(levelData);
skillsXp.putAll(xpData); skillsXp.putAll(xpData);
@@ -95,7 +86,7 @@ public class PlayerProfile {
} }
// TODO should this part be synchronized? // TODO should this part be synchronized?
PlayerProfile profileCopy = new PlayerProfile(playerName, uuid, ImmutableMap.copyOf(skills), ImmutableMap.copyOf(skillsXp), ImmutableMap.copyOf(abilityDATS), mobHealthbarType, scoreboardTipsShown); PlayerProfile profileCopy = new PlayerProfile(playerName, uuid, ImmutableMap.copyOf(skills), ImmutableMap.copyOf(skillsXp), ImmutableMap.copyOf(abilityDATS), mobHealthbarType);
changed = !mcMMO.getDatabaseManager().saveUser(profileCopy); changed = !mcMMO.getDatabaseManager().saveUser(profileCopy);
if (changed) { if (changed) {
@@ -130,25 +121,9 @@ public class PlayerProfile {
} }
public void setMobHealthbarType(MobHealthbarType mobHealthbarType) { public void setMobHealthbarType(MobHealthbarType mobHealthbarType) {
changed = true;
this.mobHealthbarType = mobHealthbarType; this.mobHealthbarType = mobHealthbarType;
} }
public int getScoreboardTipsShown() {
return scoreboardTipsShown;
}
public void setScoreboardTipsShown(int scoreboardTipsShown) {
changed = true;
this.scoreboardTipsShown = scoreboardTipsShown;
}
public void increaseTipsShown() {
setScoreboardTipsShown(getScoreboardTipsShown() + 1);
}
/* /*
* Cooldowns * Cooldowns
*/ */
@@ -239,16 +214,6 @@ public class PlayerProfile {
skillsXp.put(skill, skillsXp.get(skill) - xp); skillsXp.put(skill, skillsXp.get(skill) - xp);
} }
public void removeXp(SkillType skill, float xp) {
if (skill.isChildSkill()) {
return;
}
changed = true;
skillsXp.put(skill, skillsXp.get(skill) - xp);
}
/** /**
* Modify a skill level. * Modify a skill level.
* *
@@ -299,46 +264,7 @@ public class PlayerProfile {
} }
/** /**
* Get the registered amount of experience gained * Get the total amount of Xp before the next level.
* This is used for diminished XP returns
*
* @return xp Experience amount registered
*/
public float getRegisteredXpGain(SkillType skillType) {
float xp = 0F;
if (rollingSkillsXp.get(skillType) != null) {
xp = rollingSkillsXp.get(skillType);
}
return xp;
}
/**
* Register an experience gain
* This is used for diminished XP returns
*
* @param skillType Skill being used
* @param xp Experience amount to add
*/
public void registerXpGain(SkillType skillType, float xp) {
gainedSkillsXp.add(new SkillXpGain(skillType, xp));
rollingSkillsXp.put(skillType, getRegisteredXpGain(skillType) + xp);
}
/**
* Remove experience gains older than a given time
* This is used for diminished XP returns
*/
public void purgeExpiredXpGains() {
SkillXpGain gain;
while ((gain = gainedSkillsXp.poll()) != null) {
rollingSkillsXp.put(gain.getSkill(), getRegisteredXpGain(gain.getSkill()) - gain.getXp());
}
}
/**
* Get the amount of Xp remaining before the next level.
* *
* @param skillType Type of skill to check * @param skillType Type of skill to check
* @return the total amount of Xp until next level * @return the total amount of Xp until next level

View File

@@ -60,13 +60,6 @@ public enum AbilityType {
"Swords.Skills.SS.Refresh", "Swords.Skills.SS.Refresh",
"Swords.Skills.SS.Other.Off"), "Swords.Skills.SS.Other.Off"),
CHARGE(
"Taming.Skills.Charge.On",
"Taming.Skills.Charge.Off",
"Taming.Skills.Charge.Other.On",
"Taming.Skills.Charge.Refresh",
"Taming.Skills.Charge.Other.Off"),
/** /**
* Has cooldown - but has to share a skill with Super Breaker, so needs special treatment * Has cooldown - but has to share a skill with Super Breaker, so needs special treatment
*/ */
@@ -159,9 +152,6 @@ public enum AbilityType {
case BLAST_MINING: case BLAST_MINING:
return Permissions.remoteDetonation(player); return Permissions.remoteDetonation(player);
case CHARGE:
return Permissions.charge(player);
case GIGA_DRILL_BREAKER: case GIGA_DRILL_BREAKER:
return Permissions.gigaDrillBreaker(player); return Permissions.gigaDrillBreaker(player);

View File

@@ -1,22 +0,0 @@
package com.gmail.nossr50.datatypes.skills;
public enum ModConfigType {
BLOCKS,
TOOLS,
ARMOR,
UNKNOWN;
public static ModConfigType getModConfigType(String materialName) {
if (materialName.contains("HELM") || (materialName.contains("CHEST") && !materialName.contains("CHESTNUT")) || materialName.contains("LEGS") || materialName.contains("LEGGINGS") || materialName.contains("BOOT")) {
return ARMOR;
}
else if (materialName.contains("PICKAXE") || materialName.contains("AXE") || (materialName.contains("BOW") && !materialName.contains("BOWL")) || materialName.contains("HOE") || materialName.contains("SHOVEL") || materialName.contains("SWORD")) {
return TOOLS;
}
else if (materialName.contains("LOG") || materialName.contains("LEAVES") || materialName.contains("FLOWER") || materialName.contains("PLANT") || materialName.contains("CROP") || materialName.contains("ORE") || materialName.contains("DIRT") || materialName.contains("SAND") || materialName.contains("GRASS")) {
return BLOCKS;
}
return UNKNOWN;
}
}

View File

@@ -71,7 +71,6 @@ public enum SecondaryAbility {
SHARPENED_CLAWS, SHARPENED_CLAWS,
SHOCK_PROOF, SHOCK_PROOF,
THICK_FUR, THICK_FUR,
PUMMEL,
/* Unarmed */ /* Unarmed */
BLOCK_CRACKER, BLOCK_CRACKER,

View File

@@ -48,7 +48,7 @@ public enum SkillType {
SALVAGE(SalvageManager.class, Color.ORANGE, ImmutableList.of(SecondaryAbility.ADVANCED_SALVAGE, SecondaryAbility.ARCANE_SALVAGE)), SALVAGE(SalvageManager.class, Color.ORANGE, ImmutableList.of(SecondaryAbility.ADVANCED_SALVAGE, SecondaryAbility.ARCANE_SALVAGE)),
SMELTING(SmeltingManager.class, Color.YELLOW, ImmutableList.of(SecondaryAbility.FLUX_MINING, SecondaryAbility.FUEL_EFFICIENCY, SecondaryAbility.SECOND_SMELT)), SMELTING(SmeltingManager.class, Color.YELLOW, ImmutableList.of(SecondaryAbility.FLUX_MINING, SecondaryAbility.FUEL_EFFICIENCY, SecondaryAbility.SECOND_SMELT)),
SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD, ImmutableList.of(SecondaryAbility.BLEED, SecondaryAbility.COUNTER)), SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD, ImmutableList.of(SecondaryAbility.BLEED, SecondaryAbility.COUNTER)),
TAMING(TamingManager.class, Color.PURPLE, AbilityType.CHARGE, ToolType.BONE, ImmutableList.of(SecondaryAbility.BEAST_LORE, SecondaryAbility.CALL_OF_THE_WILD, SecondaryAbility.ENVIROMENTALLY_AWARE, SecondaryAbility.FAST_FOOD, SecondaryAbility.GORE, SecondaryAbility.HOLY_HOUND, SecondaryAbility.SHARPENED_CLAWS, SecondaryAbility.SHOCK_PROOF, SecondaryAbility.THICK_FUR, SecondaryAbility.PUMMEL)), TAMING(TamingManager.class, Color.PURPLE, ImmutableList.of(SecondaryAbility.BEAST_LORE, SecondaryAbility.CALL_OF_THE_WILD, SecondaryAbility.ENVIROMENTALLY_AWARE, SecondaryAbility.FAST_FOOD, SecondaryAbility.GORE, SecondaryAbility.HOLY_HOUND, SecondaryAbility.SHARPENED_CLAWS, SecondaryAbility.SHOCK_PROOF, SecondaryAbility.THICK_FUR)),
UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SecondaryAbility.BLOCK_CRACKER, SecondaryAbility.DEFLECT, SecondaryAbility.DISARM, SecondaryAbility.IRON_ARM, SecondaryAbility.IRON_GRIP)), UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SecondaryAbility.BLOCK_CRACKER, SecondaryAbility.DEFLECT, SecondaryAbility.DISARM, SecondaryAbility.IRON_ARM, SecondaryAbility.IRON_GRIP)),
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SecondaryAbility.LEAF_BLOWER, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS)); WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SecondaryAbility.LEAF_BLOWER, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS));

View File

@@ -8,7 +8,6 @@ import com.gmail.nossr50.util.ItemUtils;
public enum ToolType { public enum ToolType {
AXE(LocaleLoader.getString("Axes.Ability.Lower"), LocaleLoader.getString("Axes.Ability.Ready")), AXE(LocaleLoader.getString("Axes.Ability.Lower"), LocaleLoader.getString("Axes.Ability.Ready")),
BONE(LocaleLoader.getString("Taming.Ability.Lower"), LocaleLoader.getString("Taming.Ability.Ready")),
FISTS(LocaleLoader.getString("Unarmed.Ability.Lower"), LocaleLoader.getString("Unarmed.Ability.Ready")), FISTS(LocaleLoader.getString("Unarmed.Ability.Lower"), LocaleLoader.getString("Unarmed.Ability.Ready")),
HOE(LocaleLoader.getString("Herbalism.Ability.Lower"), LocaleLoader.getString("Herbalism.Ability.Ready")), HOE(LocaleLoader.getString("Herbalism.Ability.Lower"), LocaleLoader.getString("Herbalism.Ability.Ready")),
PICKAXE(LocaleLoader.getString("Mining.Ability.Lower"), LocaleLoader.getString("Mining.Ability.Ready")), PICKAXE(LocaleLoader.getString("Mining.Ability.Lower"), LocaleLoader.getString("Mining.Ability.Ready")),
@@ -42,9 +41,6 @@ public enum ToolType {
case AXE: case AXE:
return ItemUtils.isAxe(itemStack); return ItemUtils.isAxe(itemStack);
case BONE:
return itemStack.getType() == Material.BONE;
case FISTS: case FISTS:
return itemStack.getType() == Material.AIR; return itemStack.getType() == Material.AIR;

View File

@@ -1,47 +1,18 @@
package com.gmail.nossr50.events.hardcore; package com.gmail.nossr50.events.hardcore;
import java.util.HashMap;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent; import org.bukkit.event.player.PlayerEvent;
public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancellable { public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancellable {
private HashMap<String, Integer> levelChanged;
private HashMap<String, Float> experienceChanged;
private boolean cancelled; private boolean cancelled;
public McMMOPlayerDeathPenaltyEvent(Player player, HashMap<String, Integer> levelChanged, HashMap<String, Float> experienceChanged) {
super(player);
this.levelChanged = levelChanged;
this.experienceChanged = experienceChanged;
this.cancelled = false;
}
@Deprecated
public McMMOPlayerDeathPenaltyEvent(Player player) { public McMMOPlayerDeathPenaltyEvent(Player player) {
super(player); super(player);
this.cancelled = false; this.cancelled = false;
} }
public HashMap<String, Integer> getLevelChanged() {
return levelChanged;
}
public void setLevelChanged(HashMap<String, Integer> levelChanged) {
this.levelChanged = levelChanged;
}
public HashMap<String, Float> getExperienceChanged() {
return experienceChanged;
}
public void setExperienceChanged(HashMap<String, Float> experienceChanged) {
this.experienceChanged = experienceChanged;
}
/** Following are required for Cancellable **/ /** Following are required for Cancellable **/
@Override @Override
public boolean isCancelled() { public boolean isCancelled() {

View File

@@ -1,38 +0,0 @@
package com.gmail.nossr50.events.hardcore;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Cancellable {
private boolean cancelled;
public McMMOPlayerPreDeathPenaltyEvent(Player player) {
super(player);
this.cancelled = false;
}
/** Following are required for Cancellable **/
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
/** Rest of file is required boilerplate for custom events **/
private static final HandlerList handlers = new HandlerList();
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@@ -1,12 +0,0 @@
package com.gmail.nossr50.events.hardcore;
import java.util.HashMap;
import org.bukkit.entity.Player;
public class McMMOPlayerStatLossEvent extends McMMOPlayerDeathPenaltyEvent {
public McMMOPlayerStatLossEvent(Player player, HashMap<String, Integer> levelChanged, HashMap<String, Float> experienceChanged) {
super(player, levelChanged, experienceChanged);
}
}

View File

@@ -1,18 +0,0 @@
package com.gmail.nossr50.events.hardcore;
import java.util.HashMap;
import org.bukkit.entity.Player;
public class McMMOPlayerVampirismEvent extends McMMOPlayerDeathPenaltyEvent {
private boolean isVictim;
public McMMOPlayerVampirismEvent(Player player, boolean isVictim, HashMap<String, Integer> levelChanged, HashMap<String, Float> experienceChanged) {
super(player, levelChanged, experienceChanged);
this.isVictim = isVictim;
}
public boolean isVictim() {
return isVictim;
}
}

View File

@@ -260,7 +260,7 @@ public class BlockListener implements Listener {
} }
} }
} }
else if (ItemUtils.isFluxPickaxe(heldItem) && !heldItem.containsEnchantment(Enchantment.SILK_TOUCH)) { else if (ItemUtils.isPickaxe(heldItem) && !heldItem.containsEnchantment(Enchantment.SILK_TOUCH)) {
SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager(); SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();
if (smeltingManager.canUseFluxMining(blockState)) { if (smeltingManager.canUseFluxMining(blockState)) {

View File

@@ -615,7 +615,7 @@ public class EntityListener implements Listener {
Player player = (Player) target; Player player = (Player) target;
Tameable tameable = (Tameable) entity; Tameable tameable = (Tameable) entity;
if (!UserManager.hasPlayerDataKey(player) || !CombatUtils.isFriendlyPet(player, tameable)) { if (!CombatUtils.isFriendlyPet(player, tameable)) {
return; return;
} }

View File

@@ -39,10 +39,10 @@ import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.ShareHandler; import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
import com.gmail.nossr50.skills.fishing.FishingManager; import com.gmail.nossr50.skills.fishing.FishingManager;
import com.gmail.nossr50.skills.herbalism.HerbalismManager; import com.gmail.nossr50.skills.herbalism.HerbalismManager;
import com.gmail.nossr50.skills.mining.MiningManager; import com.gmail.nossr50.skills.mining.MiningManager;
@@ -62,6 +62,7 @@ import com.gmail.nossr50.util.MobHealthbarUtils;
import com.gmail.nossr50.util.Motd; import com.gmail.nossr50.util.Motd;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.skills.SkillUtils;
public class PlayerListener implements Listener { public class PlayerListener implements Listener {
@@ -139,8 +140,9 @@ public class PlayerListener implements Listener {
Player killer = killedPlayer.getKiller(); Player killer = killedPlayer.getKiller();
if (statLossEnabled || (killer != null && vampirismEnabled)) { if (statLossEnabled || (killer != null && vampirismEnabled)) {
if (EventUtils.callPreDeathPenaltyEvent(killedPlayer).isCancelled()) { if (EventUtils.callDeathPenaltyEvent(killedPlayer).isCancelled()) {
return; return;
} }
@@ -360,7 +362,12 @@ public class PlayerListener implements Listener {
} }
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
mcMMOPlayer.logout(false);
mcMMOPlayer.resetAbilityMode();
BleedTimerTask.bleedOut(player);
mcMMOPlayer.getProfile().scheduleAsyncSave();
UserManager.remove(player);
ScoreboardManager.teardownPlayer(player);
} }
/** /**
@@ -380,7 +387,7 @@ public class PlayerListener implements Listener {
return; return;
} }
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading new PlayerProfileLoadingTask(player).runTaskTimerAsynchronously(mcMMO.p, 1, 20); // 1 Tick delay to ensure the player is marked as online before we begin loading
if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) { if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) {
Motd.displayAll(player); Motd.displayAll(player);
@@ -457,7 +464,6 @@ public class PlayerListener implements Listener {
// Make sure the player knows what he's doing when trying to salvage an enchanted item // Make sure the player knows what he's doing when trying to salvage an enchanted item
if (!(heldItem.getEnchantments().size() > 0) || salvageManager.checkConfirmation(true)) { if (!(heldItem.getEnchantments().size() > 0) || salvageManager.checkConfirmation(true)) {
SkillUtils.handleAbilitySpeedDecrease(player);
salvageManager.handleSalvage(block.getLocation(), heldItem); salvageManager.handleSalvage(block.getLocation(), heldItem);
player.updateInventory(); player.updateInventory();
} }
@@ -523,10 +529,10 @@ public class PlayerListener implements Listener {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
ItemStack heldItem = player.getItemInHand(); ItemStack heldItem = player.getItemInHand();
Block block = event.getClickedBlock();
switch (event.getAction()) { switch (event.getAction()) {
case RIGHT_CLICK_BLOCK: case RIGHT_CLICK_BLOCK:
Block block = event.getClickedBlock();
BlockState blockState = block.getState(); BlockState blockState = block.getState();
/* ACTIVATION & ITEM CHECKS */ /* ACTIVATION & ITEM CHECKS */
@@ -577,7 +583,6 @@ public class PlayerListener implements Listener {
mcMMOPlayer.processAbilityActivation(SkillType.SWORDS); mcMMOPlayer.processAbilityActivation(SkillType.SWORDS);
mcMMOPlayer.processAbilityActivation(SkillType.UNARMED); mcMMOPlayer.processAbilityActivation(SkillType.UNARMED);
mcMMOPlayer.processAbilityActivation(SkillType.WOODCUTTING); mcMMOPlayer.processAbilityActivation(SkillType.WOODCUTTING);
mcMMOPlayer.processAbilityActivation(SkillType.TAMING);
} }
/* ITEM CHECKS */ /* ITEM CHECKS */
@@ -592,12 +597,6 @@ public class PlayerListener implements Listener {
break; break;
case LEFT_CLICK_AIR: case LEFT_CLICK_AIR:
if (mcMMOPlayer.getToolPreparationMode(ToolType.BONE) && ToolType.BONE.inHand(heldItem)) {
mcMMOPlayer.checkAbilityActivation(SkillType.TAMING);
}
// Fallthrough
case LEFT_CLICK_BLOCK: case LEFT_CLICK_BLOCK:
if (!player.isSneaking()) { if (!player.isSneaking()) {

View File

@@ -6,13 +6,10 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
public class SelfListener implements Listener { public class SelfListener implements Listener {
@@ -41,46 +38,4 @@ public class SelfListener implements Listener {
public void onAbility(McMMOPlayerAbilityActivateEvent event) { public void onAbility(McMMOPlayerAbilityActivateEvent event) {
ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill()); ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
} }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
SkillType skillType = event.getSkill();
int threshold = ExperienceConfig.getInstance().getDiminishedReturnsThreshold(skillType);
if (threshold <= 0 || !ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {
// Diminished returns is turned off
return;
}
final float rawXp = event.getRawXpGained();
if (rawXp < 0) {
// Don't calculate for XP subtraction
return;
}
Player player = event.getPlayer();
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (skillType.isChildSkill()) {
return;
}
float modifiedThreshold = (float) (threshold / skillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier());
float difference = (mcMMOPlayer.getProfile().getRegisteredXpGain(skillType) - modifiedThreshold) / modifiedThreshold;
if (difference > 0) {
// System.out.println("Total XP Earned: " + mcMMOPlayer.getProfile().getRegisteredXpGain(skillType) + " / Threshold value: " + threshold);
// System.out.println(difference * 100 + "% over the threshold!");
// System.out.println("Previous: " + event.getRawXpGained());
// System.out.println("Adjusted XP " + (event.getRawXpGained() - (event.getRawXpGained() * difference)));
float newValue = rawXp - (rawXp * difference);
if (newValue > 0) {
event.setRawXpGained(newValue);
}
else {
event.setCancelled(true);
}
}
}
} }

View File

@@ -5,7 +5,6 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
@@ -15,7 +14,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.HiddenConfig; import com.gmail.nossr50.config.HiddenConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.config.mods.ArmorConfigManager; import com.gmail.nossr50.config.mods.ArmorConfigManager;
import com.gmail.nossr50.config.mods.BlockConfigManager; import com.gmail.nossr50.config.mods.BlockConfigManager;
import com.gmail.nossr50.config.mods.EntityConfigManager; import com.gmail.nossr50.config.mods.EntityConfigManager;
@@ -40,7 +38,6 @@ import com.gmail.nossr50.runnables.UpdaterResultAsyncTask;
import com.gmail.nossr50.runnables.backups.CleanBackupsTask; import com.gmail.nossr50.runnables.backups.CleanBackupsTask;
import com.gmail.nossr50.runnables.database.UserPurgeTask; import com.gmail.nossr50.runnables.database.UserPurgeTask;
import com.gmail.nossr50.runnables.party.PartyAutoKickTask; import com.gmail.nossr50.runnables.party.PartyAutoKickTask;
import com.gmail.nossr50.runnables.player.ClearRegisteredXPGainTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.runnables.player.PowerLevelUpdatingTask; import com.gmail.nossr50.runnables.player.PowerLevelUpdatingTask;
import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.runnables.skills.BleedTimerTask;
@@ -52,7 +49,6 @@ import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager; import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager; import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager;
import com.gmail.nossr50.skills.smelting.SmeltingManager;
import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.ChimaeraWing;
import com.gmail.nossr50.util.HolidayManager; import com.gmail.nossr50.util.HolidayManager;
import com.gmail.nossr50.util.LogFilter; import com.gmail.nossr50.util.LogFilter;
@@ -120,7 +116,6 @@ public class mcMMO extends JavaPlugin {
public final static String playerDataKey = "mcMMO: Player Data"; public final static String playerDataKey = "mcMMO: Player Data";
public final static String greenThumbDataKey = "mcMMO: Green Thumb"; public final static String greenThumbDataKey = "mcMMO: Green Thumb";
public final static String pistonDataKey = "mcMMO: Piston State"; public final static String pistonDataKey = "mcMMO: Piston State";
public final static String databaseCommandKey = "mcMMO: Processing Database Command";
public static FixedMetadataValue metadataValue; public static FixedMetadataValue metadataValue;
@@ -173,7 +168,7 @@ public class mcMMO extends JavaPlugin {
holidayManager = new HolidayManager(); holidayManager = new HolidayManager();
for (Player player : getServer().getOnlinePlayers()) { for (Player player : getServer().getOnlinePlayers()) {
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading new PlayerProfileLoadingTask(player).runTaskTimerAsynchronously(mcMMO.p, 1, 20); // 1 Tick delay to ensure the player is marked as online before we begin loading
} }
debug("Version " + getDescription().getVersion() + " is enabled!"); debug("Version " + getDescription().getVersion() + " is enabled!");
@@ -457,14 +452,6 @@ public class mcMMO extends JavaPlugin {
if (Config.getInstance().getChimaeraEnabled()) { if (Config.getInstance().getChimaeraEnabled()) {
getServer().addRecipe(ChimaeraWing.getChimaeraWingRecipe()); getServer().addRecipe(ChimaeraWing.getChimaeraWingRecipe());
} }
if (Config.getInstance().getFluxPickaxeEnabled()) {
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.DIAMOND_PICKAXE));
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.GOLD_PICKAXE));
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.IRON_PICKAXE));
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.STONE_PICKAXE));
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.WOOD_PICKAXE));
}
} }
private void scheduleTasks() { private void scheduleTasks() {
@@ -482,10 +469,10 @@ public class mcMMO extends JavaPlugin {
long purgeIntervalTicks = Config.getInstance().getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; long purgeIntervalTicks = Config.getInstance().getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
if (purgeIntervalTicks == 0) { if (purgeIntervalTicks == 0) {
new UserPurgeTask().runTaskLaterAsynchronously(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. new UserPurgeTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
} }
else if (purgeIntervalTicks > 0) { else if (purgeIntervalTicks > 0) {
new UserPurgeTask().runTaskTimerAsynchronously(this, purgeIntervalTicks, purgeIntervalTicks); new UserPurgeTask().runTaskTimer(this, purgeIntervalTicks, purgeIntervalTicks);
} }
// Automatically remove old members from parties // Automatically remove old members from parties
@@ -504,11 +491,6 @@ public class mcMMO extends JavaPlugin {
if (getHolidayManager().nearingAprilFirst()) { if (getHolidayManager().nearingAprilFirst()) {
new CheckDateTask().runTaskTimer(this, 10L * Misc.TICK_CONVERSION_FACTOR, 1L * 60L * 60L * Misc.TICK_CONVERSION_FACTOR); new CheckDateTask().runTaskTimer(this, 10L * Misc.TICK_CONVERSION_FACTOR, 1L * 60L * 60L * Misc.TICK_CONVERSION_FACTOR);
} }
// Clear the registered XP data so players can earn XP again
if (ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {
new ClearRegisteredXPGainTask().runTaskTimer(this, 60, 60);
}
} }
private void checkModConfigs() { private void checkModConfigs() {

View File

@@ -2,10 +2,8 @@ package com.gmail.nossr50.party;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Sound; import org.bukkit.Sound;
@@ -15,13 +13,10 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.chat.ChatMode; import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.database.UpgradeType;
import com.gmail.nossr50.datatypes.party.ItemShareType; import com.gmail.nossr50.datatypes.party.ItemShareType;
import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyLeader;
import com.gmail.nossr50.datatypes.party.ShareMode; import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
@@ -137,10 +132,10 @@ public final class PartyManager {
* @param player The player to check * @param player The player to check
* @return all the players in the player's party * @return all the players in the player's party
*/ */
public static LinkedHashMap<UUID, String> getAllMembers(Player player) { public static LinkedHashSet<String> getAllMembers(Player player) {
Party party = getParty(player); Party party = getParty(player);
return party == null ? new LinkedHashMap<UUID, String>() : party.getMembers(); return party == null ? new LinkedHashSet<String>() : party.getMembers();
} }
/** /**
@@ -189,33 +184,9 @@ public final class PartyManager {
* @param playerName The members name * @param playerName The members name
* @return the existing party, null otherwise * @return the existing party, null otherwise
*/ */
@Deprecated
public static Party getPlayerParty(String playerName) { public static Party getPlayerParty(String playerName) {
for (Party party : parties) { for (Party party : parties) {
if (party.getMembers().keySet().contains(playerName)) { if (party.getMembers().contains(playerName)) {
return party;
}
}
return null;
}
/**
* Retrieve a party by a members uuid
*
* @param uuid The members uuid
* @return the existing party, null otherwise
*/
public static Party getPlayerParty(String playerName, UUID uuid) {
for (Party party : parties) {
LinkedHashMap<UUID, String> members = party.getMembers();
if (members.keySet().contains(uuid) || members.values().contains(playerName)) {
// Name changes
if (members.get(uuid) == null || !members.get(uuid).equals(playerName)) {
members.put(uuid, playerName);
}
return party; return party;
} }
} }
@@ -251,22 +222,18 @@ public final class PartyManager {
* @param party The party * @param party The party
*/ */
public static void removeFromParty(OfflinePlayer player, Party party) { public static void removeFromParty(OfflinePlayer player, Party party) {
LinkedHashMap<UUID, String> members = party.getMembers(); LinkedHashSet<String> members = party.getMembers();
String playerName = player.getName(); String playerName = player.getName();
members.remove(player.getUniqueId()); members.remove(playerName);
if (player.isOnline()) {
party.getOnlineMembers().remove(player.getPlayer());
}
if (members.isEmpty()) { if (members.isEmpty()) {
parties.remove(party); parties.remove(party);
} }
else { else {
// If the leaving player was the party leader, appoint a new leader from the party members // If the leaving player was the party leader, appoint a new leader from the party members
if (party.getLeader().getUniqueId().equals(player.getUniqueId())) { if (party.getLeader().equalsIgnoreCase(playerName)) {
setPartyLeader(members.keySet().iterator().next(), party); setPartyLeader(members.iterator().next(), party);
} }
informPartyMembersQuit(party, playerName); informPartyMembersQuit(party, playerName);
@@ -310,8 +277,9 @@ public final class PartyManager {
*/ */
public static void createParty(McMMOPlayer mcMMOPlayer, String partyName, String password) { public static void createParty(McMMOPlayer mcMMOPlayer, String partyName, String password) {
Player player = mcMMOPlayer.getPlayer(); Player player = mcMMOPlayer.getPlayer();
String playerName = player.getName();
Party party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName.replace(".", ""), password); Party party = new Party(playerName, partyName.replace(".", ""), password);
if (password != null) { if (password != null) {
player.sendMessage(LocaleLoader.getString("Party.Password.Set", password)); player.sendMessage(LocaleLoader.getString("Party.Password.Set", password));
@@ -440,13 +408,11 @@ public final class PartyManager {
* @param party The party * @param party The party
*/ */
public static void addToParty(McMMOPlayer mcMMOPlayer, Party party) { public static void addToParty(McMMOPlayer mcMMOPlayer, Party party) {
Player player = mcMMOPlayer.getPlayer(); String playerName = mcMMOPlayer.getPlayer().getName();
String playerName = player.getName();
informPartyMembersJoin(party, playerName); informPartyMembersJoin(party, playerName);
mcMMOPlayer.setParty(party); mcMMOPlayer.setParty(party);
party.getMembers().put(player.getUniqueId(), player.getName()); party.getMembers().add(playerName);
party.getOnlineMembers().add(player);
} }
/** /**
@@ -455,37 +421,36 @@ public final class PartyManager {
* @param partyName The party name * @param partyName The party name
* @return the leader of the party * @return the leader of the party
*/ */
public static String getPartyLeaderName(String partyName) { public static String getPartyLeader(String partyName) {
Party party = getParty(partyName); Party party = getParty(partyName);
return party == null ? null : party.getLeader().getPlayerName(); return party == null ? null : party.getLeader();
} }
/** /**
* Set the leader of a party. * Set the leader of a party.
* *
* @param uuid The uuid of the player to set as leader * @param playerName The name of the player to set as leader
* @param party The party * @param party The party
*/ */
public static void setPartyLeader(UUID uuid, Party party) { public static void setPartyLeader(String playerName, Party party) {
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(uuid); String leaderName = party.getLeader();
UUID leaderUniqueId = party.getLeader().getUniqueId();
for (Player member : party.getOnlineMembers()) { for (Player member : party.getOnlineMembers()) {
UUID memberUniqueId = member.getUniqueId(); String memberName = member.getName();
if (memberUniqueId.equals(player.getUniqueId())) { if (memberName.equalsIgnoreCase(playerName)) {
member.sendMessage(LocaleLoader.getString("Party.Owner.Player")); member.sendMessage(LocaleLoader.getString("Party.Owner.Player"));
} }
else if (memberUniqueId.equals(leaderUniqueId)) { else if (memberName.equalsIgnoreCase(leaderName)) {
member.sendMessage(LocaleLoader.getString("Party.Owner.NotLeader")); member.sendMessage(LocaleLoader.getString("Party.Owner.NotLeader"));
} }
else { else {
member.sendMessage(LocaleLoader.getString("Party.Owner.New", player.getName())); member.sendMessage(LocaleLoader.getString("Party.Owner.New", playerName));
} }
} }
party.setLeader(new PartyLeader(player.getUniqueId(), player.getName())); party.setLeader(playerName);
} }
/** /**
@@ -496,7 +461,7 @@ public final class PartyManager {
public static boolean canInvite(McMMOPlayer mcMMOPlayer) { public static boolean canInvite(McMMOPlayer mcMMOPlayer) {
Party party = mcMMOPlayer.getParty(); Party party = mcMMOPlayer.getParty();
return !party.isLocked() || party.getLeader().getUniqueId().equals(mcMMOPlayer.getPlayer().getUniqueId()); return !party.isLocked() || party.getLeader().equalsIgnoreCase(mcMMOPlayer.getPlayer().getName());
} }
/** /**
@@ -507,11 +472,6 @@ public final class PartyManager {
return; return;
} }
if (mcMMO.getUpgradeManager().shouldUpgrade(UpgradeType.ADD_UUIDS_PARTY)) {
loadAndUpgradeParties();
return;
}
YamlConfiguration partiesFile = YamlConfiguration.loadConfiguration(partyFile); YamlConfiguration partiesFile = YamlConfiguration.loadConfiguration(partyFile);
ArrayList<Party> hasAlly = new ArrayList<Party>(); ArrayList<Party> hasAlly = new ArrayList<Party>();
@@ -519,8 +479,7 @@ public final class PartyManager {
for (String partyName : partiesFile.getConfigurationSection("").getKeys(false)) { for (String partyName : partiesFile.getConfigurationSection("").getKeys(false)) {
Party party = new Party(partyName); Party party = new Party(partyName);
String[] leaderSplit = partiesFile.getString(partyName + ".Leader").split("[|]"); party.setLeader(partiesFile.getString(partyName + ".Leader"));
party.setLeader(new PartyLeader(UUID.fromString(leaderSplit[0]), leaderSplit[1]));
party.setPassword(partiesFile.getString(partyName + ".Password")); party.setPassword(partiesFile.getString(partyName + ".Password"));
party.setLocked(partiesFile.getBoolean(partyName + ".Locked")); party.setLocked(partiesFile.getBoolean(partyName + ".Locked"));
party.setLevel(partiesFile.getInt(partyName + ".Level")); party.setLevel(partiesFile.getInt(partyName + ".Level"));
@@ -537,19 +496,18 @@ public final class PartyManager {
party.setSharingDrops(itemShareType, partiesFile.getBoolean(partyName + ".ItemShareType." + itemShareType.toString(), true)); party.setSharingDrops(itemShareType, partiesFile.getBoolean(partyName + ".ItemShareType." + itemShareType.toString(), true));
} }
LinkedHashMap<UUID, String> members = party.getMembers(); List<String> memberNames = partiesFile.getStringList(partyName + ".Members");
LinkedHashSet<String> members = party.getMembers();
for (String memberEntry : partiesFile.getStringList(partyName + ".Members")) { for (String memberName : memberNames) {
String[] memberSplit = memberEntry.split("[|]"); members.add(memberName);
members.put(UUID.fromString(memberSplit[0]), memberSplit[1]);
} }
parties.add(party); parties.add(party);
} }
mcMMO.p.debug("Loaded (" + parties.size() + ") Parties...");
for (Party party : hasAlly) { for (Party party : hasAlly) {
party.setAlly(PartyManager.getParty(partiesFile.getString(party.getName() + ".Ally"))); party.setAlly(getParty(partiesFile.getString(party.getName() + ".Ally")));
} }
} }
@@ -569,9 +527,8 @@ public final class PartyManager {
mcMMO.p.debug("Saving Parties... (" + parties.size() + ")"); mcMMO.p.debug("Saving Parties... (" + parties.size() + ")");
for (Party party : parties) { for (Party party : parties) {
String partyName = party.getName(); String partyName = party.getName();
PartyLeader leader = party.getLeader();
partiesFile.set(partyName + ".Leader", leader.getUniqueId().toString() + "|" + leader.getPlayerName()); partiesFile.set(partyName + ".Leader", party.getLeader());
partiesFile.set(partyName + ".Password", party.getPassword()); partiesFile.set(partyName + ".Password", party.getPassword());
partiesFile.set(partyName + ".Locked", party.isLocked()); partiesFile.set(partyName + ".Locked", party.isLocked());
partiesFile.set(partyName + ".Level", party.getLevel()); partiesFile.set(partyName + ".Level", party.getLevel());
@@ -584,18 +541,15 @@ public final class PartyManager {
partiesFile.set(partyName + ".ItemShareType." + itemShareType.toString(), party.sharingDrops(itemShareType)); partiesFile.set(partyName + ".ItemShareType." + itemShareType.toString(), party.sharingDrops(itemShareType));
} }
List<String> members = new ArrayList<String>(); List<String> memberNames = new ArrayList<String>();
for (Entry<UUID, String> memberEntry : party.getMembers().entrySet()) { for (String member : party.getMembers()) {
String memberUniqueId = memberEntry.getKey() == null ? "" : memberEntry.getKey().toString(); if (!memberNames.contains(member)) {
String memberName = memberEntry.getValue(); memberNames.add(member);
if (!members.contains(memberName)) {
members.add(memberUniqueId + "|" + memberName);
} }
} }
partiesFile.set(partyName + ".Members", members); partiesFile.set(partyName + ".Members", memberNames);
} }
try { try {
@@ -606,73 +560,6 @@ public final class PartyManager {
} }
} }
private static void loadAndUpgradeParties() {
YamlConfiguration partiesFile = YamlConfiguration.loadConfiguration(partyFile);
if (!partyFile.renameTo(new File(mcMMO.getFlatFileDirectory() + "parties.yml.converted"))) {
mcMMO.p.getLogger().severe("Could not rename parties.yml to parties.yml.converted!");
return;
}
ArrayList<Party> hasAlly = new ArrayList<Party>();
for (String partyName : partiesFile.getConfigurationSection("").getKeys(false)) {
Party party = new Party(partyName);
String leaderName = partiesFile.getString(partyName + ".Leader");
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(leaderName, false);
if (!profile.isLoaded()) {
mcMMO.p.getLogger().warning("Could not find UUID in database for party leader " + leaderName + " in party " + partyName);
continue;
}
UUID leaderUniqueId = profile.getUniqueId();
party.setLeader(new PartyLeader(leaderUniqueId, leaderName));
party.setPassword(partiesFile.getString(partyName + ".Password"));
party.setLocked(partiesFile.getBoolean(partyName + ".Locked"));
party.setLevel(partiesFile.getInt(partyName + ".Level"));
party.setXp(partiesFile.getInt(partyName + ".Xp"));
if (partiesFile.getString(partyName + ".Ally") != null) {
hasAlly.add(party);
}
party.setXpShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ExpShareMode", "NONE")));
party.setItemShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ItemShareMode", "NONE")));
for (ItemShareType itemShareType : ItemShareType.values()) {
party.setSharingDrops(itemShareType, partiesFile.getBoolean(partyName + ".ItemShareType." + itemShareType.toString(), true));
}
LinkedHashMap<UUID, String> members = party.getMembers();
for (String memberName : partiesFile.getStringList(partyName + ".Members")) {
PlayerProfile memberProfile = mcMMO.getDatabaseManager().loadPlayerProfile(memberName, false);
if (!memberProfile.isLoaded()) {
mcMMO.p.getLogger().warning("Could not find UUID in database for party member " + memberName + " in party " + partyName);
continue;
}
UUID memberUniqueId = memberProfile.getUniqueId();
members.put(memberUniqueId, memberName);
}
parties.add(party);
}
mcMMO.p.debug("Loaded (" + parties.size() + ") Parties...");
for (Party party : hasAlly) {
party.setAlly(PartyManager.getParty(partiesFile.getString(party.getName() + ".Ally")));
}
mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS_PARTY);
}
/** /**
* Handle party change event. * Handle party change event.
* *

View File

@@ -37,7 +37,6 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
if (useChat) { if (useChat) {
displayChat(); displayChat();
} }
((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
} }
private void displayChat() { private void displayChat() {

View File

@@ -7,7 +7,6 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.database.PlayerStat; import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@@ -42,9 +41,6 @@ public class MctopCommandDisplayTask extends BukkitRunnable {
displayChat(); displayChat();
} }
if (sender instanceof Player) {
((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
}
sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip")); sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip"));
} }

View File

@@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Level;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@@ -18,9 +17,6 @@ import com.gmail.nossr50.util.uuid.UUIDFetcher;
public class UUIDUpdateAsyncTask extends BukkitRunnable { public class UUIDUpdateAsyncTask extends BukkitRunnable {
private mcMMO plugin; private mcMMO plugin;
private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100); private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100);
private static final int RATE_LIMIT = HiddenConfig.getInstance().getMojangRateLimit();
private static final long LIMIT_PERIOD = HiddenConfig.getInstance().getMojangLimitPeriod();
private static final int BATCH_SIZE = MAX_LOOKUP * 3;
private List<String> userNames; private List<String> userNames;
private int size; private int size;
@@ -45,16 +41,6 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
Map<String, UUID> fetchedUUIDs = new HashMap<String, UUID>(); Map<String, UUID> fetchedUUIDs = new HashMap<String, UUID>();
while (size != 0) { while (size != 0) {
if (checkedUsers + 100 > RATE_LIMIT) {
try {
Thread.sleep(LIMIT_PERIOD);
} catch (InterruptedException e) {
e.printStackTrace();
return;
}
startMillis = System.currentTimeMillis();
checkedUsers = 0;
}
if (size > MAX_LOOKUP) { if (size > MAX_LOOKUP) {
userNamesSection = userNames.subList(size - MAX_LOOKUP, size); userNamesSection = userNames.subList(size - MAX_LOOKUP, size);
size -= MAX_LOOKUP; size -= MAX_LOOKUP;
@@ -68,18 +54,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
fetchedUUIDs.putAll(new UUIDFetcher(userNamesSection).call()); fetchedUUIDs.putAll(new UUIDFetcher(userNamesSection).call());
} }
catch (Exception e) { catch (Exception e) {
// Handle 429 plugin.getLogger().severe("Unable to fetch UUIDs!");
if (e.getMessage().contains("429")) {
try {
Thread.sleep(LIMIT_PERIOD);
} catch (InterruptedException ex) {
e.printStackTrace();
return;
}
continue;
}
plugin.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e);
return; return;
} }
@@ -88,13 +63,9 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
size = userNames.size(); size = userNames.size();
Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis); Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis);
if (fetchedUUIDs.size() >= BATCH_SIZE) {
mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs);
fetchedUUIDs = new HashMap<String, UUID>();
}
} }
if (fetchedUUIDs.size() == 0 || mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs)) { if (mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs)) {
mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS); mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS);
plugin.getLogger().info("UUID upgrade completed!"); plugin.getLogger().info("UUID upgrade completed!");
} }

View File

@@ -1,22 +1,17 @@
package com.gmail.nossr50.runnables.database; package com.gmail.nossr50.runnables.database;
import java.util.concurrent.locks.ReentrantLock;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
public class UserPurgeTask extends BukkitRunnable { public class UserPurgeTask extends BukkitRunnable {
private ReentrantLock lock = new ReentrantLock();
@Override @Override
public void run() { public void run() {
lock.lock();
mcMMO.getDatabaseManager().purgePowerlessUsers(); mcMMO.getDatabaseManager().purgePowerlessUsers();
if (Config.getInstance().getOldUsersCutoff() != -1) { if (Config.getInstance().getOldUsersCutoff() != -1) {
mcMMO.getDatabaseManager().purgeOldUsers(); mcMMO.getDatabaseManager().purgeOldUsers();
} }
lock.unlock();
} }
} }

View File

@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@@ -20,21 +19,21 @@ public class PartyAutoKickTask extends BukkitRunnable {
@Override @Override
public void run() { public void run() {
HashMap<OfflinePlayer, Party> toRemove = new HashMap<OfflinePlayer, Party>(); HashMap<OfflinePlayer, Party> toRemove = new HashMap<OfflinePlayer, Party>();
List<UUID> processedPlayers = new ArrayList<UUID>(); List<String> processedPlayers = new ArrayList<String>();
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
for (Party party : PartyManager.getParties()) { for (Party party : PartyManager.getParties()) {
for (UUID memberUniqueId : party.getMembers().keySet()) { for (String memberName : party.getMembers()) {
OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberUniqueId); OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberName);
boolean isProcessed = processedPlayers.contains(memberUniqueId); boolean isProcessed = processedPlayers.contains(memberName);
if ((!member.isOnline() && (currentTime - member.getLastPlayed() > KICK_TIME)) || isProcessed) { if ((!member.isOnline() && (currentTime - member.getLastPlayed() > KICK_TIME)) || isProcessed) {
toRemove.put(member, party); toRemove.put(member, party);
} }
if (!isProcessed) { if (!isProcessed) {
processedPlayers.add(memberUniqueId); processedPlayers.add(memberName);
} }
} }
} }

View File

@@ -31,7 +31,7 @@ public class PartyChatTask extends BukkitRunnable {
@Override @Override
public void run() { public void run() {
if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader().getPlayerName())) { if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader())) {
message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET); message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET);
} }

View File

@@ -1,15 +0,0 @@
package com.gmail.nossr50.runnables.player;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.player.UserManager;
public class ClearRegisteredXPGainTask extends BukkitRunnable {
@Override
public void run() {
for (McMMOPlayer mcMMOPlayer : UserManager.getPlayers()) {
mcMMOPlayer.getProfile().purgeExpiredXpGains();
}
}
}

View File

@@ -1,5 +1,7 @@
package com.gmail.nossr50.runnables.player; package com.gmail.nossr50.runnables.player;
import java.util.concurrent.locks.ReentrantLock;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@@ -18,23 +20,29 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
private static final int MAX_TRIES = 5; private static final int MAX_TRIES = 5;
private final Player player; private final Player player;
private int attempt = 0; private int attempt = 0;
private ReentrantLock lock = new ReentrantLock();
private boolean cancelled = false;
public PlayerProfileLoadingTask(Player player) { public PlayerProfileLoadingTask(Player player) {
this.player = player; this.player = player;
} }
private PlayerProfileLoadingTask(Player player, int attempt) {
this.player = player;
this.attempt = attempt;
}
// WARNING: ASYNC TASK // WARNING: ASYNC TASK
// DO NOT MODIFY THE McMMOPLAYER FROM THIS CODE // DO NOT MODIFY THE McMMOPLAYER FROM THIS CODE
@Override @Override
public void run() { public void run() {
lock.lock();
if (this.cancelled) {
return;
}
// Quit if they logged out // Quit if they logged out
if (!player.isOnline()) { if (!player.isOnline()) {
mcMMO.p.getLogger().info("Aborting profile loading recovery for " + player.getName() + " - player logged out"); mcMMO.p.getLogger().info("Aborting profile loading recovery for " + player.getName() + " - player logged out");
this.cancel();
cancelled = true;
lock.unlock();
return; return;
} }
@@ -45,6 +53,9 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
// If successful, schedule the apply // If successful, schedule the apply
if (profile.isLoaded()) { if (profile.isLoaded()) {
new ApplySuccessfulProfile(profile).runTask(mcMMO.p); new ApplySuccessfulProfile(profile).runTask(mcMMO.p);
this.cancel();
cancelled = true;
lock.unlock();
return; return;
} }
@@ -53,9 +64,12 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
mcMMO.p.getLogger().severe("Giving up on attempting to load the PlayerProfile for " + player.getName()); mcMMO.p.getLogger().severe("Giving up on attempting to load the PlayerProfile for " + player.getName());
mcMMO.p.getServer().broadcast(LocaleLoader.getString("Profile.Loading.AdminFailureNotice", player.getName()), Server.BROADCAST_CHANNEL_ADMINISTRATIVE); mcMMO.p.getServer().broadcast(LocaleLoader.getString("Profile.Loading.AdminFailureNotice", player.getName()), Server.BROADCAST_CHANNEL_ADMINISTRATIVE);
player.sendMessage(LocaleLoader.getString("Profile.Loading.Failure").split("\n")); player.sendMessage(LocaleLoader.getString("Profile.Loading.Failure").split("\n"));
this.cancel();
cancelled = true;
lock.unlock();
return; return;
} }
new PlayerProfileLoadingTask(player, attempt).runTaskLaterAsynchronously(mcMMO.p, 100 * attempt); lock.unlock();
} }
private class ApplySuccessfulProfile extends BukkitRunnable { private class ApplySuccessfulProfile extends BukkitRunnable {
@@ -90,3 +104,5 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
} }
} }
} }

View File

@@ -6,7 +6,7 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.HiddenConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
@@ -39,7 +39,7 @@ public class AbilityDisableTask extends BukkitRunnable {
// Fallthrough // Fallthrough
case BERSERK: case BERSERK:
if (Config.getInstance().getRefreshChunksEnabled()) { if (HiddenConfig.getInstance().resendChunksAfterBlockAbility()) {
resendChunkRadiusAt(player, 1); resendChunkRadiusAt(player, 1);
} }
// Fallthrough // Fallthrough

View File

@@ -9,7 +9,6 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.ParticleEffectUtils;
@@ -29,10 +28,10 @@ public class BleedTimerTask extends BukkitRunnable {
continue; continue;
} }
double damage; int damage;
if (entity instanceof Player) { if (entity instanceof Player) {
damage = AdvancedConfig.getInstance().getBleedDamagePlayer(); damage = 1;
Player player = (Player) entity; Player player = (Player) entity;
if (!player.isOnline()) { if (!player.isOnline()) {
@@ -45,14 +44,14 @@ public class BleedTimerTask extends BukkitRunnable {
ParticleEffectUtils.playBleedEffect(entity); ParticleEffectUtils.playBleedEffect(entity);
} }
entry.setValue(entry.getValue() - 1); entry.setValue(entry.getValue() - damage);
if (entry.getValue() <= 0) { if (entry.getValue() <= 0) {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Stopped")); player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Stopped"));
} }
} }
else { else {
damage = AdvancedConfig.getInstance().getBleedDamageMobs(); damage = 2;
// Anticipate the entity's death to prevent CME because of our EntityDeathEvent listener // Anticipate the entity's death to prevent CME because of our EntityDeathEvent listener
if (entity.getHealth() - damage > 0) { if (entity.getHealth() - damage > 0) {

View File

@@ -3,7 +3,7 @@ package com.gmail.nossr50.runnables.skills;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Creature;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@@ -11,20 +11,20 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
public class KrakenAttackTask extends BukkitRunnable { public class KrakenAttackTask extends BukkitRunnable {
private LivingEntity kraken; private Creature kraken;
private Player player; private Player player;
private Location location; private Location location;
private final boolean GLOBAL_EFFECTS = AdvancedConfig.getInstance().getKrakenGlobalEffectsEnabled(); private final boolean GLOBAL_EFFECTS = AdvancedConfig.getInstance().getKrakenGlobalEffectsEnabled();
private final String DEFEAT_MESSAGE = AdvancedConfig.getInstance().getPlayerDefeatMessage(); private final String DEFEAT_MESSAGE = AdvancedConfig.getInstance().getPlayerDefeatMessage();
private final String ESCAPE_MESSAGE = AdvancedConfig.getInstance().getPlayerEscapeMessage(); private final String ESCAPE_MESSAGE = AdvancedConfig.getInstance().getPlayerEscapeMessage();
public KrakenAttackTask(LivingEntity kraken2, Player player) { public KrakenAttackTask(Creature kraken, Player player) {
this.kraken = kraken2; this.kraken = kraken;
this.player = player; this.player = player;
} }
public KrakenAttackTask(LivingEntity kraken2, Player player, Location location) { public KrakenAttackTask(Creature kraken, Player player, Location location) {
this.kraken = kraken2; this.kraken = kraken;
this.player = player; this.player = player;
this.location = location; this.location = location;
} }

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