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

Compare commits

..

1 Commits

Author SHA1 Message Date
riking
4f273ad6b4 Fixes for importing profiles while the server is running
- Have the active database return unloaded profiles during import (this triggers the giant warning messages)
 - Reload the users AFTER the conversion is complete, not BEFORE
2013-12-10 15:20:23 -08:00
173 changed files with 1388 additions and 11085 deletions

View File

@@ -8,19 +8,12 @@ Key:
- Removal - Removal
Version 1.4.08-dev Version 1.4.08-dev
+ Added a new skill; Alchemy. Special thanks to EasyMFnE for creating this!
+ Added SecondaryAbilityType enum, and new SecondaryAbilityWeightedActivationCheckEvent, fired when a secondary ability checkes its activation chances + Added SecondaryAbilityType enum, and new SecondaryAbilityWeightedActivationCheckEvent, fired when a secondary ability checkes its activation chances
+ Added the possibility to gain experience when using Fishing "Shake" + Added the possibility to gain experience when using Fishing "Shake"
+ Added config options to disable various sound effects + Added config options to disable various sound effects
+ Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP. + Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
+ Added automatic cleanup of backups folder. + Added automatic cleanup of backups folder.
+ Added bypass permission for finding Fishing traps + Added bypass permission for finding Fishing traps
+ Added level threshold settings to hardcore modes. When a players skill level is below this threshold, they will not lose any stats
+ Added party alliances, two parties can now team up. Allies share party chat and cannot harm each other.
+ Added new experience bonus perk 'mcmmo.perks.xp.10percentboost.<skillname>' multiplies incoming XP by 1.1
+ Added new experience bonus perk 'mcmmo.perks.xp.customboost.<skillname>' multiplies incoming XP by the boost amount defined in the experience config
+ Added Ender Dragon, Wither, and Witch to combat experience multipliers - they do not give XP by default
+ Added support for multiple mod config files, naming can be done as either armor.<modname>.yml or <modname>.armor.yml
= Fixed bug where LeafBlower permissions were ignored = Fixed bug where LeafBlower permissions were ignored
= Fixed bug with toggle commands not properly displaying the success message. = Fixed bug with toggle commands not properly displaying the success message.
= Fixed IllegalArgumentException caused by an empty Fishing treasure category = Fixed IllegalArgumentException caused by an empty Fishing treasure category
@@ -32,21 +25,9 @@ Version 1.4.08-dev
= Fixed bug where disabling hardcore mode for specific skills didn't work = Fixed bug where disabling hardcore mode for specific skills didn't work
= Fixed bug which caused the backup cleanup to delete old backups while it should have kept those = Fixed bug which caused the backup cleanup to delete old backups while it should have kept those
= Fixed bug where party chat broke if the display name contained special characters = Fixed bug where party chat broke if the display name contained special characters
= Fixed bug where `/addlevels all` and `/skillreset all` didn't work
= Fixed bug which made it possible to gain XP by taming the same horse multiple times, if a player "untamed" that horse
= Fixed bug where the /ptp request expiration time was checked wrongly - preventing players from using the command
= Fixed bug where Hylian Luck was broken
= Fixed bug where Snow would never drop treasures
! Changed party system. Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
! Changed appearance of party member list. Gold = party leader, White = online, Gray = offline, Italic = not nearby
! Updated localization files ! Updated localization files
! Changed the appearance of /mcmmo commands
! Changed AxesCritical to CriticalHit in config file ! Changed AxesCritical to CriticalHit in config file
! Changed several secondary ability permissions(deprecated versions still exist) ! Changed several secondary ability permissions(deprecated versions still exist)
! Changed /ptp config setting, Commands.ptp.Confirm_Required is now Commands.ptp.Accept.Required
! Changed config validation for UnlockLevels, they can now also be 0
! Changed config validation for Rank_Levels, successive Ranks can now be less than or equal to each other
- Removed /stats alias for /mcstats
Version 1.4.07 Version 1.4.07
+ Added XP boost to Acrobatics when wearing Boots of Feather Falling + Added XP boost to Acrobatics when wearing Boots of Feather Falling

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

16
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.4.08-SNAPSHOT</version> <version>1.4.08-dev1</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>
@@ -108,10 +108,6 @@
<id>bukkit-repo</id> <id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url> <url>http://repo.bukkit.org/content/groups/public/</url>
</repository> </repository>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
<repository> <repository>
<id>Plugin MetricsExtension</id> <id>Plugin MetricsExtension</id>
<url>http://repo.turt2live.com</url> <url>http://repo.turt2live.com</url>
@@ -121,7 +117,7 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>RELEASE</version> <version>LATEST</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@@ -139,13 +135,9 @@
</dependencies> </dependencies>
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>md_5-releases</id> <id>mcmmo-repo</id>
<url>http://repo.md-5.net/content/repositories/releases/</url> <url>file:///var/lib/jenkins/repo</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>

View File

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

View File

@@ -10,7 +10,6 @@ import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
public class PartyChatManager extends ChatManager { public class PartyChatManager extends ChatManager {
private Party party; private Party party;
@@ -38,13 +37,6 @@ public class PartyChatManager extends ChatManager {
member.sendMessage(message); member.sendMessage(message);
} }
if (party.getAlly() != null) {
for (Player member : party.getAlly().getOnlineMembers()) {
String allyPrefix = LocaleLoader.formatString(Config.getInstance().getPartyChatPrefixAlly());
member.sendMessage(allyPrefix + message);
}
}
plugin.getLogger().info("[P]<" + party.getName() + ">" + message); plugin.getLogger().info("[P]<" + party.getName() + ">" + message);
} }
} }

View File

@@ -10,6 +10,7 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
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;
@@ -39,7 +40,7 @@ public class KrakenCommand implements TabExecutor {
return true; return true;
} }
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) { if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) {

View File

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

View File

@@ -10,6 +10,7 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.commands.CommandUtils; import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
@@ -38,7 +39,7 @@ public abstract class ToggleCommand implements TabExecutor {
return true; return true;
} }
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) { if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) {

View File

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

View File

@@ -3,13 +3,10 @@ package com.gmail.nossr50.commands.database;
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 com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.database.DatabaseManagerFactory; import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.database.DatabaseType; import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.database.DatabaseConversionTask; import com.gmail.nossr50.runnables.database.DatabaseConversionTask;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
@@ -52,17 +49,6 @@ public class ConvertDatabaseCommand implements CommandExecutor {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Start", previousType.toString(), newType.toString())); sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Start", previousType.toString(), newType.toString()));
UserManager.saveAll(); UserManager.saveAll();
UserManager.clearAll();
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
PlayerProfile profile = oldDatabase.loadPlayerProfile(player.getName(), false);
if (profile.isLoaded()) {
mcMMO.getDatabaseManager().saveUser(profile);
}
UserManager.addUser(player);
}
new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p); new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p);
return true; return true;

View File

@@ -11,6 +11,7 @@ import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
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;
@@ -21,7 +22,7 @@ public class McremoveCommand implements TabExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) { switch (args.length) {
case 1: case 1:
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
if (UserManager.getPlayer(playerName, true) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) { if (UserManager.getPlayer(playerName, true) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
return true; return true;

View File

@@ -15,6 +15,7 @@ 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.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
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;
@@ -23,8 +24,6 @@ import com.google.common.collect.ImmutableList;
public abstract class ExperienceCommand implements TabExecutor { public abstract class ExperienceCommand implements TabExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
SkillType skill;
switch (args.length) { switch (args.length) {
case 2: case 2:
if (CommandUtils.noConsoleUsage(sender)) { if (CommandUtils.noConsoleUsage(sender)) {
@@ -40,13 +39,7 @@ public abstract class ExperienceCommand implements TabExecutor {
return true; return true;
} }
skill = SkillType.getSkill(args[0]); editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]), Integer.parseInt(args[1]));
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]));
return true; return true;
case 3: case 3:
@@ -59,15 +52,15 @@ public abstract class ExperienceCommand implements TabExecutor {
return true; return true;
} }
skill = SkillType.getSkill(args[1]); SkillType skill;
if (args[1].equalsIgnoreCase("all")) { if (args[1].equalsIgnoreCase("all")) {
skill = null; skill = null;
} else {
skill = SkillType.getSkill(args[1]);
} }
int value = Integer.parseInt(args[2]); int value = Integer.parseInt(args[2]);
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process. // If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
@@ -112,7 +105,11 @@ public abstract class ExperienceCommand implements TabExecutor {
protected abstract void handlePlayerMessageSkill(Player player, int value, SkillType skill); protected abstract void handlePlayerMessageSkill(Player player, int value, SkillType skill);
private boolean validateArguments(CommandSender sender, String skillName, String value) { private boolean validateArguments(CommandSender sender, String skillName, String value) {
return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName))); if (CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName))) {
return false;
}
return true;
} }
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) { protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
@@ -126,7 +123,7 @@ public abstract class ExperienceCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) { protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) { for (SkillType skillType : SkillType.values()) {
handleCommand(player, profile, skillType, value); handleCommand(player, profile, skillType, value);
} }

View File

@@ -16,10 +16,10 @@ 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.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
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;
/** /**
@@ -65,7 +65,7 @@ public class SkillresetCommand implements TabExecutor {
skill = SkillType.getSkill(args[1]); skill = SkillType.getSkill(args[1]);
} }
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process. // If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
@@ -134,7 +134,11 @@ public class SkillresetCommand implements TabExecutor {
} }
private boolean validateArguments(CommandSender sender, String skillName) { private boolean validateArguments(CommandSender sender, String skillName) {
return !(CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all")); if (CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all")) {
return false;
}
return true;
} }
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) { protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
@@ -148,7 +152,7 @@ public class SkillresetCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill) { protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) { for (SkillType skillType : SkillType.values()) {
handleCommand(player, profile, skillType); handleCommand(player, profile, skillType);
} }

View File

@@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
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;
import com.gmail.nossr50.util.commands.CommandUtils; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
public class PartyChangeOwnerCommand implements CommandExecutor { public class PartyChangeOwnerCommand implements CommandExecutor {
@@ -17,7 +17,7 @@ public class PartyChangeOwnerCommand implements CommandExecutor {
switch (args.length) { switch (args.length) {
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 = Misc.getMatchedPlayerName(args[1]);
if (!playerParty.getMembers().contains(targetName)) { if (!playerParty.getMembers().contains(targetName)) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));

View File

@@ -1,6 +1,9 @@
package com.gmail.nossr50.commands.party; package com.gmail.nossr50.commands.party;
import java.util.*; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
@@ -11,7 +14,6 @@ import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.chat.PartyChatCommand; import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@@ -23,7 +25,7 @@ import com.google.common.collect.ImmutableList;
public class PartyCommand implements TabExecutor { public class PartyCommand implements TabExecutor {
private static final List<String> PARTY_SUBCOMMANDS; private static final List<String> PARTY_SUBCOMMANDS;
private static final List<String> XPSHARE_COMPLETIONS = ImmutableList.of("none", "equal"); private static final List<String> EXPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
private static final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc"); private static final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc");
static { static {
@@ -41,7 +43,7 @@ public class PartyCommand implements TabExecutor {
private CommandExecutor partyAcceptCommand = new PartyAcceptCommand(); private CommandExecutor partyAcceptCommand = new PartyAcceptCommand();
private CommandExecutor partyCreateCommand = new PartyCreateCommand(); private CommandExecutor partyCreateCommand = new PartyCreateCommand();
private CommandExecutor partyQuitCommand = new PartyQuitCommand(); private CommandExecutor partyQuitCommand = new PartyQuitCommand();
private CommandExecutor partyXpShareCommand = new PartyXpShareCommand(); private CommandExecutor partyExpShareCommand = new PartyExpShareCommand();
private CommandExecutor partyItemShareCommand = new PartyItemShareCommand(); private CommandExecutor partyItemShareCommand = new PartyItemShareCommand();
private CommandExecutor partyInviteCommand = new PartyInviteCommand(); private CommandExecutor partyInviteCommand = new PartyInviteCommand();
private CommandExecutor partyKickCommand = new PartyKickCommand(); private CommandExecutor partyKickCommand = new PartyKickCommand();
@@ -54,7 +56,6 @@ public class PartyCommand implements TabExecutor {
private CommandExecutor partyHelpCommand = new PartyHelpCommand(); private CommandExecutor partyHelpCommand = new PartyHelpCommand();
private CommandExecutor partyTeleportCommand = mcMMO.p.getCommand("ptp").getExecutor(); private CommandExecutor partyTeleportCommand = mcMMO.p.getCommand("ptp").getExecutor();
private CommandExecutor partyChatCommand = new PartyChatCommand(); private CommandExecutor partyChatCommand = new PartyChatCommand();
private CommandExecutor partyAllianceCommand = new PartyAllianceCommand();
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@@ -132,8 +133,8 @@ public class PartyCommand implements TabExecutor {
} }
switch (subcommand) { switch (subcommand) {
case XPSHARE: case EXPSHARE:
return partyXpShareCommand.onCommand(sender, command, label, args); return partyExpShareCommand.onCommand(sender, command, label, args);
case ITEMSHARE: case ITEMSHARE:
return partyItemShareCommand.onCommand(sender, command, label, args); return partyItemShareCommand.onCommand(sender, command, label, args);
case KICK: case KICK:
@@ -149,8 +150,6 @@ public class PartyCommand implements TabExecutor {
return partyChangePasswordCommand.onCommand(sender, command, label, args); return partyChangePasswordCommand.onCommand(sender, command, label, args);
case RENAME: case RENAME:
return partyRenameCommand.onCommand(sender, command, label, args); return partyRenameCommand.onCommand(sender, command, label, args);
case ALLIANCE:
return partyAllianceCommand.onCommand(sender, command, label, args);
default: default:
break; break;
} }
@@ -177,8 +176,8 @@ public class PartyCommand implements TabExecutor {
case OWNER: case OWNER:
Set<String> playerNames = UserManager.getPlayerNames(); Set<String> playerNames = UserManager.getPlayerNames();
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size())); return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
case XPSHARE: case EXPSHARE:
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<String>(XPSHARE_COMPLETIONS.size())); return StringUtil.copyPartialMatches(args[1], EXPSHARE_COMPLETIONS, new ArrayList<String>(EXPSHARE_COMPLETIONS.size()));
case ITEMSHARE: case ITEMSHARE:
return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<String>(ITEMSHARE_COMPLETIONS.size())); return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<String>(ITEMSHARE_COMPLETIONS.size()));
case LOCK: case LOCK:
@@ -217,7 +216,13 @@ public class PartyCommand implements TabExecutor {
} }
private String[] extractArgs(String[] args) { private String[] extractArgs(String[] args) {
return Arrays.copyOfRange(args, 1, args.length - 1); String[] newArgs = new String[args.length - 1];
for (int i = 1; i < args.length; i++) {
newArgs[i - 1] = args[i];
}
return newArgs;
} }
private boolean isItemShareCategory(String category) { private boolean isItemShareCategory(String category) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -11,8 +11,6 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
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.party.PartyTeleportRecord; import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
@@ -42,15 +40,6 @@ public class PtpCommand implements TabExecutor {
return true; return true;
} }
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
Party party = mcMMOPlayer.getParty();
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.TELEPORT)) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.2"));
return true;
}
switch (args.length) { switch (args.length) {
case 1: case 1:
if (args[0].equalsIgnoreCase("toggle")) { if (args[0].equalsIgnoreCase("toggle")) {
@@ -61,6 +50,9 @@ public class PtpCommand implements TabExecutor {
return ptpAcceptAnyCommand.onCommand(sender, command, label, args); return ptpAcceptAnyCommand.onCommand(sender, command, label, args);
} }
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
long recentlyHurt = mcMMOPlayer.getRecentlyHurt(); long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
int hurtCooldown = Config.getInstance().getPTPCommandRecentlyHurtCooldown(); int hurtCooldown = Config.getInstance().getPTPCommandRecentlyHurtCooldown();
@@ -94,7 +86,7 @@ public class PtpCommand implements TabExecutor {
} }
} }
sendTeleportRequest(sender, player, CommandUtils.getMatchedPlayerName(args[0])); sendTeleportRequest(sender, player, Misc.getMatchedPlayerName(args[0]));
return true; return true;
default: default:

View File

@@ -16,6 +16,7 @@ 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.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
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;
@@ -28,7 +29,7 @@ public class InspectCommand implements TabExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) { switch (args.length) {
case 1: case 1:
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process. // If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.

View File

@@ -46,7 +46,7 @@ public class McrankCommand implements TabExecutor {
return true; return true;
} }
String playerName = CommandUtils.getMatchedPlayerName(args[0]); String playerName = Misc.getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
if (mcMMOPlayer != null) { if (mcMMOPlayer != null) {
@@ -93,7 +93,7 @@ public class McrankCommand implements TabExecutor {
} }
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getRankUseBoard()); boolean useBoard = (sender instanceof Player) && (Config.getInstance().getRankUseBoard());
boolean useChat = !useBoard || Config.getInstance().getRankUseChat(); boolean useChat = useBoard ? Config.getInstance().getRankUseChat() : true;
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p); new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
} }

View File

@@ -99,7 +99,7 @@ public class MctopCommand implements TabExecutor {
private void display(int page, SkillType skill, CommandSender sender) { private void display(int page, SkillType skill, CommandSender sender) {
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getTopUseBoard()); boolean useBoard = (sender instanceof Player) && (Config.getInstance().getTopUseBoard());
boolean useChat = !useBoard || Config.getInstance().getTopUseChat(); boolean useChat = useBoard ? Config.getInstance().getTopUseChat() : true;
new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p); new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
} }

View File

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

View File

@@ -159,7 +159,7 @@ public class FishingCommand extends SkillCommand {
List<String> messages = new ArrayList<String>(); List<String> messages = new ArrayList<String>();
if (canTreasureHunt) { if (canTreasureHunt) {
messages.add(LocaleLoader.getString("Fishing.Ability.Rank", lootTier, Tier.values().length)); messages.add(LocaleLoader.getString("Fishing.Ability.Rank", lootTier, Tier.EIGHT.toNumerical()));
messages.add(LocaleLoader.getString("Fishing.Ability.TH.DropRate", trapTreasure, commonTreasure, uncommonTreasure, rareTreasure, epicTreasure, legendaryTreasure, recordTreasure)); messages.add(LocaleLoader.getString("Fishing.Ability.TH.DropRate", trapTreasure, commonTreasure, uncommonTreasure, rareTreasure, epicTreasure, legendaryTreasure, recordTreasure));
} }

View File

@@ -121,7 +121,7 @@ public class MiningCommand extends SkillCommand {
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", unlockLevel))); messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", unlockLevel)));
} }
else { else {
messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, Tier.values().length, LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, Tier.EIGHT.toNumerical(), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
} }
} }

View File

@@ -148,7 +148,7 @@ public class RepairCommand extends SkillCommand {
if (canArcaneForge) { if (canArcaneForge) {
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager(); RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
messages.add(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), Tier.values().length)); messages.add(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), Tier.EIGHT.toNumerical()));
if (ArcaneForging.arcaneForgingEnchantLoss) { if (ArcaneForging.arcaneForgingEnchantLoss) {
messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Success", (arcaneBypass ? 100 : repairManager.getKeepEnchantChance()))); messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Success", (arcaneBypass ? 100 : repairManager.getKeepEnchantChance())));

View File

@@ -4,7 +4,6 @@ import java.text.DecimalFormat;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.gmail.nossr50.util.Motd;
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;
@@ -88,7 +87,8 @@ public abstract class SkillCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Effects.Effects"))); player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Effects.Effects")));
if (isLucky) { if (isLucky) {
player.sendMessage(Motd.PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc", skillName))); String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix");
player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc", skillName)));
} }
for (String message : effectMessages) { for (String message : effectMessages) {

View File

@@ -6,7 +6,6 @@ import java.util.List;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility; import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.fishing.Fishing; import com.gmail.nossr50.skills.fishing.Fishing;
import com.gmail.nossr50.skills.mining.BlastMining; import com.gmail.nossr50.skills.mining.BlastMining;
import com.gmail.nossr50.skills.repair.ArcaneForging; import com.gmail.nossr50.skills.repair.ArcaneForging;
@@ -80,38 +79,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Acrobatics.GracefulRoll.DamageThreshold should be at least 0!"); reason.add("Skills.Acrobatics.GracefulRoll.DamageThreshold should be at least 0!");
} }
/* ALCHEMY */
if (getCatalysisUnlockLevel() < 0) {
reason.add("Skills.Alchemy.Catalysis.UnlockLevel should be at least 0!");
}
if (getCatalysisMaxBonusLevel() <= getCatalysisUnlockLevel()) {
reason.add("Skills.Alchemy.Catalysis.MaxBonusLevel should be greater than Skills.Alchemy.Catalysis.UnlockLevel!");
}
if (getCatalysisMinSpeed() <= 0) {
reason.add("Skills.Alchemy.Catalysis.MinSpeed must be greater than 0!");
}
if (getCatalysisMaxSpeed() < getCatalysisMinSpeed()) {
reason.add("Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed!");
}
List<Alchemy.Tier> alchemyTierList = Arrays.asList(Alchemy.Tier.values());
for (Alchemy.Tier tier : alchemyTierList) {
if (getConcoctionsTierLevel(tier) < 0) {
reason.add("Skills.Alchemy.Rank_Levels.Rank_" + tier.toNumerical() + " should be at least 0!");
}
if (tier != Alchemy.Tier.fromNumerical(Alchemy.Tier.values().length)) {
Alchemy.Tier nextTier = alchemyTierList.get(alchemyTierList.indexOf(tier) - 1);
if (getConcoctionsTierLevel(tier) > getConcoctionsTierLevel(nextTier)) {
reason.add("Skills.Alchemy.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Alchemy.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
}
}
}
/* ARCHERY */ /* ARCHERY */
if (getSkillShotIncreaseLevel() < 1) { if (getSkillShotIncreaseLevel() < 1) {
reason.add("Skills.Archery.SkillShot.IncreaseLevel should be at least 1!"); reason.add("Skills.Archery.SkillShot.IncreaseLevel should be at least 1!");
@@ -221,8 +188,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != Fishing.Tier.EIGHT) { if (tier != Fishing.Tier.EIGHT) {
Fishing.Tier nextTier = fishingTierList.get(fishingTierList.indexOf(tier) - 1); Fishing.Tier nextTier = fishingTierList.get(fishingTierList.indexOf(tier) - 1);
if (getFishingTierLevel(tier) > getFishingTierLevel(nextTier)) { if (getFishingTierLevel(tier) >= getFishingTierLevel(nextTier)) {
reason.add("Skills.Fishing.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Fishing.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); reason.add("Skills.Fishing.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Fishing.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
} }
if (getShakeChance(tier) > getShakeChance(nextTier)) { if (getShakeChance(tier) > getShakeChance(nextTier)) {
@@ -239,12 +206,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Fishing.FishermansDiet.RankChange should be at least 1!"); reason.add("Skills.Fishing.FishermansDiet.RankChange should be at least 1!");
} }
if (getIceFishingUnlockLevel() < 0) { if (getIceFishingUnlockLevel() < 1) {
reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 0!"); reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 1!");
} }
if (getMasterAnglerUnlockLevel() < 0) { if (getMasterAnglerUnlockLevel() < 1) {
reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 0!"); reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 1!");
} }
if (getMasterAnglerBoatModifier() < 1) { if (getMasterAnglerBoatModifier() < 1) {
@@ -335,8 +302,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != BlastMining.Tier.EIGHT) { if (tier != BlastMining.Tier.EIGHT) {
BlastMining.Tier nextTier = blastMiningTierList.get(blastMiningTierList.indexOf(tier) - 1); BlastMining.Tier nextTier = blastMiningTierList.get(blastMiningTierList.indexOf(tier) - 1);
if (getBlastMiningRankLevel(tier) > getBlastMiningRankLevel(nextTier)) { if (getBlastMiningRankLevel(tier) >= getBlastMiningRankLevel(nextTier)) {
reason.add("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Mining.BlastMining.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); reason.add("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Mining.BlastMining.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
} }
if (getBlastDamageDecrease(tier) > getBlastDamageDecrease(nextTier)) { if (getBlastDamageDecrease(tier) > getBlastDamageDecrease(nextTier)) {
@@ -378,8 +345,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!"); reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!");
} }
if (getSalvageUnlockLevel() < 0) { if (getSalvageUnlockLevel() < 1) {
reason.add("Skills.Repair.Salvage.UnlockLevel should be at least 0!"); reason.add("Skills.Repair.Salvage.UnlockLevel should be at least 1!");
} }
List<ArcaneForging.Tier> arcaneForgingTierList = Arrays.asList(ArcaneForging.Tier.values()); List<ArcaneForging.Tier> arcaneForgingTierList = Arrays.asList(ArcaneForging.Tier.values());
@@ -400,8 +367,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != ArcaneForging.Tier.EIGHT) { if (tier != ArcaneForging.Tier.EIGHT) {
ArcaneForging.Tier nextTier = arcaneForgingTierList.get(arcaneForgingTierList.indexOf(tier) - 1); ArcaneForging.Tier nextTier = arcaneForgingTierList.get(arcaneForgingTierList.indexOf(tier) - 1);
if (getArcaneForgingRankLevel(tier) > getArcaneForgingRankLevel(nextTier)) { if (getArcaneForgingRankLevel(tier) >= getArcaneForgingRankLevel(nextTier)) {
reason.add("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); reason.add("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
} }
if (getArcaneForgingDowngradeChance(nextTier) > getArcaneForgingDowngradeChance(tier)) { if (getArcaneForgingDowngradeChance(nextTier) > getArcaneForgingDowngradeChance(tier)) {
@@ -431,8 +398,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!"); reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!");
} }
if (getFluxMiningUnlockLevel() < 0) { if (getFluxMiningUnlockLevel() < 1) {
reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 0!"); reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 1!");
} }
if (getFluxMiningChance() < 1) { if (getFluxMiningChance() < 1) {
@@ -453,11 +420,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
if (tier != Smelting.Tier.EIGHT) { if (tier != Smelting.Tier.EIGHT) {
Smelting.Tier nextTier = smeltingTierList.get(smeltingTierList.indexOf(tier) - 1); Smelting.Tier nextTier = smeltingTierList.get(smeltingTierList.indexOf(tier) - 1);
if (getSmeltingRankLevel(tier) > getSmeltingRankLevel(nextTier)) { if (getSmeltingRankLevel(tier) >= getSmeltingRankLevel(nextTier)) {
reason.add("Skills.Smelting.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Smelting.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); reason.add("Skills.Smelting.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Smelting.Rank_Levels.Rank_" + nextTier.toNumerical() + "!");
} }
if (getSmeltingVanillaXPBoostMultiplier(tier) > getSmeltingVanillaXPBoostMultiplier(nextTier)) { if (getSmeltingVanillaXPBoostMultiplier(tier) > getSmeltingRankLevel(nextTier)) {
reason.add("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Smelting.VanillaXPMultiplier.Rank_" + nextTier.toNumerical() + "!"); reason.add("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Smelting.VanillaXPMultiplier.Rank_" + nextTier.toNumerical() + "!");
} }
} }
@@ -522,40 +489,40 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Taming.Gore.Modifier should be at least 1!"); reason.add("Skills.Taming.Gore.Modifier should be at least 1!");
} }
if (getFastFoodUnlock() < 0) { if (getFastFoodUnlock() < 1) {
reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 0!"); reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 1!");
} }
if (getFastFoodChance() < 1) { if (getFastFoodChance() < 1) {
reason.add("Skills.Taming.FastFood.Chance should be at least 1!"); reason.add("Skills.Taming.FastFood.Chance should be at least 1!");
} }
if (getEnviromentallyAwareUnlock() < 0) { if (getEnviromentallyAwareUnlock() < 1) {
reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 0!"); reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 1!");
} }
if (getThickFurUnlock() < 0) { if (getThickFurUnlock() < 1) {
reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 0!"); reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 1!");
} }
if (getThickFurModifier() < 1) { if (getThickFurModifier() < 1) {
reason.add("Skills.Taming.ThickFur.Modifier should be at least 1!"); reason.add("Skills.Taming.ThickFur.Modifier should be at least 1!");
} }
if (getHolyHoundUnlock() < 0) { if (getHolyHoundUnlock() < 1) {
reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 0!"); reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 1!");
} }
if (getShockProofUnlock() < 0) { if (getShockProofUnlock() < 1) {
reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 0!"); reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 1!");
} }
if (getShockProofModifier() < 1) { if (getShockProofModifier() < 1) {
reason.add("Skills.Taming.ShockProof.Modifier should be at least 1!"); reason.add("Skills.Taming.ShockProof.Modifier should be at least 1!");
} }
if (getSharpenedClawsUnlock() < 0) { if (getSharpenedClawsUnlock() < 1) {
reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 0!"); reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 1!");
} }
if (getSharpenedClawsBonus() < 1) { if (getSharpenedClawsBonus() < 1) {
@@ -608,8 +575,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
} }
/* WOODCUTTING */ /* WOODCUTTING */
if (getLeafBlowUnlockLevel() < 0) { if (getLeafBlowUnlockLevel() < 1) {
reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 0!"); reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 1!");
} }
if (getMaxChance(SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) < 1) { if (getMaxChance(SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) < 1) {
@@ -657,15 +624,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); } public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); }
/* ALCHEMY */
public int getCatalysisUnlockLevel() { return config.getInt("Skills.Alchemy.Catalysis.UnlockLevel", 100); }
public int getCatalysisMaxBonusLevel() { return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); }
public double getCatalysisMinSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); }
public double getCatalysisMaxSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); }
public int getConcoctionsTierLevel(Alchemy.Tier tier) { return config.getInt("Skills.Alchemy.Rank_Levels.Rank_" + tier.toNumerical()); }
/* ARCHERY */ /* ARCHERY */
public int getSkillShotIncreaseLevel() { return config.getInt("Skills.Archery.SkillShot.IncreaseLevel", 50); } public int getSkillShotIncreaseLevel() { return config.getInt("Skills.Archery.SkillShot.IncreaseLevel", 50); }
public double getSkillShotIncreasePercentage() { return config.getDouble("Skills.Archery.SkillShot.IncreasePercentage", 0.1D); } public double getSkillShotIncreasePercentage() { return config.getDouble("Skills.Archery.SkillShot.IncreasePercentage", 0.1D); }

View File

@@ -9,7 +9,6 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import com.gmail.nossr50.datatypes.MobHealthbarType; import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
@@ -110,7 +109,7 @@ public class Config extends AutoUpdateConfigLoader {
} }
if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) { if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) {
reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 9!"); reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 64!");
} }
if (getChimaeraItem() == null) { if (getChimaeraItem() == null) {
@@ -147,16 +146,6 @@ public class Config extends AutoUpdateConfigLoader {
reason.add("Party.Sharing.Range should be greater than 0!"); reason.add("Party.Sharing.Range should be greater than 0!");
} }
if (getPartyXpCurveMultiplier() < 1) {
reason.add("Party.Leveling.Xp_Curve_Modifier should be at least 1!");
}
for (PartyFeature partyFeature : PartyFeature.values()) {
if (getPartyFeatureUnlockLevel(partyFeature) < 0) {
reason.add("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!");
}
}
/* Inspect command distance */ /* Inspect command distance */
if (getInspectDistance() <= 0) { if (getInspectDistance() <= 0) {
reason.add("Commands.inspect.Max_Distance should be greater than 0!"); reason.add("Commands.inspect.Max_Distance should be greater than 0!");
@@ -223,7 +212,6 @@ public class Config extends AutoUpdateConfigLoader {
public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); } public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); } public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); }
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.partychat.Use_Display_Names", true); } public boolean getPartyDisplayNames() { return config.getBoolean("Commands.partychat.Use_Display_Names", true); }
public String getPartyChatPrefixAlly() { return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); }
public String getAdminChatPrefix() { return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); } public String getAdminChatPrefix() { return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.adminchat.Use_Display_Names", true); } public boolean getAdminDisplayNames() { return config.getBoolean("Commands.adminchat.Use_Display_Names", true); }
@@ -314,16 +302,12 @@ public class Config extends AutoUpdateConfigLoader {
public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); } public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); }
public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); } public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); }
public int getHardcoreDeathStatPenaltyLevelThreshold() { return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); }
public boolean getHardcoreVampirismEnabled(SkillType skillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), false); } public boolean getHardcoreVampirismEnabled(SkillType skillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), false); }
public void setHardcoreVampirismEnabled(SkillType skillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), enabled); } public void setHardcoreVampirismEnabled(SkillType skillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(skillType.toString()), enabled); }
public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); } public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); }
public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); } public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); }
public int getHardcoreVampirismLevelThreshold() { return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); }
/* SMP Mods */ /* SMP Mods */
public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); } public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Armor_Mods_Enabled", false); } public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Armor_Mods_Enabled", false); }
@@ -354,29 +338,19 @@ public class Config extends AutoUpdateConfigLoader {
/* PARTY SETTINGS */ /* PARTY SETTINGS */
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); } public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); } public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
public boolean getExpShareEnabled() { return config.getBoolean("Party.Sharing.ExpShare_enabled", true); }
public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); } public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); }
public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); } public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); }
public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); } public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); }
public boolean getItemShareEnabled() { return config.getBoolean("Party.Sharing.ItemShare_enabled", true); }
public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0D); } public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0D); }
public int getPartyLevelCap() {
int cap = config.getInt("Party.Leveling.Level_Cap", 10);
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
public int getPartyXpCurveMultiplier() { return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); }
public boolean getPartyXpNearMembersNeeded() { return config.getBoolean("Party.Leveling.Near_Members_Needed", false); }
public boolean getPartyInformAllMembers() { return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); }
public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); }
/* Party Teleport Settings */ /* Party Teleport Settings */
public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); } public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); }
public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); } public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); }
public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); } public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); }
public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); } public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Accept_Required", true); } public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); } public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); }
/* Inspect command distance */ /* Inspect command distance */
@@ -425,10 +399,6 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); } public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
public boolean getPreventXPAfterTeleport() { return config.getBoolean("Skills.Acrobatics.Prevent_XP_After_Teleport", true); } public boolean getPreventXPAfterTeleport() { return config.getBoolean("Skills.Acrobatics.Prevent_XP_After_Teleport", true); }
/* Alchemy */
public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); }
public boolean getPreventHopperTransfer() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer", false); }
/* Fishing */ /* Fishing */
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); } public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }

View File

@@ -76,11 +76,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
* XP SETTINGS * XP SETTINGS
*/ */
/* Alchemy */
if (getPotionXP() <= 0) {
reason.add("Experience.Alchemy.Potion should be greater than 0!");
}
/* Combat XP Multipliers */ /* Combat XP Multipliers */
if (getAnimalsXP() < 0) { if (getAnimalsXP() < 0) {
reason.add("Experience.Combat.Multiplier.Animals should be at least 0!"); reason.add("Experience.Combat.Multiplier.Animals should be at least 0!");
@@ -179,9 +174,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Skill modifiers */ /* Skill modifiers */
public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); } public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); }
/* Custom XP perk */
public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); }
/* Conversion */ /* Conversion */
public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); } public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); }
@@ -207,9 +199,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public double getFeatherFallXPModifier() { return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); } public double getFeatherFallXPModifier() { return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); }
/* Alchemy */
public double getPotionXP() { return config.getDouble("Experience.Alchemy.Potion", 150D); }
/* Fishing */ /* Fishing */
public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); } public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
public int getFishingShakeXP() { return config.getInt("Experience.Fishing.Shake", 50); } public int getFishingShakeXP() { return config.getInt("Experience.Fishing.Shake", 50); }

View File

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

View File

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

View File

@@ -16,22 +16,42 @@ import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
public class CustomArmorConfig extends ConfigLoader { public class CustomArmorConfig extends ConfigLoader {
private static CustomArmorConfig instance;
private boolean needsUpdate = false; private boolean needsUpdate = false;
public List<Material> customBoots = new ArrayList<Material>(); private List<Repairable> repairables;
public List<Material> customChestplates = new ArrayList<Material>();
public List<Material> customHelmets = new ArrayList<Material>();
public List<Material> customLeggings = new ArrayList<Material>();
public List<Repairable> repairables = new ArrayList<Repairable>(); private List<Material> customBoots = new ArrayList<Material>();
private List<Material> customChestplates = new ArrayList<Material>();
private List<Material> customHelmets = new ArrayList<Material>();
private List<Material> customLeggings = new ArrayList<Material>();
protected CustomArmorConfig(String fileName) { public CustomArmorConfig() {
super("mods", fileName); super("mods", "armor.yml");
loadKeys(); loadKeys();
} }
public static CustomArmorConfig getInstance() {
if (instance == null) {
instance = new CustomArmorConfig();
}
return instance;
}
public List<Repairable> getLoadedRepairables() {
if (repairables == null) {
return new ArrayList<Repairable>();
}
return repairables;
}
@Override @Override
protected void loadKeys() { protected void loadKeys() {
repairables = new ArrayList<Repairable>();
loadArmor("Boots", customBoots); loadArmor("Boots", customBoots);
loadArmor("Chestplates", customChestplates); loadArmor("Chestplates", customChestplates);
loadArmor("Helmets", customHelmets); loadArmor("Helmets", customHelmets);
@@ -97,4 +117,20 @@ public class CustomArmorConfig extends ConfigLoader {
materialList.add(armorMaterial); materialList.add(armorMaterial);
} }
} }
public boolean isCustomBoots(Material material) {
return customBoots.contains(material);
}
public boolean isCustomChestplate(Material material) {
return customChestplates.contains(material);
}
public boolean isCustomHelmet(Material material) {
return customHelmets.contains(material);
}
public boolean isCustomLeggings(Material material) {
return customLeggings.contains(material);
}
} }

View File

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

View File

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

View File

@@ -18,26 +18,46 @@ import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
public class CustomToolConfig extends ConfigLoader { public class CustomToolConfig extends ConfigLoader {
private static CustomToolConfig instance;
private boolean needsUpdate = false; private boolean needsUpdate = false;
public List<Material> customAxes = new ArrayList<Material>(); private List<Repairable> repairables;
public List<Material> customBows = new ArrayList<Material>();
public List<Material> customHoes = new ArrayList<Material>();
public List<Material> customPickaxes = new ArrayList<Material>();
public List<Material> customShovels = new ArrayList<Material>();
public List<Material> customSwords = new ArrayList<Material>();
public HashMap<Material, CustomTool> customToolMap = new HashMap<Material, CustomTool>(); private List<Material> customAxes = new ArrayList<Material>();
private List<Material> customBows = new ArrayList<Material>();
private List<Material> customHoes = new ArrayList<Material>();
private List<Material> customPickaxes = new ArrayList<Material>();
private List<Material> customShovels = new ArrayList<Material>();
private List<Material> customSwords = new ArrayList<Material>();
public List<Repairable> repairables = new ArrayList<Repairable>(); private HashMap<Material, CustomTool> customToolMap = new HashMap<Material, CustomTool>();
protected CustomToolConfig(String fileName) { private CustomToolConfig() {
super("mods", fileName); super("mods", "tools.yml");
loadKeys(); loadKeys();
} }
public static CustomToolConfig getInstance() {
if (instance == null) {
instance = new CustomToolConfig();
}
return instance;
}
public List<Repairable> getLoadedRepairables() {
if (repairables == null) {
return new ArrayList<Repairable>();
}
return repairables;
}
@Override @Override
protected void loadKeys() { protected void loadKeys() {
repairables = new ArrayList<Repairable>();
loadTool("Axes", customAxes); loadTool("Axes", customAxes);
loadTool("Bows", customBows); loadTool("Bows", customBows);
loadTool("Hoes", customHoes); loadTool("Hoes", customHoes);
@@ -112,4 +132,36 @@ public class CustomToolConfig extends ConfigLoader {
customToolMap.put(toolMaterial, tool); customToolMap.put(toolMaterial, tool);
} }
} }
public boolean isCustomAxe(Material material) {
return customAxes.contains(material);
}
public boolean isCustomBow(Material material) {
return customBows.contains(material);
}
public boolean isCustomHoe(Material material) {
return customHoes.contains(material);
}
public boolean isCustomPickaxe(Material material) {
return customPickaxes.contains(material);
}
public boolean isCustomShovel(Material material) {
return customShovels.contains(material);
}
public boolean isCustomSword(Material material) {
return customSwords.contains(material);
}
public boolean isCustomTool(Material material) {
return customToolMap.containsKey(material);
}
public CustomTool getCustomTool(Material material) {
return customToolMap.get(material);
}
} }

View File

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

View File

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

View File

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

View File

@@ -21,7 +21,8 @@ public interface DatabaseManager {
public void purgePowerlessUsers(); public void purgePowerlessUsers();
/** /**
* Purge users who haven't logged on in over a certain time frame from the database. * Purge users who haven't logged on in over a certain time frame from the
* database.
*/ */
public void purgeOldUsers(); public void purgeOldUsers();
@@ -42,13 +43,13 @@ public interface DatabaseManager {
public boolean saveUser(PlayerProfile profile); public boolean saveUser(PlayerProfile profile);
/** /**
* Retrieve leaderboard info. * Retrieve leaderboard info.
* *
* @param skillName The skill to retrieve info on * @param skillName The skill to retrieve info on
* @param pageNumber Which page in the leaderboards to retrieve * @param pageNumber Which page in the leaderboards to retrieve
* @param statsPerPage The number of stats per page * @param statsPerPage The number of stats per page
* @return the requested leaderboard information * @return the requested leaderboard information
*/ */
public List<PlayerStat> readLeaderboard(SkillType skill, int pageNumber, int statsPerPage); public List<PlayerStat> readLeaderboard(SkillType skill, int pageNumber, int statsPerPage);
/** /**
@@ -74,9 +75,9 @@ public interface DatabaseManager {
* *
* @param playerName The name of the player to load from the database * @param playerName The name of the player to load from the database
* @param createNew Whether to create a new record if the player is not * @param createNew Whether to create a new record if the player is not
* found * found
* @return The player's data, or an unloaded PlayerProfile if not found * @return The player's data, or an unloaded PlayerProfile if not found
* and createNew is false * and createNew is false
*/ */
public PlayerProfile loadPlayerProfile(String playerName, boolean createNew); public PlayerProfile loadPlayerProfile(String playerName, boolean createNew);
@@ -96,9 +97,17 @@ public interface DatabaseManager {
public void convertUsers(DatabaseManager destination); public void convertUsers(DatabaseManager destination);
/** /**
* Retrieve the type of database in use. Custom databases should return CUSTOM. * Retrieve the type of database in use. Custom databases should return
* CUSTOM.
* *
* @return The type of database * @return The type of database
*/ */
public DatabaseType getDatabaseType(); public DatabaseType getDatabaseType();
/**
* Used for database conversion. If this is set to true, profiles may not
* be loaded from the database. This method will be called before and
* after database imports.
*/
public void setLoadingDisabled(boolean state);
} }

View File

@@ -35,6 +35,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
private final long UPDATE_WAIT_TIME = 600000L; // 10 minutes private final long UPDATE_WAIT_TIME = 600000L; // 10 minutes
private final File usersFile; private final File usersFile;
private static final Object fileWritingLock = new Object(); private static final Object fileWritingLock = new Object();
private volatile boolean converting = false;
protected FlatfileDatabaseManager() { protected FlatfileDatabaseManager() {
usersFile = new File(mcMMO.getUsersFilePath()); usersFile = new File(mcMMO.getUsersFilePath());
@@ -42,6 +43,10 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
updateLeaderboards(); updateLeaderboards();
} }
public void setLoadingDisabled(boolean state) {
converting = state;
}
public void purgePowerlessUsers() { public void purgePowerlessUsers() {
int purgedUsers = 0; int purgedUsers = 0;
@@ -56,7 +61,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try { try {
in = new BufferedReader(new FileReader(usersFilePath)); in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder(); StringBuilder writer = new StringBuilder();
String line; String line = "";
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
String[] character = line.split(":"); String[] character = line.split(":");
@@ -111,7 +116,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try { try {
in = new BufferedReader(new FileReader(usersFilePath)); in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder(); StringBuilder writer = new StringBuilder();
String line; String line = "";
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
String[] character = line.split(":"); String[] character = line.split(":");
@@ -173,7 +178,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try { try {
in = new BufferedReader(new FileReader(usersFilePath)); in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder(); StringBuilder writer = new StringBuilder();
String line; String line = "";
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
// Write out the same file but when we get to the player we want to remove, we skip his line. // Write out the same file but when we get to the player we want to remove, we skip his line.
@@ -265,8 +270,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":"); writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":");
MobHealthbarType mobHealthbarType = profile.getMobHealthbarType(); MobHealthbarType mobHealthbarType = profile.getMobHealthbarType();
writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":"); writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":");
writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
writer.append("\r\n"); writer.append("\r\n");
} }
} }
@@ -356,8 +359,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
out.append("0:"); // Blast Mining out.append("0:"); // Blast Mining
out.append(String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)).append(":"); // LastLogin out.append(String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)).append(":"); // LastLogin
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:"); // AlchemyXp
// Add more in the same format as the line above // Add more in the same format as the line above
@@ -373,6 +374,10 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
} }
public PlayerProfile loadPlayerProfile(String playerName, boolean create) { public PlayerProfile loadPlayerProfile(String playerName, boolean create) {
if (converting) {
return new PlayerProfile(playerName, false);
}
BufferedReader in = null; BufferedReader in = null;
String usersFilePath = mcMMO.getUsersFilePath(); String usersFilePath = mcMMO.getUsersFilePath();
@@ -390,7 +395,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
continue; continue;
} }
return loadFromLine(character); PlayerProfile p = loadFromLine(character);
return p;
} }
// Didn't find the player, create a new one // Didn't find the player, create a new one
@@ -506,7 +512,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
List<PlayerStat> unarmed = new ArrayList<PlayerStat>(); List<PlayerStat> unarmed = new ArrayList<PlayerStat>();
List<PlayerStat> taming = new ArrayList<PlayerStat>(); List<PlayerStat> taming = new ArrayList<PlayerStat>();
List<PlayerStat> fishing = new ArrayList<PlayerStat>(); List<PlayerStat> fishing = new ArrayList<PlayerStat>();
List<PlayerStat> alchemy = new ArrayList<PlayerStat>();
BufferedReader in = null; BufferedReader in = null;
String playerName = null; String playerName = null;
@@ -514,7 +519,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
synchronized (fileWritingLock) { synchronized (fileWritingLock) {
try { try {
in = new BufferedReader(new FileReader(usersFilePath)); in = new BufferedReader(new FileReader(usersFilePath));
String line; String line = "";
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
String[] data = line.split(":"); String[] data = line.split(":");
@@ -524,7 +529,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
Map<SkillType, Integer> skills = getSkillMapFromLine(data); Map<SkillType, Integer> skills = getSkillMapFromLine(data);
powerLevel += putStat(acrobatics, playerName, skills.get(SkillType.ACROBATICS)); powerLevel += putStat(acrobatics, playerName, skills.get(SkillType.ACROBATICS));
powerLevel += putStat(alchemy, playerName, skills.get(SkillType.ALCHEMY));
powerLevel += putStat(archery, playerName, skills.get(SkillType.ARCHERY)); powerLevel += putStat(archery, playerName, skills.get(SkillType.ARCHERY));
powerLevel += putStat(axes, playerName, skills.get(SkillType.AXES)); powerLevel += putStat(axes, playerName, skills.get(SkillType.AXES));
powerLevel += putStat(excavation, playerName, skills.get(SkillType.EXCAVATION)); powerLevel += putStat(excavation, playerName, skills.get(SkillType.EXCAVATION));
@@ -562,7 +566,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
Collections.sort(acrobatics, c); Collections.sort(acrobatics, c);
Collections.sort(taming, c); Collections.sort(taming, c);
Collections.sort(fishing, c); Collections.sort(fishing, c);
Collections.sort(alchemy, c);
Collections.sort(powerLevels, c); Collections.sort(powerLevels, c);
playerStatHash.put(SkillType.MINING, mining); playerStatHash.put(SkillType.MINING, mining);
@@ -577,7 +580,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
playerStatHash.put(SkillType.ACROBATICS, acrobatics); playerStatHash.put(SkillType.ACROBATICS, acrobatics);
playerStatHash.put(SkillType.TAMING, taming); playerStatHash.put(SkillType.TAMING, taming);
playerStatHash.put(SkillType.FISHING, fishing); playerStatHash.put(SkillType.FISHING, fishing);
playerStatHash.put(SkillType.ALCHEMY, alchemy);
} }
/** /**
@@ -593,7 +595,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try { try {
in = new BufferedReader(new FileReader(usersFilePath)); in = new BufferedReader(new FileReader(usersFilePath));
StringBuilder writer = new StringBuilder(); StringBuilder writer = new StringBuilder();
String line; String line = "";
HashSet<String> players = new HashSet<String>(); HashSet<String> players = new HashSet<String>();
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
@@ -630,7 +632,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
} }
// If they're valid, rewrite them to the file. // If they're valid, rewrite them to the file.
if (character.length > 40) { if (character.length > 38) {
writer.append(line).append("\r\n"); writer.append(line).append("\r\n");
continue; continue;
} }
@@ -682,15 +684,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
oldVersion = "1.4.06"; oldVersion = "1.4.06";
} }
} }
if (character.length <= 40) {
// Addition of Alchemy
// Version 1.4.08
newLine.append("0").append(":");
newLine.append("0").append(":");
if (oldVersion == null) {
oldVersion = "1.4.08";
}
}
if (oldVersion != null) { if (oldVersion != null) {
mcMMO.p.debug("Updating database line for player " + character[0] + " from before version " + oldVersion); mcMMO.p.debug("Updating database line for player " + character[0] + " from before version " + oldVersion);
@@ -787,7 +780,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.AXES, (float) Integer.valueOf(character[21])); skillsXp.put(SkillType.AXES, (float) Integer.valueOf(character[21]));
skillsXp.put(SkillType.ACROBATICS, (float) Integer.valueOf(character[22])); skillsXp.put(SkillType.ACROBATICS, (float) Integer.valueOf(character[22]));
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]));
// Taming - Unused // Taming - Unused
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32])); skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
@@ -827,7 +819,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
skills.put(SkillType.AXES, Integer.valueOf(character[13])); skills.put(SkillType.AXES, Integer.valueOf(character[13]));
skills.put(SkillType.ACROBATICS, Integer.valueOf(character[14])); skills.put(SkillType.ACROBATICS, Integer.valueOf(character[14]));
skills.put(SkillType.FISHING, Integer.valueOf(character[34])); skills.put(SkillType.FISHING, Integer.valueOf(character[34]));
skills.put(SkillType.ALCHEMY, Integer.valueOf(character[39]));
return skills; return skills;
} }

View File

@@ -49,12 +49,19 @@ public final class SQLDatabaseManager implements DatabaseManager {
// How many connection attempts have failed // How many connection attempts have failed
private int reconnectAttempt = 0; private int reconnectAttempt = 0;
// If we're importing users, do not allow creation of profiles
private volatile boolean converting = false;
protected SQLDatabaseManager() { protected SQLDatabaseManager() {
checkStructure(); checkStructure();
new SQLDatabaseKeepaliveTask(this).runTaskTimerAsynchronously(mcMMO.p, 10, 60L * 60 * Misc.TICK_CONVERSION_FACTOR); new SQLDatabaseKeepaliveTask(this).runTaskTimerAsynchronously(mcMMO.p, 10, 60L * 60 * Misc.TICK_CONVERSION_FACTOR);
} }
public void setLoadingDisabled(boolean state) {
converting = state;
}
public void purgePowerlessUsers() { public void purgePowerlessUsers() {
if (!checkConnected()) { if (!checkConnected()) {
return; return;
@@ -152,7 +159,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ " taming = ?, mining = ?, repair = ?, woodcutting = ?" + " taming = ?, mining = ?, repair = ?, woodcutting = ?"
+ ", unarmed = ?, herbalism = ?, excavation = ?" + ", unarmed = ?, herbalism = ?, excavation = ?"
+ ", archery = ?, swords = ?, axes = ?, acrobatics = ?" + ", archery = ?, swords = ?, axes = ?, acrobatics = ?"
+ ", fishing = ?, alchemy = ? WHERE user_id = ?", + ", fishing = ? WHERE user_id = ?",
profile.getSkillLevel(SkillType.TAMING), profile.getSkillLevel(SkillType.TAMING),
profile.getSkillLevel(SkillType.MINING), profile.getSkillLevel(SkillType.MINING),
profile.getSkillLevel(SkillType.REPAIR), profile.getSkillLevel(SkillType.REPAIR),
@@ -165,14 +172,13 @@ public final class SQLDatabaseManager implements DatabaseManager {
profile.getSkillLevel(SkillType.AXES), profile.getSkillLevel(SkillType.AXES),
profile.getSkillLevel(SkillType.ACROBATICS), profile.getSkillLevel(SkillType.ACROBATICS),
profile.getSkillLevel(SkillType.FISHING), profile.getSkillLevel(SkillType.FISHING),
profile.getSkillLevel(SkillType.ALCHEMY),
userId); userId);
success &= saveIntegers( success &= saveIntegers(
"UPDATE " + tablePrefix + "experience SET " "UPDATE " + tablePrefix + "experience SET "
+ " taming = ?, mining = ?, repair = ?, woodcutting = ?" + " taming = ?, mining = ?, repair = ?, woodcutting = ?"
+ ", unarmed = ?, herbalism = ?, excavation = ?" + ", unarmed = ?, herbalism = ?, excavation = ?"
+ ", archery = ?, swords = ?, axes = ?, acrobatics = ?" + ", archery = ?, swords = ?, axes = ?, acrobatics = ?"
+ ", fishing = ?, alchemy = ? WHERE user_id = ?", + ", fishing = ? WHERE user_id = ?",
profile.getSkillXpLevel(SkillType.TAMING), profile.getSkillXpLevel(SkillType.TAMING),
profile.getSkillXpLevel(SkillType.MINING), profile.getSkillXpLevel(SkillType.MINING),
profile.getSkillXpLevel(SkillType.REPAIR), profile.getSkillXpLevel(SkillType.REPAIR),
@@ -185,7 +191,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
profile.getSkillXpLevel(SkillType.AXES), profile.getSkillXpLevel(SkillType.AXES),
profile.getSkillXpLevel(SkillType.ACROBATICS), profile.getSkillXpLevel(SkillType.ACROBATICS),
profile.getSkillXpLevel(SkillType.FISHING), profile.getSkillXpLevel(SkillType.FISHING),
profile.getSkillXpLevel(SkillType.ALCHEMY),
userId); userId);
return success; return success;
} }
@@ -194,8 +199,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
List<PlayerStat> stats = new ArrayList<PlayerStat>(); List<PlayerStat> stats = new ArrayList<PlayerStat>();
if (checkConnected()) { if (checkConnected()) {
String query = skill == null ? "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy" : skill.name().toLowerCase(); String query = skill == null ? "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing" : skill.name().toLowerCase();
ResultSet resultSet; ResultSet resultSet = null;
PreparedStatement statement = null; PreparedStatement statement = null;
try { try {
@@ -273,9 +278,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
} }
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " + String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
"WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy > 0 " + "WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing > 0 " +
"AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy > " + "AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing > " +
"(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy " + "(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing " +
"FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = ?)"; "FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = ?)";
PreparedStatement statement = connection.prepareStatement(sql); PreparedStatement statement = connection.prepareStatement(sql);
@@ -288,11 +293,11 @@ public final class SQLDatabaseManager implements DatabaseManager {
statement.close(); statement.close();
sql = "SELECT user, taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy " + sql = "SELECT user, taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing " +
"FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " + "FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
"WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy > 0 " + "WHERE taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing > 0 " +
"AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy = " + "AND taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing = " +
"(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy " + "(SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing " +
"FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = ?) ORDER BY user"; "FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = ?) ORDER BY user";
statement = connection.prepareStatement(sql); statement = connection.prepareStatement(sql);
@@ -348,12 +353,16 @@ public final class SQLDatabaseManager implements DatabaseManager {
} }
public PlayerProfile loadPlayerProfile(String playerName, boolean create) { public PlayerProfile loadPlayerProfile(String playerName, boolean create) {
if (converting) {
return new PlayerProfile(playerName, false); // return unloaded profile during database conversion
}
return loadPlayerProfile(playerName, create, true); return loadPlayerProfile(playerName, create, true);
} }
private PlayerProfile loadPlayerProfile(String playerName, boolean create, boolean retry) { private PlayerProfile loadPlayerProfile(String playerName, boolean create, boolean retry) {
if (!checkConnected()) { if (!checkConnected()) {
return new PlayerProfile(playerName, false); // return fake profile if not connected return new PlayerProfile(playerName, false); // return unloaded profile if not connected
} }
PreparedStatement statement = null; PreparedStatement statement = null;
@@ -361,8 +370,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
try { try {
statement = connection.prepareStatement( statement = connection.prepareStatement(
"SELECT " "SELECT "
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, " + "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, " + "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, " + "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
+ "h.mobhealthbar " + "h.mobhealthbar "
+ "FROM " + tablePrefix + "users u " + "FROM " + tablePrefix + "users u "
@@ -437,8 +446,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
try { try {
statement = connection.prepareStatement( statement = connection.prepareStatement(
"SELECT " "SELECT "
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, " + "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, " + "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, " + "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
+ "h.mobhealthbar " + "h.mobhealthbar "
+ "FROM " + tablePrefix + "users u " + "FROM " + tablePrefix + "users u "
@@ -448,16 +457,16 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ "JOIN " + tablePrefix + "huds h ON (u.id = h.user_id) " + "JOIN " + tablePrefix + "huds h ON (u.id = h.user_id) "
+ "WHERE u.user = ?"); + "WHERE u.user = ?");
List<String> usernames = getStoredUsers(); List<String> usernames = getStoredUsers();
ResultSet resultSet; ResultSet result = null;
int convertedUsers = 0; int convertedUsers = 0;
long startMillis = System.currentTimeMillis(); long startMillis = System.currentTimeMillis();
for (String playerName : usernames) { for (String playerName : usernames) {
statement.setString(1, playerName); statement.setString(1, playerName);
try { try {
resultSet = statement.executeQuery(); result = statement.executeQuery();
resultSet.next(); result.next();
destination.saveUser(loadFromResult(playerName, resultSet)); destination.saveUser(loadFromResult(playerName, result));
resultSet.close(); result.close();
} }
catch (SQLException e) { catch (SQLException e) {
// Ignore // Ignore
@@ -689,7 +698,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ "`axes` int(10) unsigned NOT NULL DEFAULT '0'," + "`axes` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0'," + "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`fishing` int(10) unsigned NOT NULL DEFAULT '0'," + "`fishing` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`alchemy` int(10) unsigned NOT NULL DEFAULT '0',"
+ "PRIMARY KEY (`user_id`)) " + "PRIMARY KEY (`user_id`)) "
+ "DEFAULT CHARSET=latin1;"); + "DEFAULT CHARSET=latin1;");
write("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "experience` (" write("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "experience` ("
@@ -706,7 +714,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ "`axes` int(10) unsigned NOT NULL DEFAULT '0'," + "`axes` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0'," + "`acrobatics` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`fishing` int(10) unsigned NOT NULL DEFAULT '0'," + "`fishing` int(10) unsigned NOT NULL DEFAULT '0',"
+ "`alchemy` int(10) unsigned NOT NULL DEFAULT '0',"
+ "PRIMARY KEY (`user_id`)) " + "PRIMARY KEY (`user_id`)) "
+ "DEFAULT CHARSET=latin1;"); + "DEFAULT CHARSET=latin1;");
@@ -732,10 +739,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
sql = "SELECT * FROM `" + tablePrefix + "experience` ORDER BY `" + tablePrefix + "experience`.`fishing` ASC LIMIT 0 , 30"; sql = "SELECT * FROM `" + tablePrefix + "experience` ORDER BY `" + tablePrefix + "experience`.`fishing` ASC LIMIT 0 , 30";
break; break;
case ALCHEMY:
sql = "SELECT * FROM `" + tablePrefix + "experience` ORDER BY `" + tablePrefix + "experience`.`alchemy` ASC LIMIT 0 , 30";
break;
case INDEX: case INDEX:
if (read("SHOW INDEX FROM " + tablePrefix + "skills").size() != 13 && checkConnected()) { if (read("SHOW INDEX FROM " + tablePrefix + "skills").size() != 13 && checkConnected()) {
mcMMO.p.getLogger().info("Indexing tables, this may take a while on larger databases"); mcMMO.p.getLogger().info("Indexing tables, this may take a while on larger databases");
@@ -798,7 +801,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
break; break;
} }
ResultSet resultSet; ResultSet resultSet = null;
HashMap<Integer, ArrayList<String>> rows = new HashMap<Integer, ArrayList<String>>(); HashMap<Integer, ArrayList<String>> rows = new HashMap<Integer, ArrayList<String>>();
PreparedStatement statement = null; PreparedStatement statement = null;
@@ -838,12 +841,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
write("ALTER TABLE `" + tablePrefix + "huds` ADD `mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "' ;"); write("ALTER TABLE `" + tablePrefix + "huds` ADD `mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "' ;");
break; break;
case ALCHEMY:
mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Alchemy...");
write("ALTER TABLE `"+tablePrefix + "skills` ADD `alchemy` int(10) NOT NULL DEFAULT '0' ;");
write("ALTER TABLE `"+tablePrefix + "experience` ADD `alchemy` int(10) NOT NULL DEFAULT '0' ;");
break;
default: default:
break; break;
} }
@@ -984,7 +981,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
int result = -1; int result = -1;
if (checkConnected()) { if (checkConnected()) {
ResultSet resultSet; ResultSet resultSet = null;
try { try {
resultSet = statement.executeQuery(); resultSet = statement.executeQuery();
@@ -1197,9 +1194,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
MobHealthbarType mobHealthbarType; MobHealthbarType mobHealthbarType;
final int OFFSET_SKILLS = 0; // TODO update these numbers when the query changes (a new skill is added) final int OFFSET_SKILLS = 0; // TODO update these numbers when the query changes (a new skill is added)
final int OFFSET_XP = 13; final int OFFSET_XP = 12;
final int OFFSET_DATS = 26; final int OFFSET_DATS = 24;
final int OFFSET_OTHER = 38; final int OFFSET_OTHER = 36;
skills.put(SkillType.TAMING, result.getInt(OFFSET_SKILLS + 1)); skills.put(SkillType.TAMING, result.getInt(OFFSET_SKILLS + 1));
skills.put(SkillType.MINING, result.getInt(OFFSET_SKILLS + 2)); skills.put(SkillType.MINING, result.getInt(OFFSET_SKILLS + 2));
@@ -1213,7 +1210,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
skills.put(SkillType.AXES, result.getInt(OFFSET_SKILLS + 10)); skills.put(SkillType.AXES, result.getInt(OFFSET_SKILLS + 10));
skills.put(SkillType.ACROBATICS, result.getInt(OFFSET_SKILLS + 11)); skills.put(SkillType.ACROBATICS, result.getInt(OFFSET_SKILLS + 11));
skills.put(SkillType.FISHING, result.getInt(OFFSET_SKILLS + 12)); skills.put(SkillType.FISHING, result.getInt(OFFSET_SKILLS + 12));
skills.put(SkillType.ALCHEMY, result.getInt(OFFSET_SKILLS + 13));
skillsXp.put(SkillType.TAMING, result.getFloat(OFFSET_XP + 1)); skillsXp.put(SkillType.TAMING, result.getFloat(OFFSET_XP + 1));
skillsXp.put(SkillType.MINING, result.getFloat(OFFSET_XP + 2)); skillsXp.put(SkillType.MINING, result.getFloat(OFFSET_XP + 2));
@@ -1227,7 +1223,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.AXES, result.getFloat(OFFSET_XP + 10)); skillsXp.put(SkillType.AXES, result.getFloat(OFFSET_XP + 10));
skillsXp.put(SkillType.ACROBATICS, result.getFloat(OFFSET_XP + 11)); skillsXp.put(SkillType.ACROBATICS, result.getFloat(OFFSET_XP + 11));
skillsXp.put(SkillType.FISHING, result.getFloat(OFFSET_XP + 12)); skillsXp.put(SkillType.FISHING, result.getFloat(OFFSET_XP + 12));
skillsXp.put(SkillType.ALCHEMY, result.getFloat(OFFSET_XP + 13));
// Taming - Unused - result.getInt(OFFSET_DATS + 1) // Taming - Unused - result.getInt(OFFSET_DATS + 1)
skillsDATS.put(AbilityType.SUPER_BREAKER, result.getInt(OFFSET_DATS + 2)); skillsDATS.put(AbilityType.SUPER_BREAKER, result.getInt(OFFSET_DATS + 2));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,7 +31,6 @@ import com.gmail.nossr50.runnables.skills.AbilityDisableTask;
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;
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
import com.gmail.nossr50.skills.archery.ArcheryManager; import com.gmail.nossr50.skills.archery.ArcheryManager;
import com.gmail.nossr50.skills.axes.AxesManager; import com.gmail.nossr50.skills.axes.AxesManager;
import com.gmail.nossr50.skills.child.FamilyTree; import com.gmail.nossr50.skills.child.FamilyTree;
@@ -47,6 +46,7 @@ import com.gmail.nossr50.skills.unarmed.UnarmedManager;
import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModUtils;
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.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.ParticleEffectUtils;
@@ -63,7 +63,6 @@ public class McMMOPlayer {
private Party party; private Party party;
private Party invite; private Party invite;
private Party allianceInvite;
private int itemShareModifier; private int itemShareModifier;
private PartyTeleportRecord ptpRecord; private PartyTeleportRecord ptpRecord;
@@ -75,9 +74,6 @@ public class McMMOPlayer {
private boolean abilityUse = true; private boolean abilityUse = true;
private boolean godMode; private boolean godMode;
private Sound recentSound;
private int lastSound;
private final Map<AbilityType, Boolean> abilityMode = new HashMap<AbilityType, Boolean>(); private final Map<AbilityType, Boolean> abilityMode = new HashMap<AbilityType, Boolean>();
private final Map<AbilityType, Boolean> abilityInformed = new HashMap<AbilityType, Boolean>(); private final Map<AbilityType, Boolean> abilityInformed = new HashMap<AbilityType, Boolean>();
@@ -196,10 +192,6 @@ public class McMMOPlayer {
return (AcrobaticsManager) skillManagers.get(SkillType.ACROBATICS); return (AcrobaticsManager) skillManagers.get(SkillType.ACROBATICS);
} }
public AlchemyManager getAlchemyManager() {
return (AlchemyManager) skillManagers.get(SkillType.ALCHEMY);
}
public ArcheryManager getArcheryManager() { public ArcheryManager getArcheryManager() {
return (ArcheryManager) skillManagers.get(SkillType.ARCHERY); return (ArcheryManager) skillManagers.get(SkillType.ARCHERY);
} }
@@ -445,50 +437,6 @@ public class McMMOPlayer {
godMode = !godMode; godMode = !godMode;
} }
/*
* Sounds
*/
/**
* Play a sound at the players location.
* Sound will only get played if it's different
* compared to the previously played sound or if the cooldown has expired.
*
* @param sound The Sound to play
* @param volume Volume of the sound
* @param pitch Pitch of the sound
* @param cooldown Cooldown time between sounds
*/
public void playSound(Sound sound, float volume, float pitch, int cooldown) {
if (getRecentSound() == sound && !SkillUtils.cooldownExpired(getLastSound(), 1)) {
return;
}
setRecentSound(sound);
actualizeLastSound();
player.playSound(player.getLocation(), sound, volume, pitch);
}
public void playSound(Sound sound, float volume, float pitch) {
playSound(sound, volume, pitch, 1);
}
public Sound getRecentSound() {
return recentSound;
}
public void setRecentSound(Sound recentSound) {
this.recentSound = recentSound;
}
public int getLastSound() {
return lastSound;
}
public void actualizeLastSound() {
lastSound = (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR);
}
/* /*
* Skill notifications * Skill notifications
*/ */
@@ -560,14 +508,6 @@ public class McMMOPlayer {
*/ */
public void beginUnsharedXpGain(SkillType skill, float xp) { public void beginUnsharedXpGain(SkillType skill, float xp) {
applyXpGain(skill, modifyXpGain(skill, xp)); applyXpGain(skill, modifyXpGain(skill, xp));
if (party == null) {
return;
}
if (!Config.getInstance().getPartyXpNearMembersNeeded() || !PartyManager.getNearMembers(this).isEmpty()) {
party.applyXpGain(modifyXpGain(skill, xp));
}
} }
/** /**
@@ -689,22 +629,6 @@ public class McMMOPlayer {
return ptpRecord; return ptpRecord;
} }
public void setPartyAllianceInvite(Party allianceInvite) {
this.allianceInvite = allianceInvite;
}
public Party getPartyAllianceInvite() {
return allianceInvite;
}
public boolean hasPartyAllianceInvite() {
return (allianceInvite != null);
}
public void removePartyAllianceInvite() {
allianceInvite = null;
}
public int getItemShareModifier() { public int getItemShareModifier() {
if (itemShareModifier < 10) { if (itemShareModifier < 10) {
setItemShareModifier(10); setItemShareModifier(10);
@@ -771,12 +695,12 @@ public class McMMOPlayer {
switch (mode) { switch (mode) {
case ADMIN: case ADMIN:
adminChatMode = !adminChatMode; adminChatMode = !adminChatMode;
partyChatMode = !adminChatMode && partyChatMode; partyChatMode = adminChatMode ? false : partyChatMode;
return; return;
case PARTY: case PARTY:
partyChatMode = !partyChatMode; partyChatMode = !partyChatMode;
adminChatMode = !partyChatMode && adminChatMode; adminChatMode = partyChatMode ? false : adminChatMode;
return; return;
default: default:
@@ -803,7 +727,7 @@ public class McMMOPlayer {
xp = (float) (xp / skillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()); xp = (float) (xp / skillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier());
if (Config.getInstance().getToolModsEnabled()) { if (Config.getInstance().getToolModsEnabled()) {
CustomTool tool = mcMMO.getModManager().getTool(player.getItemInHand()); CustomTool tool = ModUtils.getToolFromItemStack(player.getItemInHand());
if (tool != null) { if (tool != null) {
xp *= tool.getXpMultiplier(); xp *= tool.getXpMultiplier();
@@ -889,7 +813,7 @@ public class McMMOPlayer {
ItemStack inHand = player.getItemInHand(); ItemStack inHand = player.getItemInHand();
if (mcMMO.getModManager().isCustomTool(inHand) && !mcMMO.getModManager().getTool(inHand).isAbilityEnabled()) { if (ModUtils.isCustomTool(inHand) && !ModUtils.getToolFromItemStack(inHand).isAbilityEnabled()) {
return; return;
} }

View File

@@ -6,10 +6,6 @@ public enum SecondaryAbility {
GRACEFUL_ROLL, GRACEFUL_ROLL,
ROLL, ROLL,
/* ALCHEMY */
CATALYSIS,
CONCOCTIONS,
/* ARCHERY */ /* ARCHERY */
DAZE, DAZE,
RETRIEVE, RETRIEVE,

View File

@@ -15,7 +15,6 @@ import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
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;
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
import com.gmail.nossr50.skills.archery.ArcheryManager; import com.gmail.nossr50.skills.archery.ArcheryManager;
import com.gmail.nossr50.skills.axes.AxesManager; import com.gmail.nossr50.skills.axes.AxesManager;
import com.gmail.nossr50.skills.excavation.ExcavationManager; import com.gmail.nossr50.skills.excavation.ExcavationManager;
@@ -36,7 +35,6 @@ import com.google.common.collect.ImmutableList;
public enum SkillType { public enum SkillType {
ACROBATICS(AcrobaticsManager.class, Color.WHITE, ImmutableList.of(SecondaryAbility.DODGE, SecondaryAbility.GRACEFUL_ROLL, SecondaryAbility.ROLL)), ACROBATICS(AcrobaticsManager.class, Color.WHITE, ImmutableList.of(SecondaryAbility.DODGE, SecondaryAbility.GRACEFUL_ROLL, SecondaryAbility.ROLL)),
ALCHEMY(AlchemyManager.class, Color.FUCHSIA, ImmutableList.of(SecondaryAbility.CATALYSIS, SecondaryAbility.CONCOCTIONS)),
ARCHERY(ArcheryManager.class, Color.MAROON, ImmutableList.of(SecondaryAbility.DAZE, SecondaryAbility.RETRIEVE, SecondaryAbility.SKILL_SHOT)), ARCHERY(ArcheryManager.class, Color.MAROON, ImmutableList.of(SecondaryAbility.DAZE, SecondaryAbility.RETRIEVE, SecondaryAbility.SKILL_SHOT)),
AXES(AxesManager.class, Color.AQUA, AbilityType.SKULL_SPLITTER, ToolType.AXE, ImmutableList.of(SecondaryAbility.ARMOR_IMPACT, SecondaryAbility.AXE_MASTERY, SecondaryAbility.CRITICAL_HIT, SecondaryAbility.GREATER_IMPACT)), AXES(AxesManager.class, Color.AQUA, AbilityType.SKULL_SPLITTER, ToolType.AXE, ImmutableList.of(SecondaryAbility.ARMOR_IMPACT, SecondaryAbility.AXE_MASTERY, SecondaryAbility.CRITICAL_HIT, SecondaryAbility.GREATER_IMPACT)),
EXCAVATION(ExcavationManager.class, Color.fromRGB(139, 69, 19), AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL, ImmutableList.of(SecondaryAbility.EXCAVATION_TREASURE_HUNTER)), EXCAVATION(ExcavationManager.class, Color.fromRGB(139, 69, 19), AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL, ImmutableList.of(SecondaryAbility.EXCAVATION_TREASURE_HUNTER)),
@@ -63,7 +61,7 @@ public enum SkillType {
public static final List<SkillType> COMBAT_SKILLS = ImmutableList.of(ARCHERY, AXES, SWORDS, TAMING, UNARMED); public static final List<SkillType> COMBAT_SKILLS = ImmutableList.of(ARCHERY, AXES, SWORDS, TAMING, UNARMED);
public static final List<SkillType> GATHERING_SKILLS = ImmutableList.of(EXCAVATION, FISHING, HERBALISM, MINING, WOODCUTTING); public static final List<SkillType> GATHERING_SKILLS = ImmutableList.of(EXCAVATION, FISHING, HERBALISM, MINING, WOODCUTTING);
public static final List<SkillType> MISC_SKILLS = ImmutableList.of(ACROBATICS, ALCHEMY, REPAIR, SMELTING); public static final List<SkillType> MISC_SKILLS = ImmutableList.of(ACROBATICS, REPAIR, SMELTING);
static { static {
List<SkillType> childSkills = new ArrayList<SkillType>(); List<SkillType> childSkills = new ArrayList<SkillType>();

View File

@@ -1,101 +0,0 @@
package com.gmail.nossr50.datatypes.skills.alchemy;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffect;
public class AlchemyPotion {
private short dataValue;
private String name;
private List<String> lore;
private List<PotionEffect> effects;
private Map<ItemStack, Short> children;
public AlchemyPotion(short dataValue, String name, List<String> lore, List<PotionEffect> effects, Map<ItemStack, Short> children) {
this.dataValue = dataValue;
this.lore = lore;
this.name = name;
this.effects = effects;
this.children = children;
}
public String toString() {
return "AlchemyPotion{" + dataValue + "," + name + ",Effects[" + effects.size() + "], Children[" + children.size() + "]}";
}
public ItemStack toItemStack() {
return toItemStack(1);
}
public ItemStack toItemStack(int amount) {
ItemStack potion = new ItemStack(Material.POTION, amount, this.getDataValue());
PotionMeta meta = (PotionMeta) potion.getItemMeta();
meta.setDisplayName(this.getName());
if (this.getLore() != null && !this.getLore().isEmpty()) {
meta.setLore(this.getLore());
}
if (!this.getEffects().isEmpty()) {
for (PotionEffect effect : this.getEffects()) {
meta.addCustomEffect(effect, true);
}
}
potion.setItemMeta(meta);
return potion;
}
public short getDataValue() {
return dataValue;
}
public void setDataValue(short data_value) {
this.dataValue = data_value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<String> getLore() {
return lore;
}
public void setLore(List<String> lore) {
this.lore = lore;
}
public List<PotionEffect> getEffects() {
return effects;
}
public void setEffects(List<PotionEffect> effects) {
this.effects = effects;
}
public Map<ItemStack, Short> getChildren() {
return children;
}
public void setChildren(Map<ItemStack, Short> children) {
this.children = children;
}
public Short getChildDataValue(ItemStack ingredient) {
if (!children.isEmpty()) {
for (Entry<ItemStack, Short> child : children.entrySet()) {
if (ingredient.isSimilar(child.getKey())) {
return child.getValue();
}
}
}
return -1;
}
}

View File

@@ -17,4 +17,4 @@ public enum Rarity {
return COMMON; return COMMON;
} }
} }
} };

View File

@@ -1,90 +0,0 @@
package com.gmail.nossr50.events.party;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancellable {
private String oldAlly;
private String newAlly;
private EventReason reason;
private boolean cancelled;
public McMMOPartyAllianceChangeEvent(Player player, String oldAlly, String newAlly, EventReason reason) {
super(player);
if (newAlly != null) {
newAlly = newAlly.replace(":", ".");
}
this.oldAlly = oldAlly;
this.newAlly = newAlly;
this.reason = reason;
this.cancelled = false;
}
/**
* @return The party being left, or null if the player was not in a party
*/
public String getOldAlly() {
return oldAlly;
}
/**
* @return The party being joined, or null if the player is not joining a new party
*/
public String getNewAlly() {
return newAlly;
}
/**
* @return The reason for the event being fired
*/
public EventReason getReason() {
return reason;
}
/**
* A list of reasons why the event may have been fired
*/
public enum EventReason {
/**
* Formed an alliance for the first time.
*/
FORMED_ALLIANCE,
/**
* Left a party and did not join a new one.
*/
DISBAND_ALLIANCE,
/**
* Any reason that doesn't fit elsewhere.
*/
CUSTOM;
}
/** 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,54 +0,0 @@
package com.gmail.nossr50.events.party;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.gmail.nossr50.datatypes.party.Party;
public class McMMOPartyLevelUpEvent extends Event implements Cancellable {
private Party party;
private int levelsChanged;
private boolean cancelled;
public McMMOPartyLevelUpEvent(Party party, int levelsChanged) {
this.party = party;
this.levelsChanged = levelsChanged;
this.cancelled = false;
}
public Party getParty() {
return party;
}
public int getLevelsChanged() {
return levelsChanged;
}
public void setLevelsChanged(int levelsChanged) {
this.levelsChanged = levelsChanged;
}
/** 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,76 +0,0 @@
package com.gmail.nossr50.events.party;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.gmail.nossr50.datatypes.party.Party;
public class McMMOPartyXpGainEvent extends Event implements Cancellable {
private Party party;
private float xpGained;
private boolean cancelled;
public McMMOPartyXpGainEvent(Party party, float xpGained) {
this.party = party;
this.xpGained = xpGained;
this.cancelled = false;
}
public Party getParty() {
return party;
}
/**
* @return The amount of experience gained in this event
*/
public float getRawXpGained() {
return xpGained;
}
/**
* @return int amount of experience gained in this event
*/
@Deprecated
public int getXpGained() {
return (int) xpGained;
}
/**
* @param xpGained set amount of experience gained in this event
*/
public void setRawXpGained(float xpGained) {
this.xpGained = xpGained;
}
/**
* @param xpGained set int amount of experience gained in this event
*/
@Deprecated
public void setXpGained(int xpGained) {
this.xpGained = xpGained;
}
/** 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,38 +0,0 @@
package com.gmail.nossr50.events.skills.alchemy;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
public class McMMOPlayerBrewEvent extends McMMOPlayerSkillEvent implements Cancellable {
private BlockState brewingStand;
private boolean cancelled;
public McMMOPlayerBrewEvent(Player player, BlockState brewingStand) {
super(player, SkillType.ALCHEMY);
this.brewingStand = brewingStand;
cancelled = false;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean newValue) {
this.cancelled = newValue;
}
public Block getBrewingStandBlock() {
return brewingStand.getBlock();
}
public BrewingStand getBrewingStand() {
return (BrewingStand) brewingStand;
}
}

View File

@@ -1,35 +0,0 @@
package com.gmail.nossr50.events.skills.alchemy;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
public class McMMOPlayerCatalysisEvent extends McMMOPlayerSkillEvent implements Cancellable {
private double speed;
private boolean cancelled;
public McMMOPlayerCatalysisEvent(Player player, double speed) {
super(player, SkillType.ALCHEMY);
this.speed = speed;
cancelled = false;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean newValue) {
this.cancelled = newValue;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
}

View File

@@ -1,7 +1,6 @@
package com.gmail.nossr50.events.skills.secondaryabilities; package com.gmail.nossr50.events.skills.secondaryabilities;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility; import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
public class SecondaryAbilityWeightedActivationCheckEvent extends SecondaryAbilityEvent { public class SecondaryAbilityWeightedActivationCheckEvent extends SecondaryAbilityEvent {

View File

@@ -8,7 +8,6 @@ import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@@ -31,7 +30,6 @@ import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
import com.gmail.nossr50.runnables.StickyPistonTrackerTask; import com.gmail.nossr50.runnables.StickyPistonTrackerTask;
import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.excavation.ExcavationManager; import com.gmail.nossr50.skills.excavation.ExcavationManager;
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;
@@ -137,11 +135,6 @@ public class BlockListener implements Listener {
return; return;
} }
/* ALCHEMY - Cancel any brew in progress for that BrewingStand */
if (blockState instanceof BrewingStand && Alchemy.brewingStandMap.containsKey(event.getBlock())) {
Alchemy.brewingStandMap.get(event.getBlock()).cancelBrew();
}
Player player = event.getPlayer(); Player player = event.getPlayer();
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) { if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {

View File

@@ -28,12 +28,9 @@ import org.bukkit.event.entity.EntityTameEvent;
import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.potion.PotionEffect;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
@@ -179,7 +176,7 @@ public class EntityListener implements Listener {
return; return;
} }
if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { if (PartyManager.inSameParty(defendingPlayer, attackingPlayer) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@@ -564,7 +561,6 @@ public class EntityListener implements Listener {
return; return;
} }
entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
UserManager.getPlayer(player).getTamingManager().awardTamingXP(entity); UserManager.getPlayer(player).getTamingManager().awardTamingXP(entity);
} }
@@ -595,24 +591,4 @@ public class EntityListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
} }
/**
* Handle PotionSplash events in order to fix broken Splash Potion of Saturation.
*
* @param event The event to process
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPotionSplash(PotionSplashEvent event) {
for (PotionEffect effect : ((PotionMeta) event.getEntity().getItem().getItemMeta()).getCustomEffects()) {
// (effect.getType() != PotionEffectType.SATURATION) is seemingly broken, so we use deprecated method for now.
if (effect.getType().getId() != 23) {
return;
}
for (LivingEntity entity : event.getAffectedEntities()) {
int duration = (int) (effect.getDuration() * event.getIntensity(entity));
entity.addPotionEffect(new PotionEffect(effect.getType(), duration, effect.getAmplifier(), effect.isAmbient()));
}
}
}
} }

View File

@@ -1,12 +1,6 @@
package com.gmail.nossr50.listeners; package com.gmail.nossr50.listeners;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand;
import org.bukkit.block.Furnace;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@@ -18,21 +12,13 @@ import org.bukkit.event.inventory.FurnaceExtractEvent;
import org.bukkit.event.inventory.FurnaceSmeltEvent; import org.bukkit.event.inventory.FurnaceSmeltEvent;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryOpenEvent; import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.FurnaceInventory;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.MetadataValue;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SecondaryAbility; import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.runnables.PlayerUpdateInventoryTask; import com.gmail.nossr50.runnables.PlayerUpdateInventoryTask;
import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer;
import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@@ -48,49 +34,44 @@ public class InventoryListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onInventoryOpen(InventoryOpenEvent event) { public void onInventoryOpen(InventoryOpenEvent event) {
Block furnaceBlock = processInventoryOpenorCloseEvent(event.getInventory());
if (furnaceBlock == null || furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
return;
}
HumanEntity player = event.getPlayer(); HumanEntity player = event.getPlayer();
if (Misc.isNPCEntity(player)) { if (Misc.isNPCEntity(player)) {
return; return;
} }
furnaceBlock.setMetadata(mcMMO.furnaceMetadataKey, UserManager.getPlayer((Player) player).getPlayerMetadata()); Block furnaceBlock = Misc.processInventoryOpenorCloseEvent(event);
if (furnaceBlock != null && !furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
furnaceBlock.setMetadata(mcMMO.furnaceMetadataKey, UserManager.getPlayer((Player) player).getPlayerMetadata());
}
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onInventoryClose(InventoryCloseEvent event) { public void onInventoryClose(InventoryCloseEvent event) {
Block furnaceBlock = processInventoryOpenorCloseEvent(event.getInventory());
if (furnaceBlock == null || furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
return;
}
HumanEntity player = event.getPlayer(); HumanEntity player = event.getPlayer();
if (Misc.isNPCEntity(player)) { if (Misc.isNPCEntity(player)) {
return; return;
} }
furnaceBlock.removeMetadata(mcMMO.furnaceMetadataKey, plugin); Block furnaceBlock = Misc.processInventoryOpenorCloseEvent(event);
if (furnaceBlock != null && furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
furnaceBlock.removeMetadata(mcMMO.furnaceMetadataKey, plugin);
}
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onFurnaceBurnEvent(FurnaceBurnEvent event) { public void onFurnaceBurnEvent(FurnaceBurnEvent event) {
Block furnaceBlock = event.getBlock(); Block furnaceBlock = event.getBlock();
BlockState furnaceState = furnaceBlock.getState(); ItemStack smelting = Misc.getSmeltingFromFurnace(furnaceBlock);
ItemStack smelting = furnaceState instanceof Furnace ? ((Furnace) furnaceState).getInventory().getSmelting() : null;
if (!ItemUtils.isSmeltable(smelting)) { if (!ItemUtils.isSmeltable(smelting)) {
return; return;
} }
Player player = getPlayerFromFurnace(furnaceBlock); Player player = Misc.getPlayerFromFurnace(furnaceBlock);
if (Misc.isNPCEntity(player) || !Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FUEL_EFFICIENCY)) { if (Misc.isNPCEntity(player) || !Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FUEL_EFFICIENCY)) {
return; return;
@@ -108,7 +89,7 @@ public class InventoryListener implements Listener {
return; return;
} }
Player player = getPlayerFromFurnace(furnaceBlock); Player player = Misc.getPlayerFromFurnace(furnaceBlock);
if (Misc.isNPCEntity(player) || !SkillType.SMELTING.getPermissions(player)) { if (Misc.isNPCEntity(player) || !SkillType.SMELTING.getPermissions(player)) {
return; return;
@@ -120,14 +101,13 @@ public class InventoryListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onFurnaceExtractEvent(FurnaceExtractEvent event) { public void onFurnaceExtractEvent(FurnaceExtractEvent event) {
Block furnaceBlock = event.getBlock(); Block furnaceBlock = event.getBlock();
BlockState furnaceState = furnaceBlock.getState(); ItemStack result = Misc.getResultFromFurnace(furnaceBlock);
ItemStack result = furnaceState instanceof Furnace ? ((Furnace) furnaceState).getInventory().getResult() : null;
if (!ItemUtils.isSmelted(result)) { if (!ItemUtils.isSmelted(result)) {
return; return;
} }
Player player = getPlayerFromFurnace(furnaceBlock); Player player = Misc.getPlayerFromFurnace(furnaceBlock);
if (Misc.isNPCEntity(player) || !Permissions.vanillaXpBoost(player, SkillType.SMELTING)) { if (Misc.isNPCEntity(player) || !Permissions.vanillaXpBoost(player, SkillType.SMELTING)) {
return; return;
@@ -136,48 +116,6 @@ public class InventoryListener implements Listener {
event.setExpToDrop(UserManager.getPlayer(player).getSmeltingManager().vanillaXPBoost(event.getExpToDrop())); event.setExpToDrop(UserManager.getPlayer(player).getSmeltingManager().vanillaXPBoost(event.getExpToDrop()));
} }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onInventoryClickEventNormal(InventoryClickEvent event) {
if (event.getInventory().getType() != InventoryType.BREWING || !(event.getInventory().getHolder() instanceof BrewingStand)) {
return;
}
if (!(event.getWhoClicked() instanceof Player) || Misc.isNPCEntity(event.getWhoClicked()) || !Permissions.concoctions(event.getWhoClicked())) {
return;
}
AlchemyPotionBrewer.handleInventoryClick(event);
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onInventoryDragEvent(InventoryDragEvent event) {
if (event.getInventory().getType() != InventoryType.BREWING || !(event.getInventory().getHolder() instanceof BrewingStand)) {
return;
}
if (!(event.getWhoClicked() instanceof Player) || Misc.isNPCEntity(event.getWhoClicked()) || !Permissions.concoctions(event.getWhoClicked())) {
return;
}
AlchemyPotionBrewer.handleInventoryDrag(event);
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) {
if (event.getDestination().getType() != InventoryType.BREWING || !(event.getDestination().getHolder() instanceof BrewingStand)) {
return;
}
if (Config.getInstance().getPreventHopperTransfer() && event.getItem() != null && event.getItem().getType() != Material.POTION) {
event.setCancelled(true);
return;
}
if (Config.getInstance().getEnabledForHoppers()) {
AlchemyPotionBrewer.handleInventoryMoveItem(event);
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onInventoryClickEvent(InventoryClickEvent event) { public void onInventoryClickEvent(InventoryClickEvent event) {
SkillUtils.removeAbilityBuff(event.getCurrentItem()); SkillUtils.removeAbilityBuff(event.getCurrentItem());
@@ -199,28 +137,4 @@ public class InventoryListener implements Listener {
new PlayerUpdateInventoryTask((Player) whoClicked).runTaskLater(plugin, 0); new PlayerUpdateInventoryTask((Player) whoClicked).runTaskLater(plugin, 0);
} }
private Block processInventoryOpenorCloseEvent(Inventory inventory) {
if (!(inventory instanceof FurnaceInventory)) {
return null;
}
Furnace furnace = (Furnace) inventory.getHolder();
if (furnace == null || furnace.getBurnTime() != 0) {
return null;
}
return furnace.getBlock();
}
private Player getPlayerFromFurnace(Block furnaceBlock) {
List<MetadataValue> metadata = furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey);
if (metadata.isEmpty()) {
return null;
}
return plugin.getServer().getPlayerExact(metadata.get(0).asString());
}
} }

View File

@@ -1,6 +1,5 @@
package com.gmail.nossr50.listeners; package com.gmail.nossr50.listeners;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@@ -106,6 +105,11 @@ public class PlayerListener implements Listener {
} }
Player player = event.getEntity(); Player player = event.getEntity();
if (Misc.isNPCEntity(player)) {
return;
}
event.setDeathMessage(MobHealthbarUtils.fixDeathMessage(deathMessage, player)); event.setDeathMessage(MobHealthbarUtils.fixDeathMessage(deathMessage, player));
} }
@@ -136,19 +140,12 @@ public class PlayerListener implements Listener {
Player killer = killedPlayer.getKiller(); Player killer = killedPlayer.getKiller();
if (killer != null && vampirismEnabled) {
HardcoreManager.invokeVampirism(killer, killedPlayer);
}
if (statLossEnabled || (killer != null && vampirismEnabled)) { if (statLossEnabled) {
if (EventUtils.callDeathPenaltyEvent(killedPlayer).isCancelled()) { HardcoreManager.invokeStatPenalty(killedPlayer);
return;
}
if (killer != null && vampirismEnabled) {
HardcoreManager.invokeVampirism(killer, killedPlayer);
}
if (statLossEnabled) {
HardcoreManager.invokeStatPenalty(killedPlayer);
}
} }
} }
@@ -354,7 +351,6 @@ public class PlayerListener implements Listener {
BleedTimerTask.bleedOut(player); BleedTimerTask.bleedOut(player);
mcMMOPlayer.getProfile().save(); mcMMOPlayer.getProfile().save();
UserManager.remove(player.getName()); UserManager.remove(player.getName());
ScoreboardManager.teardownPlayer(player);
} }
/** /**
@@ -375,7 +371,6 @@ public class PlayerListener implements Listener {
} }
UserManager.addUser(player).actualizeRespawnATS(); UserManager.addUser(player).actualizeRespawnATS();
ScoreboardManager.setupPlayer(player);
if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) { if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) {
Motd.displayAll(player); Motd.displayAll(player);

View File

@@ -0,0 +1,39 @@
package com.gmail.nossr50.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
public class ScoreboardsListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerJoin(PlayerJoinEvent event) {
ScoreboardManager.setupPlayer(event.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
ScoreboardManager.teardownPlayer(event.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
ScoreboardManager.handleLevelUp(event.getPlayer(), event.getSkill());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerXp(McMMOPlayerXpGainEvent event) {
ScoreboardManager.handleXp(event.getPlayer(), event.getSkill());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onAbility(McMMOPlayerAbilityActivateEvent event) {
ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
}
}

View File

@@ -1,10 +1,5 @@
package com.gmail.nossr50.listeners; package com.gmail.nossr50.listeners;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@@ -15,27 +10,12 @@ import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
public class SelfListener implements Listener { public class SelfListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) { public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
Player player = event.getPlayer();
SkillType skill = event.getSkill();
ScoreboardManager.handleLevelUp(player, skill);
if (!Config.getInstance().getLevelUpEffectsEnabled()) { if (!Config.getInstance().getLevelUpEffectsEnabled()) {
return; return;
} }
if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) { if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) {
skill.celebrateLevelUp(player); event.getSkill().celebrateLevelUp(event.getPlayer());
} }
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerXp(McMMOPlayerXpGainEvent event) {
ScoreboardManager.handleXp(event.getPlayer(), event.getSkill());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onAbility(McMMOPlayerAbilityActivateEvent event) {
ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
}
} }

View File

@@ -61,6 +61,7 @@ public final class LocaleLoader {
string = formatter.format(messageArguments); string = formatter.format(messageArguments);
} }
string.replaceAll("\'", "''");
string = addColors(string); string = addColors(string);
return string; return string;

View File

@@ -5,11 +5,6 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.gmail.nossr50.config.mods.ArmorConfigManager;
import com.gmail.nossr50.config.mods.BlockConfigManager;
import com.gmail.nossr50.config.mods.EntityConfigManager;
import com.gmail.nossr50.config.mods.ToolConfigManager;
import com.gmail.nossr50.util.ModManager;
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;
@@ -19,8 +14,10 @@ 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.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.mods.CustomArmorConfig;
import com.gmail.nossr50.config.skills.repair.RepairConfigManager; import com.gmail.nossr50.config.mods.CustomBlockConfig;
import com.gmail.nossr50.config.mods.CustomEntityConfig;
import com.gmail.nossr50.config.mods.CustomToolConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.database.DatabaseManagerFactory; import com.gmail.nossr50.database.DatabaseManagerFactory;
@@ -28,6 +25,7 @@ import com.gmail.nossr50.listeners.BlockListener;
import com.gmail.nossr50.listeners.EntityListener; import com.gmail.nossr50.listeners.EntityListener;
import com.gmail.nossr50.listeners.InventoryListener; import com.gmail.nossr50.listeners.InventoryListener;
import com.gmail.nossr50.listeners.PlayerListener; import com.gmail.nossr50.listeners.PlayerListener;
import com.gmail.nossr50.listeners.ScoreboardsListener;
import com.gmail.nossr50.listeners.SelfListener; import com.gmail.nossr50.listeners.SelfListener;
import com.gmail.nossr50.listeners.WorldListener; import com.gmail.nossr50.listeners.WorldListener;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@@ -39,13 +37,12 @@ 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.PowerLevelUpdatingTask; import com.gmail.nossr50.runnables.player.PowerLevelUpdatingTask;
import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.runnables.skills.BleedTimerTask;
import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.child.ChildConfig; import com.gmail.nossr50.skills.child.ChildConfig;
import com.gmail.nossr50.skills.repair.config.RepairConfigManager;
import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableManager; import com.gmail.nossr50.skills.repair.repairables.RepairableManager;
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.ChimaeraWing;
import com.gmail.nossr50.util.HolidayManager;
import com.gmail.nossr50.util.LogFilter; import com.gmail.nossr50.util.LogFilter;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@@ -65,10 +62,8 @@ public class mcMMO extends JavaPlugin {
/* Managers */ /* Managers */
private static ChunkManager placeStore; private static ChunkManager placeStore;
private static RepairableManager repairableManager; private static RepairableManager repairableManager;
private static ModManager modManager;
private static DatabaseManager databaseManager; private static DatabaseManager databaseManager;
private static FormulaManager formulaManager; private static FormulaManager formulaManager;
private static HolidayManager holidayManager;
/* File Paths */ /* File Paths */
private static String mainDirectory; private static String mainDirectory;
@@ -132,8 +127,6 @@ public class mcMMO extends JavaPlugin {
setupFilePaths(); setupFilePaths();
modManager = new ModManager();
loadConfigFiles(); loadConfigFiles();
if (!noErrorsInConfigFiles) { if (!noErrorsInConfigFiles) {
@@ -161,7 +154,6 @@ public class mcMMO extends JavaPlugin {
PartyManager.loadParties(); PartyManager.loadParties();
formulaManager = new FormulaManager(); formulaManager = new FormulaManager();
holidayManager = new HolidayManager();
for (Player player : getServer().getOnlinePlayers()) { for (Player player : getServer().getOnlinePlayers()) {
UserManager.addUser(player); // In case of reload add all users back into UserManager UserManager.addUser(player); // In case of reload add all users back into UserManager
@@ -203,20 +195,16 @@ public class mcMMO extends JavaPlugin {
@Override @Override
public void onDisable() { public void onDisable() {
try { try {
Alchemy.finishAllBrews(); // Finish all partially complete AlchemyBrewTasks to prevent vanilla brewing continuation on restart
UserManager.saveAll(); // Make sure to save player information if the server shuts down UserManager.saveAll(); // Make sure to save player information if the server shuts down
PartyManager.saveParties(); // Save our parties PartyManager.saveParties(); // Save our parties
ScoreboardManager.teardownAll(); ScoreboardManager.teardownAll();
formulaManager.saveFormula(); formulaManager.saveFormula();
holidayManager.saveAnniversaryFiles();
placeStore.saveAll(); // Save our metadata placeStore.saveAll(); // Save our metadata
placeStore.cleanUp(); // Cleanup empty metadata stores placeStore.cleanUp(); // Cleanup empty metadata stores
} }
catch (NullPointerException e) {} catch (NullPointerException e) {}
debug("Canceling all tasks...");
getServer().getScheduler().cancelTasks(this); // This removes our tasks getServer().getScheduler().cancelTasks(this); // This removes our tasks
debug("Unregister all events...");
HandlerList.unregisterAll(this); // Cancel event registrations HandlerList.unregisterAll(this); // Cancel event registrations
if (Config.getInstance().getBackupsEnabled()) { if (Config.getInstance().getBackupsEnabled()) {
@@ -281,10 +269,6 @@ public class mcMMO extends JavaPlugin {
return formulaManager; return formulaManager;
} }
public static HolidayManager getHolidayManager() {
return holidayManager;
}
public static ChunkManager getPlaceStore() { public static ChunkManager getPlaceStore() {
return placeStore; return placeStore;
} }
@@ -297,10 +281,6 @@ public class mcMMO extends JavaPlugin {
return databaseManager; return databaseManager;
} }
public static ModManager getModManager() {
return modManager;
}
@Deprecated @Deprecated
public static void setDatabaseManager(DatabaseManager databaseManager) { public static void setDatabaseManager(DatabaseManager databaseManager) {
mcMMO.databaseManager = databaseManager; mcMMO.databaseManager = databaseManager;
@@ -335,44 +315,11 @@ public class mcMMO extends JavaPlugin {
File oldModPath = new File(mainDirectory + "ModConfigs" + File.separator); File oldModPath = new File(mainDirectory + "ModConfigs" + File.separator);
if (oldFlatfilePath.exists()) { if (oldFlatfilePath.exists()) {
if (!oldFlatfilePath.renameTo(new File(flatFileDirectory))) { oldFlatfilePath.renameTo(new File(flatFileDirectory));
getLogger().warning("Failed to rename FlatFileStuff to flatfile!");
}
} }
if (oldModPath.exists()) { if (oldModPath.exists()) {
if (!oldModPath.renameTo(new File(modDirectory))) { oldModPath.renameTo(new File(modDirectory));
getLogger().warning("Failed to rename ModConfigs to mods!");
}
}
File oldArmorFile = new File(modDirectory + "armor.yml");
File oldBlocksFile = new File(modDirectory + "blocks.yml");
File oldEntitiesFile = new File(modDirectory + "entities.yml");
File oldToolsFile = new File(modDirectory + "tools.yml");
if (oldArmorFile.exists()) {
if (!oldArmorFile.renameTo(new File(modDirectory + "armor.default.yml"))) {
getLogger().warning("Failed to rename armor.yml to armor.default.yml!");
}
}
if (oldBlocksFile.exists()) {
if (!oldBlocksFile.renameTo(new File(modDirectory + "blocks.default.yml"))) {
getLogger().warning("Failed to rename blocks.yml to blocks.default.yml!");
}
}
if (oldEntitiesFile.exists()) {
if (!oldEntitiesFile.renameTo(new File(modDirectory + "entities.default.yml"))) {
getLogger().warning("Failed to rename entities.yml to entities.default.yml!");
}
}
if (oldToolsFile.exists()) {
if (!oldToolsFile.renameTo(new File(modDirectory + "tools.default.yml"))) {
getLogger().warning("Failed to rename tools.yml to tools.default.yml!");
}
} }
} }
@@ -403,30 +350,29 @@ public class mcMMO extends JavaPlugin {
TreasureConfig.getInstance(); TreasureConfig.getInstance();
HiddenConfig.getInstance(); HiddenConfig.getInstance();
AdvancedConfig.getInstance(); AdvancedConfig.getInstance();
PotionConfig.getInstance();
new ChildConfig(); new ChildConfig();
List<Repairable> repairables = new ArrayList<Repairable>(); List<Repairable> repairables = new ArrayList<Repairable>();
if (Config.getInstance().getToolModsEnabled()) { if (Config.getInstance().getToolModsEnabled()) {
new ToolConfigManager(this); repairables.addAll(CustomToolConfig.getInstance().getLoadedRepairables());
} }
if (Config.getInstance().getArmorModsEnabled()) { if (Config.getInstance().getArmorModsEnabled()) {
new ArmorConfigManager(this); repairables.addAll(CustomArmorConfig.getInstance().getLoadedRepairables());
} }
if (Config.getInstance().getBlockModsEnabled()) { if (Config.getInstance().getBlockModsEnabled()) {
new BlockConfigManager(this); CustomBlockConfig.getInstance();
} }
if (Config.getInstance().getEntityModsEnabled()) { if (Config.getInstance().getEntityModsEnabled()) {
new EntityConfigManager(this); CustomEntityConfig.getInstance();
} }
// Load repair configs, make manager, and register them at this time // Load repair configs, make manager, and register them at this time
repairables.addAll(new RepairConfigManager(this).getLoadedRepairables()); RepairConfigManager rManager = new RepairConfigManager(this);
repairables.addAll(modManager.getLoadedRepairables()); repairables.addAll(rManager.getLoadedRepairables());
repairableManager = new SimpleRepairableManager(repairables.size()); repairableManager = new SimpleRepairableManager(repairables.size());
repairableManager.registerRepairables(repairables); repairableManager.registerRepairables(repairables);
} }
@@ -440,6 +386,7 @@ public class mcMMO extends JavaPlugin {
pluginManager.registerEvents(new EntityListener(this), this); pluginManager.registerEvents(new EntityListener(this), this);
pluginManager.registerEvents(new InventoryListener(this), this); pluginManager.registerEvents(new InventoryListener(this), this);
pluginManager.registerEvents(new SelfListener(), this); pluginManager.registerEvents(new SelfListener(), this);
pluginManager.registerEvents(new ScoreboardsListener(), this);
pluginManager.registerEvents(new WorldListener(this), this); pluginManager.registerEvents(new WorldListener(this), this);
} }
@@ -461,7 +408,7 @@ public class mcMMO extends JavaPlugin {
new BleedTimerTask().runTaskTimer(this, 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR); new BleedTimerTask().runTaskTimer(this, 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
// Old & Powerless User remover // Old & Powerless User remover
long purgeIntervalTicks = Config.getInstance().getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; long purgeIntervalTicks = Config.getInstance().getPurgeInterval() * 60 * 60 * Misc.TICK_CONVERSION_FACTOR;
if (purgeIntervalTicks == 0) { if (purgeIntervalTicks == 0) {
new UserPurgeTask().runTaskLater(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.
@@ -471,7 +418,7 @@ public class mcMMO extends JavaPlugin {
} }
// Automatically remove old members from parties // Automatically remove old members from parties
long kickIntervalTicks = Config.getInstance().getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; long kickIntervalTicks = Config.getInstance().getAutoPartyKickInterval() * 60 * 60 * Misc.TICK_CONVERSION_FACTOR;
if (kickIntervalTicks == 0) { if (kickIntervalTicks == 0) {
new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.

View File

@@ -79,8 +79,7 @@ public class MetricsManager {
if (version.contains("-")) { if (version.contains("-")) {
String majorVersion = version.substring(0, version.indexOf("-")); String majorVersion = version.substring(0, version.indexOf("-"));
String subVersion; String subVersion = "";
if (isOfficialBuild) { if (isOfficialBuild) {
int startIndex = version.indexOf("-"); int startIndex = version.indexOf("-");
if (version.substring(startIndex + 1).contains("-")) { if (version.substring(startIndex + 1).contains("-")) {
@@ -97,6 +96,9 @@ public class MetricsManager {
version = majorVersion + "~=~" + subVersion; version = majorVersion + "~=~" + subVersion;
haveVersionInformation = true; haveVersionInformation = true;
} }
else {
haveVersionInformation = false;
}
if (haveVersionInformation) { if (haveVersionInformation) {
versionDonutGraph.addPlotter(new Metrics.Plotter(version) { versionDonutGraph.addPlotter(new Metrics.Plotter(version) {

View File

@@ -6,7 +6,6 @@ import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@@ -17,7 +16,6 @@ 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.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.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;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@@ -91,17 +89,6 @@ public final class PartyManager {
return firstParty.equals(secondParty); return firstParty.equals(secondParty);
} }
public static boolean areAllies(Player firstPlayer, Player secondPlayer) {
Party firstParty = UserManager.getPlayer(firstPlayer).getParty();
Party secondParty = UserManager.getPlayer(secondPlayer).getParty();
if (firstParty == null || secondParty == null || firstParty.getAlly() == null || secondParty.getAlly() == null) {
return false;
}
return firstParty.equals(secondParty.getAlly()) && secondParty.equals(firstParty.getAlly());
}
/** /**
* Get the near party members. * Get the near party members.
* *
@@ -331,71 +318,11 @@ public final class PartyManager {
return; return;
} }
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Party.Invite.Accepted", invite.getName())); mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Invite.Accepted", invite.getName()));
mcMMOPlayer.removePartyInvite(); mcMMOPlayer.removePartyInvite();
addToParty(mcMMOPlayer, invite); addToParty(mcMMOPlayer, invite);
} }
/**
* Accept a party alliance invitation
*
* @param mcMMOPlayer The player who accepts the alliance invite
*/
public static void acceptAllianceInvite(McMMOPlayer mcMMOPlayer) {
Party invite = mcMMOPlayer.getPartyAllianceInvite();
Player player = mcMMOPlayer.getPlayer();
// Check if the party still exists, it might have been disbanded
if (!parties.contains(invite)) {
player.sendMessage(LocaleLoader.getString("Party.Disband"));
return;
}
if (!handlePartyChangeAllianceEvent(player, mcMMOPlayer.getParty().getName(), invite.getName(), McMMOPartyAllianceChangeEvent.EventReason.FORMED_ALLIANCE)) {
return;
}
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Invite.Accepted", invite.getName()));
mcMMOPlayer.removePartyAllianceInvite();
createAlliance(mcMMOPlayer.getParty(), invite);
}
public static void createAlliance(Party firstParty, Party secondParty) {
firstParty.setAlly(secondParty);
secondParty.setAlly(firstParty);
for (Player member : firstParty.getOnlineMembers()) {
member.sendMessage(LocaleLoader.getString("Party.Alliance.Formed", secondParty.getName()));
}
for (Player member : secondParty.getOnlineMembers()) {
member.sendMessage(LocaleLoader.getString("Party.Alliance.Formed", firstParty.getName()));
}
}
public static boolean disbandAlliance(Player player, Party firstParty, Party secondParty){
if (!handlePartyChangeAllianceEvent(player, firstParty.getName(), secondParty.getName(), McMMOPartyAllianceChangeEvent.EventReason.DISBAND_ALLIANCE)) {
return false;
}
PartyManager.disbandAlliance(firstParty, secondParty);
return true;
}
private static void disbandAlliance(Party firstParty, Party secondParty) {
firstParty.setAlly(null);
secondParty.setAlly(null);
for (Player member : firstParty.getOnlineMembers()) {
member.sendMessage(LocaleLoader.getString("Party.Alliance.Disband", secondParty.getName()));
}
for (Player member : secondParty.getOnlineMembers()) {
member.sendMessage(LocaleLoader.getString("Party.Alliance.Disband", firstParty.getName()));
}
}
/** /**
* Add a player to a party * Add a player to a party
* *
@@ -479,21 +406,12 @@ public final class PartyManager {
YamlConfiguration partiesFile = YamlConfiguration.loadConfiguration(partyFile); YamlConfiguration partiesFile = YamlConfiguration.loadConfiguration(partyFile);
ArrayList<Party> hasAlly = new ArrayList<Party>();
for (String partyName : partiesFile.getConfigurationSection("").getKeys(false)) { for (String partyName : partiesFile.getConfigurationSection("").getKeys(false)) {
Party party = new Party(partyName); Party party = new Party(partyName);
party.setLeader(partiesFile.getString(partyName + ".Leader")); party.setLeader(partiesFile.getString(partyName + ".Leader"));
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.setXp(partiesFile.getInt(partyName + ".Xp"));
if (partiesFile.getString(partyName + ".Ally") != null) {
hasAlly.add(party);
}
party.setXpShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ExpShareMode", "NONE"))); party.setXpShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ExpShareMode", "NONE")));
party.setItemShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ItemShareMode", "NONE"))); party.setItemShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ItemShareMode", "NONE")));
@@ -510,10 +428,6 @@ public final class PartyManager {
parties.add(party); parties.add(party);
} }
for (Party party : hasAlly) {
party.setAlly(getParty(partiesFile.getString(party.getName() + ".Ally")));
}
} }
/** /**
@@ -521,24 +435,17 @@ public final class PartyManager {
*/ */
public static void saveParties() { public static void saveParties() {
if (partyFile.exists()) { if (partyFile.exists()) {
if (!partyFile.delete()) { partyFile.delete();
mcMMO.p.getLogger().warning("Could not delete party file. Party saving failed!");
return;
}
} }
YamlConfiguration partiesFile = new YamlConfiguration(); YamlConfiguration partiesFile = new YamlConfiguration();
mcMMO.p.debug("Saving Parties... (" + parties.size() + ")");
for (Party party : parties) { for (Party party : parties) {
String partyName = party.getName(); String partyName = party.getName();
partiesFile.set(partyName + ".Leader", party.getLeader()); 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 + ".Xp", (int) party.getXp());
partiesFile.set(partyName + ".Ally", (party.getAlly() != null) ? party.getAlly().getName() : "");
partiesFile.set(partyName + ".ExpShareMode", party.getXpShareMode().toString()); partiesFile.set(partyName + ".ExpShareMode", party.getXpShareMode().toString());
partiesFile.set(partyName + ".ItemShareMode", party.getItemShareMode().toString()); partiesFile.set(partyName + ".ItemShareMode", party.getItemShareMode().toString());
@@ -581,22 +488,6 @@ public final class PartyManager {
return !event.isCancelled(); return !event.isCancelled();
} }
/**
* Handle party alliance change event.
*
* @param player The player changing party alliances
* @param oldAllyName The name of the old ally
* @param newAllyName The name of the new ally
* @param reason The reason for changing allies
* @return true if the change event was successful, false otherwise
*/
public static boolean handlePartyChangeAllianceEvent(Player player, String oldAllyName, String newAllyName, McMMOPartyAllianceChangeEvent.EventReason reason) {
McMMOPartyAllianceChangeEvent event = new McMMOPartyAllianceChangeEvent(player, oldAllyName, newAllyName, reason);
mcMMO.p.getServer().getPluginManager().callEvent(event);
return !event.isCancelled();
}
/** /**
* Remove party data from the mcMMOPlayer. * Remove party data from the mcMMOPlayer.
* *
@@ -608,24 +499,6 @@ public final class PartyManager {
mcMMOPlayer.setItemShareModifier(10); mcMMOPlayer.setItemShareModifier(10);
} }
/**
* Notify party members when the party levels up.
*
* @param party The concerned party
* @param levelsGained The amount of levels gained
* @param level The current party level
*/
public static void informPartyMembersLevelUp(Party party, int levelsGained, int level) {
boolean levelUpSoundsEnabled = Config.getInstance().getLevelUpSoundsEnabled();
for (Player member : party.getOnlineMembers()) {
member.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, level));
if (levelUpSoundsEnabled) {
member.playSound(member.getLocation(), Sound.LEVEL_UP, Misc.LEVELUP_VOLUME, Misc.LEVELUP_PITCH);
}
}
}
/** /**
* Notify party members when a player joins. * Notify party members when a player joins.
* *

View File

@@ -33,16 +33,17 @@ public class CleanBackupsTask extends BukkitRunnable {
// Check files in backup folder from oldest to newest // Check files in backup folder from oldest to newest
for (File file : BACKUP_DIR.listFiles()) { for (File file : BACKUP_DIR.listFiles()) {
if (!file.isFile() || file.isDirectory()) { if (!file.isFile()) {
continue; continue;
} }
amountTotal++; amountTotal++;
String fileName = file.getName(); String fileName = file.getName();
fileName = fileName.split("[.]")[0];
Date date = getDate(fileName.split("[.]")[0]); Date date = getDate(fileName);
if (!fileName.contains(".zip") || date == null) { if (date == null) {
mcMMO.p.debug("Could not determine date for file: " + fileName); mcMMO.p.debug("Could not determine date for file: " + fileName);
continue; continue;
} }
@@ -87,9 +88,8 @@ public class CleanBackupsTask extends BukkitRunnable {
mcMMO.p.getLogger().info("Cleaned backup files. Deleted " + amountDeleted + " of " + amountTotal + " files."); mcMMO.p.getLogger().info("Cleaned backup files. Deleted " + amountDeleted + " of " + amountTotal + " files.");
for (File file : toDelete) { for (File file : toDelete) {
if (file.delete()) { mcMMO.p.debug("Deleted: " + file.getName());
mcMMO.p.debug("Deleted: " + file.getName()); file.delete();
}
} }
} }

View File

@@ -1,11 +1,14 @@
package com.gmail.nossr50.runnables.database; package com.gmail.nossr50.runnables.database;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
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.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
public class DatabaseConversionTask extends BukkitRunnable { public class DatabaseConversionTask extends BukkitRunnable {
private final DatabaseManager sourceDatabase; private final DatabaseManager sourceDatabase;
@@ -20,12 +23,24 @@ public class DatabaseConversionTask extends BukkitRunnable {
@Override @Override
public void run() { public void run() {
sourceDatabase.convertUsers(mcMMO.getDatabaseManager()); try {
sourceDatabase.setLoadingDisabled(true);
sourceDatabase.convertUsers(mcMMO.getDatabaseManager());
}
finally {
sourceDatabase.setLoadingDisabled(false);
}
mcMMO.p.getServer().getScheduler().runTask(mcMMO.p, new Runnable() { mcMMO.p.getServer().getScheduler().runTask(mcMMO.p, new Runnable() {
@Override @Override
public void run() { public void run() {
sender.sendMessage(message); sender.sendMessage(message);
// Reload all users from the new database
UserManager.clearAll();
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
UserManager.addUser(player);
}
} }
}); });
} }

View File

@@ -13,7 +13,9 @@ import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.skills.SkillUtils;
public class TeleportationWarmup extends BukkitRunnable { public class TeleportationWarmup extends BukkitRunnable {
private static Player teleportingPlayer;
private McMMOPlayer mcMMOPlayer; private McMMOPlayer mcMMOPlayer;
private static Player targetPlayer;
private McMMOPlayer mcMMOTarget; private McMMOPlayer mcMMOTarget;
public TeleportationWarmup(McMMOPlayer mcMMOPlayer, McMMOPlayer mcMMOTarget) { public TeleportationWarmup(McMMOPlayer mcMMOPlayer, McMMOPlayer mcMMOTarget) {
@@ -23,8 +25,12 @@ public class TeleportationWarmup extends BukkitRunnable {
@Override @Override
public void run() { public void run() {
Player teleportingPlayer = mcMMOPlayer.getPlayer(); checkPartyTeleport();
Player targetPlayer = mcMMOTarget.getPlayer(); }
private void checkPartyTeleport() {
teleportingPlayer = mcMMOPlayer.getPlayer();
targetPlayer = mcMMOTarget.getPlayer();
Location previousLocation = mcMMOPlayer.getTeleportCommenceLocation(); Location previousLocation = mcMMOPlayer.getTeleportCommenceLocation();
Location newLocation = mcMMOPlayer.getPlayer().getLocation(); Location newLocation = mcMMOPlayer.getPlayer().getLocation();
long recentlyHurt = mcMMOPlayer.getRecentlyHurt(); long recentlyHurt = mcMMOPlayer.getRecentlyHurt();

View File

@@ -1,7 +1,5 @@
package com.gmail.nossr50.runnables.skills; package com.gmail.nossr50.runnables.skills;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@@ -40,7 +38,7 @@ public class AbilityDisableTask extends BukkitRunnable {
case BERSERK: case BERSERK:
if (HiddenConfig.getInstance().resendChunksAfterBlockAbility()) { if (HiddenConfig.getInstance().resendChunksAfterBlockAbility()) {
resendChunkRadiusAt(player, 1); Misc.resendChunkRadiusAt(player, 1);
} }
// Fallthrough // Fallthrough
@@ -62,18 +60,4 @@ public class AbilityDisableTask extends BukkitRunnable {
SkillUtils.sendSkillMessage(player, ability.getAbilityPlayerOff(player)); SkillUtils.sendSkillMessage(player, ability.getAbilityPlayerOff(player));
new AbilityCooldownTask(mcMMOPlayer, ability).runTaskLaterAsynchronously(mcMMO.p, PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR); new AbilityCooldownTask(mcMMOPlayer, ability).runTaskLaterAsynchronously(mcMMO.p, PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
} }
private void resendChunkRadiusAt(Player player, int radius) {
Chunk chunk = player.getLocation().getChunk();
World world = player.getWorld();
int chunkX = chunk.getX();
int chunkZ = chunk.getZ();
for (int x = chunkX - radius; x < chunkX + radius; x++) {
for (int z = chunkZ - radius; z < chunkZ + radius; z++) {
world.refreshChunk(x, z);
}
}
}
} }

View File

@@ -1,43 +0,0 @@
package com.gmail.nossr50.runnables.skills;
import java.util.Arrays;
import org.bukkit.block.Block;
import org.bukkit.block.BrewingStand;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer;
public class AlchemyBrewCheckTask extends BukkitRunnable {
private final static int INGREDIENT_SLOT = 3;
private Player player;
private BrewingStand brewingStand;
private ItemStack[] oldInventory;
public AlchemyBrewCheckTask(Player player, BrewingStand brewingStand) {
this.player = player;
this.brewingStand = brewingStand;
this.oldInventory = Arrays.copyOfRange(brewingStand.getInventory().getContents(), 0, 4);
}
@Override
public void run() {
Block block = brewingStand.getBlock();
ItemStack[] newInventory = Arrays.copyOfRange(((BrewingStand) block.getState()).getInventory().getContents(), 0, 4);
if (Alchemy.brewingStandMap.containsKey(brewingStand)) {
if (oldInventory[INGREDIENT_SLOT] == null || newInventory[INGREDIENT_SLOT] == null || !oldInventory[INGREDIENT_SLOT].isSimilar(newInventory[INGREDIENT_SLOT]) || !AlchemyPotionBrewer.isValidBrew(player, newInventory)) {
Alchemy.brewingStandMap.get(brewingStand).cancelBrew();
}
}
if (!Alchemy.brewingStandMap.containsKey(brewingStand) && AlchemyPotionBrewer.isValidBrew(player, newInventory)) {
Alchemy.brewingStandMap.put(brewingStand, new AlchemyBrewTask(brewingStand, player));
}
}
}

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