Compare commits

..

No commits in common. "master" and "1.4.08" have entirely different histories.

670 changed files with 39287 additions and 77966 deletions

12
.github/FUNDING.yml vendored
View File

@ -1,12 +0,0 @@
# These are supported funding model platforms
github: [nossr50] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: nossr50 # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://paypal.me/nossr50 # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -1,52 +0,0 @@
# This workflow automatically tests new commits and pull requests as they come in.
# Note that this does not upload any artifacts, you will need to compile mcMMO manually
# if you wish to create the actual jar.
name: Compile and test
on:
# We run our tests whenever the pom or a source file was touched.
# There is no need to run Maven when only the changelog was touched.
# We may also want to re-run this workflow when the workflow file itself
# was updated too.
push:
paths:
- 'src/**'
- 'pom.xml'
- '.github/workflows/maven.yml'
# Whenever someone submits a new pull request which modified the pom or a source file,
# we want to ensure it compiles successfully and that all tests will pass.
pull_request:
paths:
- 'src/**'
- 'pom.xml'
jobs:
compile:
name: Maven compiler
runs-on: ubuntu-latest
steps:
# 1. Check out the current working tree
- name: Checkout repository
uses: actions/checkout@v4
# 2. Setup Java 17 JDK (Adopt)
- name: Java 17 setup
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: jdk
java-version: '17'
# 3. Setup local Maven package cache to speed up building
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# 4. Build via Maven
- name: Build via Maven
run: mvn verify -B --file pom.xml -DdisableXmlReport=true

16
.gitignore vendored
View File

@ -1,22 +1,7 @@
# bash stuff
*.sh
# Eclipse stuff
/.classpath
/.project
/.settings
/dependency-reduced-pom.xml
#vs code
/.vscode
# Maven Depends
/lib
# gradle
/.gradle
/mcMMO-core/.gradle
/mcMMO-core/gradle
# netbeans
/nbproject
@ -55,4 +40,3 @@
# Atlassian Stuff
/atlassian-ide-plugin.xml
/nulllocale_override.properties

File diff suppressed because it is too large Load Diff

View File

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

894
LICENSE
View File

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

View File

@ -1,76 +1,51 @@
# mcMMO
The #1 RPG Mod for Minecraft
## The RPG lovers mod
## Useful URLs
Website: http://www.mcmmo.org
Spigot Resource: https://spigot.mcmmo.org
Polymart Resource: https://polymart.org/product/727/mcmmo
Wiki: https://wiki.mcmmo.org/
## API
If you are using maven, you can add mcMMO API to your plugin by adding it to pom.xml like so...
```
<repository>
<id>neetgames</id>
<url>https://nexus.neetgames.com/repository/maven-releases/</url>
</repository>
```
```
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.2.004</version>
</dependency>
```
### Builds
Currently, you can obtain our builds via Spigot or Polymart:
http://spigot.mcmmo.org
https://polymart.org/resource/mcmmo.727
### Dev builds
Our latest development builds are available ~~[here](http://ci.mcmmo.info)~~. Unfortunately, the mcMMO site is down; a temporary dev build location is hosted [here](http://ci.ecocitycraft.com/job/mcMMO/).
### Brief Description
The goal of mcMMO is to take core Minecraft game mechanics and expand them into an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
## About the Team
In December 2018, the original author and creator of mcMMO (nossr50) returned and took over the role of project lead once again, to develop and improve mcMMO.
#### Current mcMMO Devs
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50)
mcMMO is currently developed by a team of individuals from all over the world.
### Glorious Leader
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)]
(https://github.com/gmcferrin)
### Former team members
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)](https://github.com/gmcferrin)
[![kashike](https://secure.gravatar.com/avatar/b5e86d6d443b957fd5cdee55501f3799.png)](https://github.com/kashike)
[![electronicboy](https://secure.gravatar.com/avatar/44759c38d311ce09596de6a2d5b88036.png)](https://github.com/electronicboy)
[![t00thpick1](http://www.gravatar.com/avatar/ee23c7794a0c40120c3474287c7bce06.png)](https://github.com/t00thpick1)
[![bm01](http://www.gravatar.com/avatar/ec8146f5358177f12e9a252271bbc391.png)](https://github.com/bm01)
[![Glitchfinder](http://www.gravatar.com/avatar/5aa4cce22f72ae9c002ecec30f061d00.png)](https://github.com/Glitchfinder)
[![NuclearW](http://www.gravatar.com/avatar/90926bdcf1c8a75918df5ea5fa801ce6.png)](https://github.com/NuclearW)
[![shatteredbeam](http://www.gravatar.com/avatar/cad3b5d7d39cf5387afb87f494389610.png)](https://github.com/shatteredbeam)
[![TfT_02](http://www.gravatar.com/avatar/b8914f9970e1f6ffd5281ce4770e20a7.png)](https://github.com/TfT-02)
[![riking](https://1.gravatar.com/avatar/aca9f37e569ac3a63929920035a91ba4.png)](https://github.com/riking)
[![TheYeti](https://i.imgur.com/tzFrxdo.png)](https://github.com/TheYeti)
### Developers
[![bm01](http://www.gravatar.com/avatar/ec8146f5358177f12e9a252271bbc391.png)]
(https://github.com/bm01)
[![Glitchfinder](http://www.gravatar.com/avatar/5aa4cce22f72ae9c002ecec30f061d00.png)]
(https://github.com/Glitchfinder)
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)]
(https://github.com/nossr50)
[![NuclearW](http://www.gravatar.com/avatar/90926bdcf1c8a75918df5ea5fa801ce6.png)]
(https://github.com/NuclearW)
[![shatteredbeam](http://www.gravatar.com/avatar/cad3b5d7d39cf5387afb87f494389610.png)]
(https://github.com/shatteredbeam)
[![TfT_02](http://www.gravatar.com/avatar/b8914f9970e1f6ffd5281ce4770e20a7.png)]
(https://github.com/TfT-02)
[![t00thpick1](http://www.gravatar.com/avatar/ee23c7794a0c40120c3474287c7bce06.png)]
(https://github.com/t00thpick1)
[![riking](https://1.gravatar.com/avatar/aca9f37e569ac3a63929920035a91ba4.png)]
(https://github.com/riking)
#### Folia Contributors
[<img src="https://github.com/HSGamer.png" width=80 alt="HSGamer">](https://github.com/HSGamer)
[<img src="https://github.com/TechnicallyCoded.png" width=80 alt="TechnicallyCoded">](https://github.com/TechnicallyCoded)
[<img src="https://github.com/Yomamaeatstoes.png" width=80 alt="Yomamaeatstoes">](https://github.com/Yomamaeatstoes)
[<img src="https://github.com/Rockyers.png" width=80 alt="Rockyers">](https://github.com/Rockyers)
### Special thanks
[![EasyMFnE](https://www.gravatar.com/avatar/99c9a1fa3bbf957791ceac7b45daadb0.png)]
(https://github.com/EasyMFnE)
Added the Alchemy skill
## Compiling
mcMMO uses Maven to manage dependencies, packaging, and shading of necessary classes; Maven is required to compile mcMMO. It is recommended to always use the latest version of maven.
mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
The typical command used to build mcMMO is: `mvn clean install`
The typical command used to build mcMMO is: `mvn clean package install`
https://spigot.mcmmo.org for more up to date information.
Required Libraries:
* JUnit
* EMetrics
* Bukkit
## Downloads
https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/
https://polymart.org/resource/mcmmo.727
http://dev.bukkit.org/server-mods/mcmmo for more up to date information.

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

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

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

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

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

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

View File

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

View File

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

View File

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

View File

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

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

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

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

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

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

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

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

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

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

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

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

View File

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

View File

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

View File

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

View File

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

60
extras/repair.chain.yml Normal file
View File

@ -0,0 +1,60 @@
#
# Repair configuration
# Last updated on ${project.version}-b${BUILD_NUMBER}
#
# Any file named repair.*.yml in the mcmmmo folder will be loaded as a repair config
# All repair configs have a main section titled "Repairables"
# Afterwards, all sub-items are considered a Repairable to be loaded. The names of each subitem should be the exact material name.
# The bare minimum of a Repairable is that it have a RepairMaterial and a MaximumDurability
#
# ItemType: This is the type of item to be repaired, this is only important to permissions.
## Valid values are ARMOR, TOOL, and OTHER.
## This defaults to OTHER.
#
# MaterialType: This is the type of the material of the item to be repaired, this is only important for permissions.
## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, and OTHER
## This defaults to OTHER.
#
# RepairMaterial: This is the material name of the item used to repair this repairable.
## This is required to be set.
#
# RepairMaterialMetadata: This is the metadata of the item used to repair this repairable.
## A value of -1 means to ignore all metadata when repairing.
## This defaults to -1
#
# MaximumDurability: This is the maximum durability of the item.
## This is required to be set.
#
# MinimumLevel: This is the minimum repair level needed to repair this item.
## Valid values are => 0
## This defaults to 0
#
# MinimumQuantity: This is the minimum number of items needed to repair this item ignoring all other repair bonuses.
## This is typically the number of the repair material needed to create a new item, for example for a sword it is 2, for an axe it is 3
## This defaults to 2
#
# XpMultiplier: This is the amount to multiply the xp bonus by.
## This defaults to 1
#
#
# The following is an example of a repair.*.yml config which adds the ability to repair Chainmail armor using fire.
#
#
###
Repairables:
#
# Chainmail repairables
###
# Armor
CHAINMAIL_HELMET:
RepairMaterial: FIRE
XpMultiplier: 2
CHAINMAIL_CHESTPLATE:
RepairMaterial: FIRE
XpMultiplier: 2
CHAINMAIL_LEGGINGS:
RepairMaterial: FIRE
XpMultiplier: 2
CHAINMAIL_BOOTS:
RepairMaterial: FIRE
XpMultiplier: 2

400
pom.xml Normal file → Executable file
View File

@ -2,43 +2,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.2.036-SNAPSHOT</version>
<version>1.4.08</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<connection>scm:git:git://github.com/mcMMO-Dev/mcMMO.git</connection>
<developerConnection>scm:git:git@github.com:mcMMO-Dev/mcMMO.git</developerConnection>
<tag>HEAD</tag>
</scm>
<properties>
<!-- <spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>-->
<spigot.version>1.21.5-R0.1-SNAPSHOT</spigot.version>
<adventure.version>4.3.5-SNAPSHOT</adventure.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<java.version>17</java.version>
</properties>
<issueManagement>
<url>https://github.com/mcMMO-Dev/mcMMO/issues</url>
<system>GitHub</system>
</issueManagement>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>neetgames</id>
<url>https://nexus.neetgames.com/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>neetgames</id>
<url>https://nexus.neetgames.com/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<finalName>${project.artifactId}</finalName>
<finalName>mcMMO</finalName>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
@ -66,66 +38,21 @@
<include>*.yml</include>
</includes>
</resource>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}</directory>
<includes>
<include>LICENSE</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<propertiesEncoding>UTF-8</propertiesEncoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<junitArtifactName>org.junit.jupiter:junit-jupiter</junitArtifactName>
<trimStackTrace>false</trimStackTrace>
<excludedGroups>skip</excludedGroups>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<junitArtifactName>org.junit.jupiter:junit-jupiter</junitArtifactName>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>2.3.2</version>
<configuration>
<release>17</release>
<compilerArgs>
<arg>-parameters</arg> <!-- used for ACF syntax stuff -->
</compilerArgs>
<source>1.6</source>
<target>1.6</target>
<excludes>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package.xml</descriptor>
@ -144,68 +71,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<version>1.5</version>
<configuration>
<artifactSet>
<includes>
<include>commons-logging:commons-logging</include>
<include>org.apache.tomcat:tomcat-jdbc</include>
<include>org.apache.tomcat:tomcat-juli</include>
<include>org.bstats:bstats-base</include>
<include>org.bstats:bstats-bukkit</include>
<include>net.kyori:adventure-api</include>
<include>net.kyori:adventure-key</include>
<include>net.kyori:adventure-nbt</include>
<include>net.kyori:adventure-platform-api</include>
<include>net.kyori:adventure-platform-bukkit</include>
<include>net.kyori:adventure-platform-facet</include>
<include>net.kyori:adventure-platform-viaversion</include>
<include>net.kyori:adventure-text-serializer-bungeecord</include>
<include>net.kyori:adventure-text-serializer-gson</include>
<include>net.kyori:adventure-text-serializer-gson-legacy-impl</include>
<include>net.kyori:adventure-text-serializer-json</include>
<include>net.kyori:adventure-text-serializer-json-legacy-impl</include>
<include>net.kyori:adventure-text-serializer-legacy</include>
<include>net.kyori:examination-api</include>
<include>net.kyori:examination-string</include>
<include>net.kyori:option</include>
<include>net.kyori:adventure-text-serializer-craftbukkit</include>
<include>co.aikar:acf-bukkit</include>
<include>com.github.technicallycoded:FoliaLib</include>
<include>com.turt2live.metrics:MetricsExtension</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.kyori</shadedPattern>
</relocation>
<relocation>
<pattern>co.aikar.commands</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.acf</shadedPattern> <!-- Replace this -->
</relocation>
<relocation>
<pattern>co.aikar.locales</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.locales</shadedPattern> <!-- Replace this -->
</relocation>
<relocation>
<pattern>org.apache.commons.logging</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.commons.logging</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.juli</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.database.tomcat.juli</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.tomcat</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.database.tomcat</shadedPattern>
</relocation>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.metrics.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>com.tcoded.folialib</pattern>
<shadedPattern>com.gmail.nossr50.mcmmo.folialib</shadedPattern>
<pattern>com.turt2live.metrics</pattern>
<shadedPattern>com.gmail.nossr50.metrics.mcstats</shadedPattern>
</relocation>
</relocations>
</configuration>
@ -223,249 +99,59 @@
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>3.5.2</version>
<version>2.2</version>
</extension>
</extensions>
</build>
<pluginRepositories>
<pluginRepository>
<id>maven-snapshots</id>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<!-- Protocol Lib Repository -->
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository> <!-- for development builds -->
<id>sonatype-oss</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>aikar</id>
<url>https://repo.aikar.co/content/groups/aikar/</url>
</repository>
<repository>
<id>sonatype-oss-snapshots1</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<!-- MockBukkit -->
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
<id>Plugin MetricsExtension</id>
<url>http://repo.turt2live.com</url>
</repository>
</repositories>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.25.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.3.0</version>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.6.4-R2.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.2.224</version>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>co.aikar</groupId>
<artifactId>acf-bukkit</artifactId> <!-- Don't forget to replace this -->
<version>0.5.1-SNAPSHOT</version> <!-- Replace this as well -->
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-bungeecord</artifactId>
<version>${adventure.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json-legacy-impl</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-api</artifactId>
<version>${adventure.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>${adventure.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-facet</artifactId>
<version>${adventure.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-viaversion</artifactId>
<version>${adventure.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>option</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.papermc.paper</groupId>-->
<!-- <artifactId>paper-api</artifactId>-->
<!-- <version>1.21.5-R0.1-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-core</artifactId>
<version>7.0.7</version>
<exclusions>
<exclusion>
<!-- We use jetbrains instead. Excluding this -->
<!-- prevents us from using inconsistent annotations -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-legacy</artifactId>
<version>7.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.0-M2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>10.1.24</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>24.1.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.0-jre</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.technicallycoded</groupId>
<artifactId>FoliaLib</artifactId>
<version>dev-SNAPSHOT</version>
<scope>compile</scope>
<groupId>com.turt2live.metrics</groupId>
<artifactId>MetricsExtension</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>md_5-snapshots</id>
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<ciManagement>
<system>Jenkins</system>
<url>http://ci.ecocitycraft.com/job/mcMMO</url>
</ciManagement>
</project>

View File

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

View File

@ -1,47 +1,46 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.util.player.UserManager;
public final class AbilityAPI {
private AbilityAPI() {}
public static boolean berserkEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.BERSERK);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.BERSERK);
}
public static boolean gigaDrillBreakerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GIGA_DRILL_BREAKER);
}
public static boolean greenTerraEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.GREEN_TERRA);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GREEN_TERRA);
}
public static boolean serratedStrikesEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.SERRATED_STRIKES);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SERRATED_STRIKES);
}
public static boolean skullSplitterEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.SKULL_SPLITTER);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SKULL_SPLITTER);
}
public static boolean superBreakerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.SUPER_BREAKER);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SUPER_BREAKER);
}
public static boolean treeFellerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.TREE_FELLER);
return UserManager.getPlayer(player).getAbilityMode(AbilityType.TREE_FELLER);
}
public static boolean isAnyAbilityEnabled(Player player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
for (SuperAbilityType ability : SuperAbilityType.values()) {
for (AbilityType ability : AbilityType.values()) {
if (mcMMOPlayer.getAbilityMode(ability)) {
return true;
}
@ -55,40 +54,30 @@ public final class AbilityAPI {
}
public static void setBerserkCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.BERSERK, cooldown);
UserManager.getPlayer(player).setAbilityDATS(AbilityType.BERSERK, cooldown);
}
public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.GIGA_DRILL_BREAKER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GIGA_DRILL_BREAKER, cooldown);
}
public static void setGreenTerraCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.GREEN_TERRA, cooldown);
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GREEN_TERRA, cooldown);
}
public static void setSerratedStrikesCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.SERRATED_STRIKES, cooldown);
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SERRATED_STRIKES, cooldown);
}
public static void setSkullSplitterCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.SKULL_SPLITTER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SKULL_SPLITTER, cooldown);
}
public static void setSuperBreakerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.SUPER_BREAKER, cooldown);
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SUPER_BREAKER, cooldown);
}
public static void setTreeFellerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.TREE_FELLER, cooldown);
}
public static boolean isBleeding(LivingEntity entity) {
if (entity.isValid()) {
if (entity.hasMetadata(MetadataConstants.METADATA_KEY_RUPTURE)) {
return true;
}
}
return false;
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown);
}
}

View File

@ -1,68 +1,73 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.chat.ChatManager;
import com.gmail.nossr50.chat.ChatManagerFactory;
import com.gmail.nossr50.chat.PartyChatManager;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
public final class ChatAPI {
private ChatAPI() {}
// /**
// * Send a message to all members of a party
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender
// * @param displayName The display name of the sender
// * @param party The name of the party to send to
// * @param message The message to send
// */
// public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) {
// getPartyChatManager(plugin, party).handleChat(sender, displayName, message);
// }
//
// /**
// * Send a message to all members of a party
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender to display in the chat
// * @param party The name of the party to send to
// * @param message The message to send
// */
// public static void sendPartyChat(Plugin plugin, String sender, String party, String message) {
// getPartyChatManager(plugin, party).handleChat(sender, message);
// }
//
// /**
// * Send a message to administrators
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender
// * @param displayName The display name of the sender
// * @param message The message to send
// */
// public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) {
// ChatManagerFactory.getChatManager(plugin, ChatChannel.ADMIN).handleChat(sender, displayName, message);
// }
//
// /**
// * Send a message to administrators
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender to display in the chat
// * @param message The message to send
// */
// public static void sendAdminChat(Plugin plugin, String sender, String message) {
// ChatManagerFactory.getChatManager(plugin, ChatChannel.ADMIN).handleChat(sender, message);
// }
/**
* Send a message to all members of a party
* </br>
* This function is designed for API usage.
*
* @param plugin The plugin sending the message
* @param sender The name of the sender
* @param displayName The display name of the sender
* @param party The name of the party to send to
* @param message The message to send
*/
public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) {
getPartyChatManager(plugin, party).handleChat(sender, displayName, message);
}
/**
* Send a message to all members of a party
* </br>
* This function is designed for API usage.
*
* @param plugin The plugin sending the message
* @param sender The name of the sender to display in the chat
* @param party The name of the party to send to
* @param message The message to send
*/
public static void sendPartyChat(Plugin plugin, String sender, String party, String message) {
getPartyChatManager(plugin, party).handleChat(sender, message);
}
/**
* Send a message to administrators
* </br>
* This function is designed for API usage.
*
* @param plugin The plugin sending the message
* @param sender The name of the sender
* @param displayName The display name of the sender
* @param message The message to send
*/
public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) {
ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, displayName, message);
}
/**
* Send a message to administrators
* </br>
* This function is designed for API usage.
*
* @param plugin The plugin sending the message
* @param sender The name of the sender to display in the chat
* @param message The message to send
*/
public static void sendAdminChat(Plugin plugin, String sender, String message) {
ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, message);
}
/**
* Check if a player is currently talking in party chat.
@ -71,7 +76,7 @@ public final class ChatAPI {
* @return true if the player is using party chat, false otherwise
*/
public static boolean isUsingPartyChat(Player player) {
return UserManager.getPlayer(player).getChatChannel() == ChatChannel.PARTY;
return UserManager.getPlayer(player).isChatEnabled(ChatMode.PARTY);
}
/**
@ -81,7 +86,7 @@ public final class ChatAPI {
* @return true if the player is using party chat, false otherwise
*/
public static boolean isUsingPartyChat(String playerName) {
return UserManager.getPlayer(playerName).getChatChannel() == ChatChannel.PARTY;
return UserManager.getPlayer(playerName).isChatEnabled(ChatMode.PARTY);
}
/**
@ -91,7 +96,7 @@ public final class ChatAPI {
* @return true if the player is using admin chat, false otherwise
*/
public static boolean isUsingAdminChat(Player player) {
return UserManager.getPlayer(player).getChatChannel() == ChatChannel.ADMIN;
return UserManager.getPlayer(player).isChatEnabled(ChatMode.ADMIN);
}
/**
@ -101,7 +106,7 @@ public final class ChatAPI {
* @return true if the player is using admin chat, false otherwise
*/
public static boolean isUsingAdminChat(String playerName) {
return UserManager.getPlayer(playerName).getChatChannel() == ChatChannel.ADMIN;
return UserManager.getPlayer(playerName).isChatEnabled(ChatMode.ADMIN);
}
/**
@ -110,7 +115,7 @@ public final class ChatAPI {
* @param player The player to toggle party chat on.
*/
public static void togglePartyChat(Player player) {
mcMMO.p.getChatManager().setOrToggleChatChannel(UserManager.getPlayer(player), ChatChannel.PARTY);
UserManager.getPlayer(player).toggleChat(ChatMode.PARTY);
}
/**
@ -119,7 +124,7 @@ public final class ChatAPI {
* @param playerName The name of the player to toggle party chat on.
*/
public static void togglePartyChat(String playerName) {
mcMMO.p.getChatManager().setOrToggleChatChannel(UserManager.getPlayer(playerName), ChatChannel.PARTY);
UserManager.getPlayer(playerName).toggleChat(ChatMode.PARTY);
}
/**
@ -128,7 +133,7 @@ public final class ChatAPI {
* @param player The player to toggle admin chat on.
*/
public static void toggleAdminChat(Player player) {
mcMMO.p.getChatManager().setOrToggleChatChannel(UserManager.getPlayer(player), ChatChannel.ADMIN);
UserManager.getPlayer(player).toggleChat(ChatMode.ADMIN);
}
/**
@ -137,6 +142,13 @@ public final class ChatAPI {
* @param playerName The name of the player to toggle party chat on.
*/
public static void toggleAdminChat(String playerName) {
mcMMO.p.getChatManager().setOrToggleChatChannel(UserManager.getPlayer(playerName), ChatChannel.ADMIN);
UserManager.getPlayer(playerName).toggleChat(ChatMode.ADMIN);
}
private static ChatManager getPartyChatManager(Plugin plugin, String party) {
ChatManager chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.PARTY);
((PartyChatManager) chatManager).setParty(PartyManager.getParty(party));
return chatManager;
}
}

View File

@ -1,50 +0,0 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.mcMMO;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;
import java.util.UUID;
public class DatabaseAPI {
/**
* Checks if a player exists in the mcMMO Database
* @param offlinePlayer target player
* @return true if the player exists in the DB, false if they do not
*/
public boolean doesPlayerExistInDB(@NotNull OfflinePlayer offlinePlayer) {
PlayerProfile playerProfile = mcMMO.getDatabaseManager().loadPlayerProfile(offlinePlayer);
return playerProfile.isLoaded();
}
/**
* Checks if a player exists in the mcMMO Database
* @param uuid target player
* @return true if the player exists in the DB, false if they do not
*/
public boolean doesPlayerExistInDB(@NotNull UUID uuid) {
PlayerProfile playerProfile = null;
try {
playerProfile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid);
} catch (Exception e) {
return false;
}
return playerProfile.isLoaded();
}
/**
* Checks if a player exists in the mcMMO Database
* @param playerName target player
* @return true if the player exists in the DB, false if they do not
*/
public boolean doesPlayerExistInDB(@NotNull String playerName) {
PlayerProfile playerProfile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName);
return playerProfile.isLoaded();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
package com.gmail.nossr50.api;
public enum FakeBlockBreakEventType {
FAKE,
TREE_FELLER
}

View File

@ -1,17 +0,0 @@
package com.gmail.nossr50.api;
public enum ItemSpawnReason {
ARROW_RETRIEVAL_ACTIVATED, //Players sometimes can retrieve arrows instead of losing them when hitting a mob
EXCAVATION_TREASURE, //Any drops when excavation treasures activate fall under this
FISHING_EXTRA_FISH, //A config setting allows more fish to be found when fishing, the extra fish are part of this
FISHING_SHAKE_TREASURE, //When using a fishing rod on a mob and finding a treasure via Shake
HYLIAN_LUCK_TREASURE, //When finding a treasure in grass via hylian luck
BLAST_MINING_DEBRIS_NON_ORES, //The non-ore debris that are dropped from blast mining
BLAST_MINING_ORES, //The ore(s) which may include player placed ores being dropped from blast mining
BLAST_MINING_ORES_BONUS_DROP, //Any bonus ores that drop from a result of a players Mining skills
UNARMED_DISARMED_ITEM, //When you disarm an opponent and they drop their weapon
SALVAGE_ENCHANTMENT_BOOK, //When you salvage an enchanted item and get the enchantment back in book form
SALVAGE_MATERIALS, //When you salvage an item and get materials back
TREE_FELLER_DISPLACED_BLOCK,
BONUS_DROPS, //Can be from Mining, Woodcutting, Herbalism, etc
}

View File

@ -1,17 +1,16 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyLeader;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
public final class PartyAPI {
private PartyAPI() {}
@ -25,22 +24,13 @@ public final class PartyAPI {
* @return the name of the player's party, or null if not in a party
*/
public static String getPartyName(Player player) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled() || !inParty(player)) {
if (!inParty(player)) {
return null;
}
return UserManager.getPlayer(player).getParty().getName();
}
/**
* Check if the party system is enabled.
*
* @return true if the party system is enabled, false otherwise
*/
public static boolean isPartySystemEnabled() {
return mcMMO.p.getPartyConfig().isPartyEnabled();
}
/**
* Checks if a player is in a party.
* </br>
@ -50,9 +40,6 @@ public final class PartyAPI {
* @return true if the player is in a party, false otherwise
*/
public static boolean inParty(Player player) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled() || UserManager.getPlayer(player) == null)
return false;
return UserManager.getPlayer(player).inParty();
}
@ -61,15 +48,12 @@ public final class PartyAPI {
* </br>
* This function is designed for API usage.
*
* @param playerA The first player to check
* @param playerB The second player to check
* @param playera The first player to check
* @param playerb The second player to check
* @return true if the two players are in the same party, false otherwise
*/
public static boolean inSameParty(Player playerA, Player playerB) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled())
return false;
return mcMMO.p.getPartyManager().inSameParty(playerA, playerB);
public static boolean inSameParty(Player playera, Player playerb) {
return PartyManager.inSameParty(playera, playerb);
}
/**
@ -80,7 +64,7 @@ public final class PartyAPI {
* @return the list of parties.
*/
public static List<Party> getParties() {
return mcMMO.p.getPartyManager().getParties();
return PartyManager.getParties();
}
/**
@ -90,64 +74,15 @@ public final class PartyAPI {
*
* @param player The player to add to the party
* @param partyName The party to add the player to
* @deprecated parties can have limits, use the other method
*/
@Deprecated
public static void addToParty(Player player, String partyName) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled()) {
return;
}
//Check if player profile is loaded
final McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
if (mmoPlayer == null)
return;
Party party = mcMMO.p.getPartyManager().getParty(partyName);
Party party = PartyManager.getParty(partyName);
if (party == null) {
party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName);
} else {
if (mcMMO.p.getPartyManager().isPartyFull(player, party)) {
NotificationManager.sendPlayerInformation(player, NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull", party.toString());
return;
}
party = new Party(player.getName(), partyName);
}
mcMMO.p.getPartyManager().addToParty(mmoPlayer, party);
}
/**
* The max party size of the server
* 0 or less for no size limit
* @return the max party size on this server
*/
public static int getMaxPartySize() {
return mcMMO.p.getGeneralConfig().getPartyMaxSize();
}
/**
* Add a player to a party.
* </br>
* This function is designed for API usage.
*
* @param player The player to add to the party
* @param partyName The party to add the player to
* @param bypassLimit if true bypasses party size limits
*/
public static void addToParty(Player player, String partyName, boolean bypassLimit) {
//Check if player profile is loaded
if (!mcMMO.p.getPartyConfig().isPartyEnabled() || UserManager.getPlayer(player) == null)
return;
Party party = mcMMO.p.getPartyManager().getParty(partyName);
if (party == null) {
party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName);
}
mcMMO.p.getPartyManager().addToParty(UserManager.getPlayer(player), party);
PartyManager.addToParty(UserManager.getPlayer(player), party);
}
/**
@ -158,11 +93,7 @@ public final class PartyAPI {
* @param player The player to remove
*/
public static void removeFromParty(Player player) {
//Check if player profile is loaded
if (!mcMMO.p.getPartyConfig().isPartyEnabled() || UserManager.getPlayer(player) == null)
return;
mcMMO.p.getPartyManager().removeFromParty(UserManager.getPlayer(player));
PartyManager.removeFromParty(UserManager.getPlayer(player));
}
/**
@ -173,11 +104,8 @@ public final class PartyAPI {
* @param partyName The party name
* @return the leader of the party
*/
public static @Nullable String getPartyLeader(String partyName) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled())
return null;
return mcMMO.p.getPartyManager().getPartyLeaderName(partyName);
public static String getPartyLeader(String partyName) {
return PartyManager.getPartyLeader(partyName);
}
/**
@ -186,14 +114,10 @@ public final class PartyAPI {
* This function is designed for API usage.
*
* @param partyName The name of the party to set the leader of
* @param playerName The playerName to set as leader
* @param player The player to set as leader
*/
@Deprecated
public static void setPartyLeader(String partyName, String playerName) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled())
return;
mcMMO.p.getPartyManager().setPartyLeader(mcMMO.p.getServer().getOfflinePlayer(playerName).getUniqueId(), mcMMO.p.getPartyManager().getParty(partyName));
public static void setPartyLeader(String partyName, String player) {
PartyManager.setPartyLeader(player, PartyManager.getParty(partyName));
}
/**
@ -206,13 +130,10 @@ public final class PartyAPI {
*/
@Deprecated
public static List<OfflinePlayer> getOnlineAndOfflineMembers(Player player) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled()) {
return null;
}
List<OfflinePlayer> members = new ArrayList<OfflinePlayer>();
List<OfflinePlayer> members = new ArrayList<>();
for (UUID memberUniqueId : mcMMO.p.getPartyManager().getAllMembers(player).keySet()) {
OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberUniqueId);
for (String memberName : PartyManager.getAllMembers(player)) {
OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberName);
members.add(member);
}
return members;
@ -226,27 +147,8 @@ public final class PartyAPI {
* @param player The player to check
* @return all the player names in the player's party
*/
@Deprecated
public static LinkedHashSet<String> getMembers(Player player) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled())
return null;
return (LinkedHashSet<String>) mcMMO.p.getPartyManager().getAllMembers(player).values();
}
/**
* Get a list of all player names and uuids in this player's party.
* </br>
* This function is designed for API usage.
*
* @param player The player to check
* @return all the player names and uuids in the player's party
*/
public static LinkedHashMap<UUID, String> getMembersMap(Player player) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled())
return null;
return mcMMO.p.getPartyManager().getAllMembers(player);
return PartyManager.getAllMembers(player);
}
/**
@ -258,10 +160,7 @@ public final class PartyAPI {
* @return all online players in this party
*/
public static List<Player> getOnlineMembers(String partyName) {
if (!mcMMO.p.getPartyConfig().isPartyEnabled())
return null;
return mcMMO.p.getPartyManager().getOnlineMembers(partyName);
return PartyManager.getOnlineMembers(partyName);
}
/**
@ -273,15 +172,15 @@ public final class PartyAPI {
* @return all online players in the player's party
*/
public static List<Player> getOnlineMembers(Player player) {
return mcMMO.p.getPartyManager().getOnlineMembers(player);
return PartyManager.getOnlineMembers(player);
}
public static boolean hasAlly(String partyName) {
return getAllyName(partyName) != null;
return PartyManager.getParty(partyName).getAlly() != null;
}
public static String getAllyName(String partyName) {
Party ally = mcMMO.p.getPartyManager().getParty(partyName).getAlly();
Party ally = PartyManager.getParty(partyName).getAlly();
if (ally != null) {
return ally.getName();
}

View File

@ -1,95 +0,0 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.skills.SkillTools;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public final class SkillAPI {
private SkillAPI() {}
/**
* Returns a list of strings with mcMMO's skills
* This includes parent and child skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getSkills() {
return getListFromEnum(Arrays.asList(PrimarySkillType.values()));
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes parent skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getNonChildSkills() {
return getListFromEnum(SkillTools.NON_CHILD_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes child skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getChildSkills() {
return getListFromEnum(mcMMO.p.getSkillTools().CHILD_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes combat skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getCombatSkills() {
return getListFromEnum(mcMMO.p.getSkillTools().COMBAT_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes gathering skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getGatheringSkills() {
return getListFromEnum(mcMMO.p.getSkillTools().GATHERING_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes misc skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getMiscSkills() {
return getListFromEnum(mcMMO.p.getSkillTools().MISC_SKILLS);
}
private static List<String> getListFromEnum(List<PrimarySkillType> skillsTypes) {
List<String> skills = new ArrayList<>();
for (PrimarySkillType primarySkillType : skillsTypes) {
skills.add(primarySkillType.name());
}
return skills;
}
}

View File

@ -1,12 +0,0 @@
package com.gmail.nossr50.api;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class TreeFellerBlockBreakEvent extends FakeBlockBreakEvent {
public TreeFellerBlockBreakEvent(@NotNull Block theBlock, @NotNull Player player) {
super(theBlock, player);
}
}

View File

@ -1,11 +0,0 @@
package com.gmail.nossr50.api.exceptions;
import org.jetbrains.annotations.NotNull;
public class IncompleteNamespacedKeyRegister extends RuntimeException {
private static final long serialVersionUID = -6905157273569301219L;
public IncompleteNamespacedKeyRegister(@NotNull String message) {
super(message);
}
}

View File

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

View File

@ -6,8 +6,4 @@ public class InvalidSkillException extends RuntimeException {
public InvalidSkillException() {
super("That is not a valid skill.");
}
public InvalidSkillException(String msg) {
super(msg);
}
}

View File

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

View File

@ -1,12 +0,0 @@
package com.gmail.nossr50.api.exceptions;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class McMMOPlayerNotFoundException extends RuntimeException {
private static final long serialVersionUID = 761917904993202836L;
public McMMOPlayerNotFoundException(@NotNull Player player) {
super("McMMOPlayer object was not found for [NOTE: This can mean the profile is not loaded yet! : " + player.getName() + " " + player.getUniqueId());
}
}

View File

@ -1,9 +0,0 @@
package com.gmail.nossr50.api.exceptions;
import org.jetbrains.annotations.NotNull;
public class ValueOutOfBoundsException extends RuntimeException {
public ValueOutOfBoundsException(@NotNull String message) {
super(message);
}
}

View File

@ -0,0 +1,22 @@
package com.gmail.nossr50.chat;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
public class AdminChatManager extends ChatManager {
protected AdminChatManager(Plugin plugin) {
super(plugin, Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix());
}
@Override
public void handleChat(String senderName, String displayName, String message, boolean isAsync) {
handleChat(new McMMOAdminChatEvent(plugin, senderName, displayName, message, isAsync));
}
@Override
protected void sendMessage() {
plugin.getServer().broadcast(message, "mcmmo.chat.adminchat");
}
}

View File

@ -1,225 +1,53 @@
package com.gmail.nossr50.chat;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.chat.author.ConsoleAuthor;
import com.gmail.nossr50.chat.mailer.AdminChatMailer;
import com.gmail.nossr50.chat.mailer.PartyChatMailer;
import com.gmail.nossr50.config.ChatConfig;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.events.chat.McMMOChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.text.StringUtils;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.command.ConsoleCommandSender;
import org.jetbrains.annotations.NotNull;
//TODO: Micro optimization - Cache audiences and update cache when needed
public class ChatManager {
public abstract class ChatManager {
protected Plugin plugin;
protected boolean useDisplayNames;
protected String chatPrefix;
private final @NotNull AdminChatMailer adminChatMailer;
private final @NotNull PartyChatMailer partyChatMailer;
protected String senderName;
protected String displayName;
protected String message;
private final @NotNull ConsoleAuthor consoleAuthor;
private final @NotNull Audience consoleAudience;
private final boolean isChatEnabled;
public ChatManager(@NotNull mcMMO pluginRef) {
adminChatMailer = new AdminChatMailer(pluginRef);
partyChatMailer = new PartyChatMailer(pluginRef);
this.consoleAuthor = new ConsoleAuthor(LocaleLoader.getString("Chat.Identity.Console"));
this.consoleAudience = mcMMO.getAudiences().filter((cs) -> cs instanceof ConsoleCommandSender);
this.isChatEnabled = ChatConfig.getInstance().isChatEnabled();
protected ChatManager(Plugin plugin, boolean useDisplayNames, String chatPrefix) {
this.plugin = plugin;
this.useDisplayNames = useDisplayNames;
this.chatPrefix = chatPrefix;
}
/**
* Handles player messaging when they are either in party chat or admin chat modes
*
* @param mmoPlayer target player
* @param rawMessage the raw message from the player as it was typed
* @param isAsync whether this is getting processed via async
*/
public void processPlayerMessage(@NotNull McMMOPlayer mmoPlayer, @NotNull String rawMessage, boolean isAsync) {
processPlayerMessage(mmoPlayer, mmoPlayer.getChatChannel(), rawMessage, isAsync);
}
protected void handleChat(McMMOChatEvent event) {
plugin.getServer().getPluginManager().callEvent(event);
/**
* Handles player messaging for a specific chat channel
*
* @param mmoPlayer target player
* @param args the raw command arguments from the player
* @param chatChannel target channel
*/
public void processPlayerMessage(@NotNull McMMOPlayer mmoPlayer, @NotNull String[] args, @NotNull ChatChannel chatChannel) {
String chatMessageWithoutCommand = buildChatMessage(args);
//Commands are never async
processPlayerMessage(mmoPlayer, chatChannel, chatMessageWithoutCommand, false);
}
/**
* Handles player messaging for a specific chat channel
*
* @param mmoPlayer target player
* @param chatChannel target chat channel
* @param rawMessage raw chat message as it was typed
* @param isAsync whether this is getting processed via async
*/
private void processPlayerMessage(@NotNull McMMOPlayer mmoPlayer, @NotNull ChatChannel chatChannel, @NotNull String rawMessage, boolean isAsync) {
switch (chatChannel) {
case ADMIN:
adminChatMailer.processChatMessage(mmoPlayer.getPlayerAuthor(), rawMessage, isAsync, Permissions.colorChat(mmoPlayer.getPlayer()));
break;
case PARTY:
partyChatMailer.processChatMessage(mmoPlayer.getPlayerAuthor(), rawMessage, mmoPlayer.getParty(), isAsync, Permissions.colorChat(mmoPlayer.getPlayer()), Misc.isPartyLeader(mmoPlayer));
break;
case PARTY_OFFICER:
case NONE:
break;
}
}
/**
* Handles console messaging to admins
* @param rawMessage raw message from the console
*/
public void processConsoleMessage(@NotNull String rawMessage) {
adminChatMailer.processChatMessage(getConsoleAuthor(), rawMessage, false, true);
}
/**
* Handles console messaging to admins
* @param args raw command args from the console
*/
public void processConsoleMessage(@NotNull String[] args) {
processConsoleMessage(buildChatMessage(args));
}
/**
* Handles console messaging to a specific party
* @param rawMessage raw message from the console
* @param party target party
*/
public void processConsoleMessage(@NotNull String rawMessage, @NotNull Party party) {
partyChatMailer.processChatMessage(getConsoleAuthor(), rawMessage, party, false, true, false);
}
/**
* Gets a console author
* @return a {@link ConsoleAuthor}
*/
private @NotNull Author getConsoleAuthor() {
return consoleAuthor;
}
/**
* Change the chat channel of a {@link McMMOPlayer}
* Targeting the channel a player is already in will remove that player from the chat channel
* @param mmoPlayer target player
* @param targetChatChannel target chat channel
*/
public void setOrToggleChatChannel(@NotNull McMMOPlayer mmoPlayer, @NotNull ChatChannel targetChatChannel) {
if (targetChatChannel == mmoPlayer.getChatChannel()) {
//Disabled message
mmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Chat.Channel.Off", StringUtils.getCapitalized(targetChatChannel.toString())));
mmoPlayer.setChatMode(ChatChannel.NONE);
} else {
mmoPlayer.setChatMode(targetChatChannel);
mmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Chat.Channel.On", StringUtils.getCapitalized(targetChatChannel.toString())));
}
}
/**
* Create a chat message from an array of {@link String}
* @param args array of {@link String}
* @return a String built from the array
*/
private @NotNull String buildChatMessage(@NotNull String[] args) {
StringBuilder stringBuilder = new StringBuilder();
for(int i = 0; i < args.length; i++) {
if (i + 1 >= args.length) {
stringBuilder.append(args[i]);
} else {
stringBuilder.append(args[i]).append(" ");
}
if (event.isCancelled()) {
return;
}
return stringBuilder.toString();
senderName = event.getSender();
displayName = useDisplayNames ? event.getDisplayName() : senderName;
message = LocaleLoader.formatString(chatPrefix, displayName) + " " + event.getMessage();
sendMessage();
}
/**
* Whether the player is allowed to send a message to the chat channel they are targeting
* @param mmoPlayer target player
* @return true if the player can send messages to that chat channel
*/
public boolean isMessageAllowed(@NotNull McMMOPlayer mmoPlayer) {
switch (mmoPlayer.getChatChannel()) {
case ADMIN:
if (mmoPlayer.getPlayer().isOp() || Permissions.adminChat(mmoPlayer.getPlayer())) {
return true;
}
break;
case PARTY:
if (mmoPlayer.getParty() != null && Permissions.partyChat(mmoPlayer.getPlayer())) {
return true;
}
break;
case PARTY_OFFICER:
case NONE:
return false;
}
return false;
public void handleChat(String senderName, String message) {
handleChat(senderName, senderName, message, false);
}
/**
* Sends just the console a message
* @param author author of the message
* @param message message contents in component form
*/
public void sendConsoleMessage(@NotNull Author author, @NotNull TextComponent message) {
consoleAudience.sendMessage(author, message);
public void handleChat(Player player, String message, boolean isAsync) {
handleChat(player.getName(), player.getDisplayName(), message, isAsync);
}
/**
* Whether the mcMMO chat system which handles party and admin chat is enabled or disabled
* @return true if mcMMO chat processing (for party/admin chat) is enabled
*/
public boolean isChatEnabled() {
return isChatEnabled;
public void handleChat(String senderName, String displayName, String message) {
handleChat(senderName, displayName, message, false);
}
/**
* Whether a specific chat channel is enabled
* ChatChannels are enabled/disabled via user config
*
* If chat is disabled, this always returns false
* If NONE is passed as a {@link ChatChannel} it will return true
* @param chatChannel target chat channel
* @return true if the chat channel is enabled
*/
public boolean isChatChannelEnabled(@NotNull ChatChannel chatChannel) {
if (!isChatEnabled) {
return false;
} else {
switch(chatChannel) {
case ADMIN:
case PARTY:
case PARTY_OFFICER:
return ChatConfig.getInstance().isChatChannelEnabled(chatChannel);
case NONE:
return true;
default:
return false;
}
}
}
public abstract void handleChat(String senderName, String displayName, String message, boolean isAsync);
}
protected abstract void sendMessage();
}

View File

@ -0,0 +1,31 @@
package com.gmail.nossr50.chat;
import java.util.HashMap;
import org.bukkit.plugin.Plugin;
import com.gmail.nossr50.datatypes.chat.ChatMode;
public class ChatManagerFactory {
private static final HashMap<Plugin, AdminChatManager> adminChatManagers = new HashMap<Plugin, AdminChatManager>();
private static final HashMap<Plugin, PartyChatManager> partyChatManagers = new HashMap<Plugin, PartyChatManager>();
public static ChatManager getChatManager(Plugin plugin, ChatMode mode) {
switch (mode) {
case ADMIN:
if (!adminChatManagers.containsKey(plugin)) {
adminChatManagers.put(plugin, new AdminChatManager(plugin));
}
return adminChatManagers.get(plugin);
case PARTY:
if (!partyChatManagers.containsKey(plugin)) {
partyChatManagers.put(plugin, new PartyChatManager(plugin));
}
return partyChatManagers.get(plugin);
default:
return null;
}
}
}

View File

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

View File

@ -1,35 +0,0 @@
package com.gmail.nossr50.chat;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import java.util.function.Predicate;
public class SamePartyPredicate<T extends CommandSender> implements Predicate<T> {
final Party party;
public SamePartyPredicate(Party party) {
this.party = party;
}
@Override
public boolean test(T t) {
//Include the console in the audience
if (t instanceof ConsoleCommandSender) {
return false; //Party audiences are special, we exclude console from them to avoid double messaging since we send a more verbose version to consoles
} else {
if (t instanceof Player player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (mcMMOPlayer != null) {
return mcMMOPlayer.getParty() == party;
}
}
}
return false;
}
}

View File

@ -1,120 +0,0 @@
package com.gmail.nossr50.chat.author;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.util.text.TextUtils;
import com.google.common.base.Objects;
import org.bukkit.entity.Player;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.UUID;
public abstract class AbstractPlayerAuthor implements Author {
private final @NotNull Player player;
private @NotNull String lastKnownDisplayName;
private final @NotNull HashMap<ChatChannel, String> sanitizedNameCache;
public AbstractPlayerAuthor(@NotNull Player player) {
this.player = player;
this.lastKnownDisplayName = player.getDisplayName();
this.sanitizedNameCache = new HashMap<>();
}
/**
* Returns true if a players display name has changed
*
* @return true if the players display name has changed
*/
private boolean hasPlayerDisplayNameChanged() {
return !player.getDisplayName().equals(lastKnownDisplayName);
}
/**
* Player display names can change and this method will update the last known display name of this player
*/
private void updateLastKnownDisplayName() {
lastKnownDisplayName = player.getDisplayName();
}
/**
* Gets a sanitized name for a channel
* Sanitized names are names that are friendly to the {@link net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer}
* Sanitized names for authors are cached by channel and are only created as needed
* Sanitized names will update if a players display name has updated
*
* @param chatChannel target chat channel
* @return the sanitized name for a player
*/
protected @NotNull String getSanitizedName(@NotNull ChatChannel chatChannel, boolean useDisplayName) {
//Already in cache
if (sanitizedNameCache.containsKey(chatChannel)) {
//Update cache
if (useDisplayName && hasPlayerDisplayNameChanged()) {
updateLastKnownDisplayName();
updateSanitizedNameCache(chatChannel, true);
}
} else {
//Update last known display name
if (useDisplayName && hasPlayerDisplayNameChanged()) {
updateLastKnownDisplayName();
}
//Add cache entry
updateSanitizedNameCache(chatChannel, useDisplayName);
}
return sanitizedNameCache.get(chatChannel);
}
/**
* Update the sanitized name cache
* This will add entries if one didn't exit
* Sanitized names are associated with a {@link ChatChannel} as different chat channels have different chat name settings
*
* @param chatChannel target chat channel
* @param useDisplayName whether to use this authors display name
*/
private void updateSanitizedNameCache(@NotNull ChatChannel chatChannel, boolean useDisplayName) {
if (useDisplayName) {
sanitizedNameCache.put(chatChannel, TextUtils.sanitizeForSerializer(player.getDisplayName()));
} else {
//No need to sanitize a basic String
sanitizedNameCache.put(chatChannel, player.getName());
}
}
@Override
public boolean isConsole() {
return false;
}
@Override
public boolean isPlayer() {
return true;
}
public @NotNull Player getPlayer() {
return player;
}
@Override
public @NonNull UUID uuid() {
return player.getUniqueId();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AbstractPlayerAuthor that = (AbstractPlayerAuthor) o;
return Objects.equal(player, that.player) &&
Objects.equal(lastKnownDisplayName, that.lastKnownDisplayName) &&
Objects.equal(sanitizedNameCache, that.sanitizedNameCache);
}
@Override
public int hashCode() {
return Objects.hashCode(player, lastKnownDisplayName, sanitizedNameCache);
}
}

View File

@ -1,31 +0,0 @@
package com.gmail.nossr50.chat.author;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import net.kyori.adventure.identity.Identity;
import org.jetbrains.annotations.NotNull;
public interface Author extends Identity {
/**
* The name of this author as used in mcMMO chat
* This is the {@link String} representation of the users current chat username
* This can either be the player's display name or the player's official registered nickname with Mojang it depends on the servers chat settings for mcMMO
*
* @param chatChannel which chat channel this is going to
* @return The name of this author as used in mcMMO chat
*/
@NotNull String getAuthoredName(@NotNull ChatChannel chatChannel);
/**
* Whether this author is a {@link org.bukkit.command.ConsoleCommandSender}
*
* @return true if this author is the console
*/
boolean isConsole();
/**
* Whether this author is a {@link org.bukkit.entity.Player}
* @return true if this author is a player
*/
boolean isPlayer();
}

View File

@ -1,39 +0,0 @@
package com.gmail.nossr50.chat.author;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.util.text.TextUtils;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.UUID;
public class ConsoleAuthor implements Author {
private final UUID uuid;
private final @NotNull String name;
public ConsoleAuthor(@NotNull String name) {
this.uuid = new UUID(0, 0);
this.name = TextUtils.sanitizeForSerializer(name);
}
//TODO: Think of a less clunky solution later
@Override
public @NotNull String getAuthoredName(@NotNull ChatChannel chatChannel) {
return name;
}
@Override
public boolean isConsole() {
return true;
}
@Override
public boolean isPlayer() {
return false;
}
@Override
public @NonNull UUID uuid() {
return uuid;
}
}

View File

@ -1,19 +0,0 @@
package com.gmail.nossr50.chat.author;
import com.gmail.nossr50.config.ChatConfig;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class PlayerAuthor extends AbstractPlayerAuthor {
public PlayerAuthor(@NotNull Player player) {
super(player);
}
@Override
public @NotNull String getAuthoredName(@NotNull ChatChannel chatChannel) {
return getSanitizedName(chatChannel, ChatConfig.getInstance().useDisplayNames(chatChannel));
}
}

View File

@ -1,13 +0,0 @@
package com.gmail.nossr50.chat.mailer;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
public abstract class AbstractChatMailer implements ChatMailer {
protected final @NotNull Plugin pluginRef;
public AbstractChatMailer(@NotNull Plugin pluginRef) {
this.pluginRef = pluginRef;
}
}

View File

@ -1,92 +0,0 @@
package com.gmail.nossr50.chat.mailer;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.chat.message.AdminChatMessage;
import com.gmail.nossr50.chat.message.ChatMessage;
import com.gmail.nossr50.config.ChatConfig;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
import com.gmail.nossr50.events.chat.McMMOChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.text.TextUtils;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import java.util.function.Predicate;
public class AdminChatMailer extends AbstractChatMailer {
public AdminChatMailer(Plugin pluginRef) {
super(pluginRef);
}
public static final @NotNull String MCMMO_CHAT_ADMINCHAT_PERMISSION = "mcmmo.chat.adminchat";
/**
* Constructs an audience of admins
*
* @return an audience of admins
*/
public @NotNull Audience constructAudience() {
return mcMMO.getAudiences().filter(predicate());
}
/**
* Predicate used to filter the audience
*
* @return admin chat audience predicate
*/
public @NotNull Predicate<CommandSender> predicate() {
return (commandSender) -> commandSender.isOp()
|| commandSender.hasPermission(MCMMO_CHAT_ADMINCHAT_PERMISSION)
|| (ChatConfig.getInstance().isConsoleIncludedInAudience(ChatChannel.ADMIN) && commandSender instanceof ConsoleCommandSender);
}
/**
* Styles a string using a locale entry
*
* @param author message author
* @param message message contents
* @param canColor whether to replace colors codes with colors in the raw message
* @return the styled string, based on a locale entry
*/
public @NotNull TextComponent addStyle(@NotNull Author author, @NotNull String message, boolean canColor) {
if (canColor) {
return LocaleLoader.getTextComponent("Chat.Style.Admin", author.getAuthoredName(ChatChannel.ADMIN), message);
} else {
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Admin", author.getAuthoredName(ChatChannel.ADMIN), message));
}
}
@Override
public void sendMail(@NotNull ChatMessage chatMessage) {
chatMessage.sendMessage();
}
/**
* Processes a chat message from an author to an audience of admins
*
* @param author the author
* @param rawString the raw message as the author typed it before any styling
* @param isAsync whether this is being processed asynchronously
* @param canColor whether the author can use colors in chat
*/
public void processChatMessage(@NotNull Author author, @NotNull String rawString, boolean isAsync, boolean canColor) {
AdminChatMessage chatMessage = new AdminChatMessage(pluginRef, author, constructAudience(), rawString, addStyle(author, rawString, canColor));
McMMOChatEvent chatEvent = new McMMOAdminChatEvent(pluginRef, chatMessage, isAsync);
Bukkit.getPluginManager().callEvent(chatEvent);
if (!chatEvent.isCancelled()) {
sendMail(chatMessage);
}
}
}

View File

@ -1,12 +0,0 @@
package com.gmail.nossr50.chat.mailer;
import com.gmail.nossr50.chat.message.ChatMessage;
import org.jetbrains.annotations.NotNull;
public interface ChatMailer {
/**
* Send out a chat message
* @param chatMessage the {@link ChatMessage}
*/
void sendMail(@NotNull ChatMessage chatMessage);
}

View File

@ -1,82 +0,0 @@
package com.gmail.nossr50.chat.mailer;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.chat.message.ChatMessage;
import com.gmail.nossr50.chat.message.PartyChatMessage;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.chat.McMMOChatEvent;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.text.TextUtils;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
public class PartyChatMailer extends AbstractChatMailer {
public PartyChatMailer(@NotNull Plugin pluginRef) {
super(pluginRef);
}
/**
* Processes a chat message from an author to an audience of party members
*
* @param author the author
* @param rawString the raw message as the author typed it before any styling
* @param isAsync whether this is being processed asynchronously
* @param canColor whether the author can use colors in chat
*/
public void processChatMessage(@NotNull Author author, @NotNull String rawString, @NotNull Party party, boolean isAsync, boolean canColor, boolean isLeader) {
PartyChatMessage chatMessage = new PartyChatMessage(pluginRef, author, constructPartyAudience(party), rawString, addStyle(author, rawString, canColor, isLeader), party);
McMMOChatEvent chatEvent = new McMMOPartyChatEvent(pluginRef, chatMessage, party, isAsync);
Bukkit.getPluginManager().callEvent(chatEvent);
if (!chatEvent.isCancelled()) {
sendMail(chatMessage);
}
}
/**
* Constructs an {@link Audience} of party members
*
* @param party target party
* @return an {@link Audience} of party members
*/
public @NotNull Audience constructPartyAudience(@NotNull Party party) {
return mcMMO.getAudiences().filter(party.getSamePartyPredicate());
}
/**
* Styles a string using a locale entry
*
* @param author message author
* @param message message contents
* @param canColor whether to replace colors codes with colors in the raw message
* @return the styled string, based on a locale entry
*/
public @NotNull TextComponent addStyle(@NotNull Author author, @NotNull String message, boolean canColor, boolean isLeader) {
if (canColor) {
if (isLeader) {
return LocaleLoader.getTextComponent("Chat.Style.Party.Leader", author.getAuthoredName(ChatChannel.PARTY), message);
} else {
return LocaleLoader.getTextComponent("Chat.Style.Party", author.getAuthoredName(ChatChannel.PARTY), message);
}
} else {
if (isLeader) {
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Party.Leader", author.getAuthoredName(ChatChannel.PARTY), message));
} else {
return TextUtils.ofLegacyTextRaw(LocaleLoader.getString("Chat.Style.Party", author.getAuthoredName(ChatChannel.PARTY), message));
}
}
}
@Override
public void sendMail(@NotNull ChatMessage chatMessage) {
chatMessage.sendMessage();
}
}

View File

@ -1,72 +0,0 @@
package com.gmail.nossr50.chat.message;
import com.gmail.nossr50.chat.author.Author;
import com.google.common.base.Objects;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
public abstract class AbstractChatMessage implements ChatMessage {
protected final @NotNull Plugin pluginRef;
protected final @NotNull Author author;
protected final @NotNull String rawMessage;
protected @NotNull TextComponent componentMessage;
protected @NotNull Audience audience;
public AbstractChatMessage(@NotNull Plugin pluginRef, @NotNull Author author, @NotNull Audience audience, @NotNull String rawMessage, @NotNull TextComponent componentMessage) {
this.pluginRef = pluginRef;
this.author = author;
this.audience = audience;
this.rawMessage = rawMessage;
this.componentMessage = componentMessage;
}
@Override
public @NotNull String rawMessage() {
return rawMessage;
}
@Override
public @NotNull Author getAuthor() {
return author;
}
@Override
public @NotNull Audience getAudience() {
return audience;
}
@Override
public @NotNull TextComponent getChatMessage() {
return componentMessage;
}
@Override
public void setChatMessage(@NotNull TextComponent textComponent) {
this.componentMessage = textComponent;
}
@Override
public void setAudience(@NotNull Audience newAudience) {
audience = newAudience;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AbstractChatMessage that = (AbstractChatMessage) o;
return Objects.equal(pluginRef, that.pluginRef) &&
Objects.equal(author, that.author) &&
Objects.equal(rawMessage, that.rawMessage) &&
Objects.equal(componentMessage, that.componentMessage) &&
Objects.equal(audience, that.audience);
}
@Override
public int hashCode() {
return Objects.hashCode(pluginRef, author, rawMessage, componentMessage, audience);
}
}

View File

@ -1,24 +0,0 @@
package com.gmail.nossr50.chat.message;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
public class AdminChatMessage extends AbstractChatMessage {
public AdminChatMessage(@NotNull Plugin pluginRef, @NotNull Author author, @NotNull Audience audience, @NotNull String rawMessage, @NotNull TextComponent componentMessage) {
super(pluginRef, author, audience, rawMessage, componentMessage);
}
@Override
public void sendMessage() {
audience.sendMessage(author, componentMessage);
}
@Override
public @NotNull String getAuthorDisplayName() {
return author.getAuthoredName(ChatChannel.ADMIN);
}
}

View File

@ -1,73 +0,0 @@
package com.gmail.nossr50.chat.message;
import com.gmail.nossr50.chat.author.Author;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.jetbrains.annotations.NotNull;
public interface ChatMessage {
/**
* The original message from the {@link Author}
* This is formatted and styled before being sent out to players by mcMMO
*
* @return the original message without any formatting or alterations
* @see #getChatMessage()
*/
@NotNull String rawMessage();
/**
* The {@link Author} from which this payload originated
*
* @see #getChatMessage()
* @return the source of the chat message
*/
@NotNull Author getAuthor();
/**
* The authors display name which is used in the initial creation of the message payload, it is provided for convenience.
*
* This is a name generated by mcMMO during the creation of the {@link ChatMessage}
*
* This is used by mcMMO when generating the message payload
*
* This method provides the display name for the convenience of plugins constructing their own {@link TextComponent payloads}
*
* @see #getChatMessage()
* @return the author display name as generated by mcMMO
*/
@NotNull String getAuthorDisplayName();
/**
* The target audience of this chat message
* Unless modified, this will include the {@link Author}
*
* @return target audience
*/
@NotNull Audience getAudience();
/**
* The {@link TextComponent message} being sent to the audience
*
* @return the {@link TextComponent message} that will be sent to the audience
*/
@NotNull TextComponent getChatMessage();
/**
* Change the value of the {@link TextComponent message}
*
* @param textComponent new message value
*/
void setChatMessage(@NotNull TextComponent textComponent);
/**
* Changes the audience
*
* @param newAudience the replacement audience
*/
void setAudience(@NotNull Audience newAudience);
/**
* Deliver the message to the audience
*/
void sendMessage();
}

View File

@ -1,96 +0,0 @@
package com.gmail.nossr50.chat.message;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.config.ChatConfig;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.base.Objects;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
public class PartyChatMessage extends AbstractChatMessage {
private final @NotNull Party party;
public PartyChatMessage(@NotNull Plugin pluginRef, @NotNull Author author, @NotNull Audience audience, @NotNull String rawMessage, @NotNull TextComponent componentMessage, @NotNull Party party) {
super(pluginRef, author, audience, rawMessage, componentMessage);
this.party = party;
}
/**
* The party that this chat message was intended for
* @return the party that this message was intended for
*/
public @NotNull Party getParty() {
return party;
}
@Override
public @NotNull String getAuthorDisplayName() {
return author.getAuthoredName(ChatChannel.PARTY);
}
@Override
public void sendMessage() {
/*
* It should be noted that Party messages don't include console as part of the audience to avoid double messaging
* The console gets a message that has the party name included, player parties do not
*/
//Sends to everyone but console
audience.sendMessage(author, componentMessage);
TextComponent spyMessage = LocaleLoader.getTextComponent("Chat.Spy.Party", author.getAuthoredName(ChatChannel.PARTY), rawMessage, party.getName());
//Relay to spies
messagePartyChatSpies(spyMessage);
//Console message
if (ChatConfig.getInstance().isConsoleIncludedInAudience(ChatChannel.PARTY))
mcMMO.p.getChatManager().sendConsoleMessage(author, spyMessage);
}
/**
* Console and Party Chat Spies get a more verbose version of the message
* Party Chat Spies will get a copy of the message as well
* @param spyMessage the message to copy to spies
*/
private void messagePartyChatSpies(@NotNull TextComponent spyMessage) {
//Find the people with permissions
for(McMMOPlayer mcMMOPlayer : UserManager.getPlayers()) {
Player player = mcMMOPlayer.getPlayer();
//Check for toggled players
if (mcMMOPlayer.isPartyChatSpying()) {
Party adminParty = mcMMOPlayer.getParty();
//Only message admins not part of this party
if (adminParty == null || adminParty != getParty()) {
//TODO: Hacky, rewrite later
Audience audience = mcMMO.getAudiences().player(player);
audience.sendMessage(spyMessage);
}
}
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
PartyChatMessage that = (PartyChatMessage) o;
return Objects.equal(party, that.party);
}
@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), party);
}
}

View File

@ -1,147 +0,0 @@
package com.gmail.nossr50.commands;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.BukkitCommandManager;
import co.aikar.commands.ConditionFailedException;
import com.gmail.nossr50.commands.chat.AdminChatCommand;
import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.skills.PowerLevelCommand;
import com.gmail.nossr50.config.ChatConfig;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permissible;
import org.jetbrains.annotations.NotNull;
/*
* For now this class will only handle ACF converted commands, all other commands will be handled elsewhere
*/
public class CommandManager {
public static final @NotNull String MMO_DATA_LOADED = "mmoDataLoaded";
//CHAT
public static final @NotNull String ADMIN_CONDITION = "adminCondition";
public static final @NotNull String PARTY_CONDITION = "partyCondition";
//SKILLS
public static final @NotNull String POWER_LEVEL_CONDITION = "powerLevelCondition";
private final @NotNull mcMMO pluginRef;
private final @NotNull BukkitCommandManager bukkitCommandManager;
public CommandManager(@NotNull mcMMO pluginRef) {
this.pluginRef = pluginRef;
bukkitCommandManager = new BukkitCommandManager(pluginRef);
registerConditions();
registerCommands();
}
private void registerCommands() {
registerSkillCommands(); //TODO: Implement other skills not just power level
registerChatCommands();
}
private void registerSkillCommands() {
if (mcMMO.p.getGeneralConfig().isMasterySystemEnabled()) {
bukkitCommandManager.registerCommand(new PowerLevelCommand(pluginRef));
}
}
/**
* Registers chat commands if the chat system is enabled
*/
private void registerChatCommands() {
if (ChatConfig.getInstance().isChatEnabled()) {
if (ChatConfig.getInstance().isChatChannelEnabled(ChatChannel.ADMIN)) {
bukkitCommandManager.registerCommand(new AdminChatCommand(pluginRef));
}
if (pluginRef.getPartyConfig().isPartyEnabled() && ChatConfig.getInstance().isChatChannelEnabled(ChatChannel.PARTY)) {
bukkitCommandManager.registerCommand(new PartyChatCommand(pluginRef));
}
}
}
public void registerConditions() {
registerChatCommandConditions(); //Chat Commands
registerSkillConditions();
}
private void registerSkillConditions() {
bukkitCommandManager.getCommandConditions().addCondition(POWER_LEVEL_CONDITION, (context) -> {
BukkitCommandIssuer issuer = context.getIssuer();
if (issuer.getIssuer() instanceof Player) {
validateLoadedData(issuer.getPlayer());
} else {
throw new ConditionFailedException(LocaleLoader.getString("Commands.NoConsole"));
}
});
}
private void registerChatCommandConditions() {
// Method or Class based - Can only be used on methods
bukkitCommandManager.getCommandConditions().addCondition(ADMIN_CONDITION, (context) -> {
BukkitCommandIssuer issuer = context.getIssuer();
if (issuer.getIssuer() instanceof Player) {
validateLoadedData(issuer.getPlayer());
validateAdmin(issuer.getPlayer());
}
});
bukkitCommandManager.getCommandConditions().addCondition(MMO_DATA_LOADED, (context) -> {
BukkitCommandIssuer bukkitCommandIssuer = context.getIssuer();
if (bukkitCommandIssuer.getIssuer() instanceof Player) {
validateLoadedData(bukkitCommandIssuer.getPlayer());
}
});
bukkitCommandManager.getCommandConditions().addCondition(PARTY_CONDITION, (context) -> {
BukkitCommandIssuer bukkitCommandIssuer = context.getIssuer();
if (bukkitCommandIssuer.getIssuer() instanceof Player) {
validateLoadedData(bukkitCommandIssuer.getPlayer());
validatePlayerParty(bukkitCommandIssuer.getPlayer());
//TODO: Is there even a point in validating permission? look into this later
validatePermission("mcmmo.chat.partychat", bukkitCommandIssuer.getPlayer());
}
});
}
private void validatePermission(@NotNull String permissionNode, @NotNull Permissible permissible) {
if (!permissible.hasPermission(permissionNode)) {
throw new ConditionFailedException(LocaleLoader.getString("mcMMO.NoPermission"));
}
}
public void validateAdmin(@NotNull Player player) {
if (!player.isOp() && !Permissions.adminChat(player)) {
throw new ConditionFailedException("You are lacking the correct permissions to use this command.");
}
}
public void validateLoadedData(@NotNull Player player) {
if (UserManager.getPlayer(player) == null) {
throw new ConditionFailedException(LocaleLoader.getString("Profile.PendingLoad"));
}
}
public void validatePlayerParty(@NotNull Player player) {
McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
if (!pluginRef.getPartyConfig().isPartyEnabled() || mmoPlayer.getParty() == null) {
throw new ConditionFailedException(LocaleLoader.getString("Commands.Party.None"));
}
}
public @NotNull BukkitCommandManager getBukkitCommandManager() {
return bukkitCommandManager;
}
}

View File

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

View File

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

View File

@ -1,34 +1,35 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.google.common.collect.ImmutableList;
public class McconvertCommand implements TabExecutor {
private static final List<String> FORMULA_TYPES;
private static final List<String> DATABASE_TYPES;
private static final List<String> SUBCOMMANDS = ImmutableList.of("database", "experience");
private final CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand();
private final CommandExecutor experienceConvertCommand = new ConvertExperienceCommand();
private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand();
private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand();
static {
ArrayList<String> formulaTypes = new ArrayList<>();
ArrayList<String> databaseTypes = new ArrayList<>();
ArrayList<String> formulaTypes = new ArrayList<String>();
ArrayList<String> databaseTypes = new ArrayList<String>();
for (FormulaType type : FormulaType.values()) {
formulaTypes.add(type.toString());
@ -54,31 +55,34 @@ public class McconvertCommand implements TabExecutor {
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 2) {
if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) {
return databaseConvertCommand.onCommand(sender, command, label, args);
} else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) {
return experienceConvertCommand.onCommand(sender, command, label, args);
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) {
return databaseConvertCommand.onCommand(sender, command, label, args);
}
else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) {
return experienceConvertCommand.onCommand(sender, command, label, args);
}
return false;
return false;
default:
return false;
}
return false;
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<>(SUBCOMMANDS.size()));
return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<String>(SUBCOMMANDS.size()));
case 2:
if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) {
return StringUtil.copyPartialMatches(args[0], DATABASE_TYPES, new ArrayList<>(DATABASE_TYPES.size()));
return StringUtil.copyPartialMatches(args[0], DATABASE_TYPES, new ArrayList<String>(DATABASE_TYPES.size()));
}
if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[0].equalsIgnoreCase("exp")) {
return StringUtil.copyPartialMatches(args[0], FORMULA_TYPES, new ArrayList<>(FORMULA_TYPES.size()));
return StringUtil.copyPartialMatches(args[0], FORMULA_TYPES, new ArrayList<String>(FORMULA_TYPES.size()));
}
return ImmutableList.of();

View File

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

View File

@ -1,18 +1,19 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class McmmoCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (!Permissions.mcmmoDescription(sender)) {
@ -23,18 +24,17 @@ public class McmmoCommand implements CommandExecutor {
String description = LocaleLoader.getString("mcMMO.Description");
String[] mcSplit = description.split(",");
sender.sendMessage(mcSplit);
sender.sendMessage(LocaleLoader.getString("mcMMO.Description.FormerDevs"));
if (mcMMO.p.getGeneralConfig().getDonateMessageEnabled()) {
if (Config.getInstance().getDonateMessageEnabled()) {
sender.sendMessage(LocaleLoader.getString("MOTD.Donate"));
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "nossr50@gmail.com" + ChatColor.GOLD + " Paypal");
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "gjmcferrin@gmail.com" + ChatColor.GOLD + " Paypal");
}
if (Permissions.showversion(sender)) {
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
}
// mcMMO.getHolidayManager().anniversaryCheck(sender);
mcMMO.getHolidayManager().anniversaryCheck(sender);
return true;
case 1:
@ -71,10 +71,6 @@ public class McmmoCommand implements CommandExecutor {
}
private void displayOtherCommands(CommandSender sender) {
//Don't show them this category if they have none of the permissions
if (!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender))
return;
sender.sendMessage(LocaleLoader.getString("Commands.Other"));
if (Permissions.skillreset(sender)) {

View File

@ -1,43 +1,36 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public class McnotifyCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
if (args.length == 0) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
//Not Loaded yet
if (mcMMOPlayer == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
mcMMOPlayer.toggleChatNotifications();
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
mcMMOPlayer.toggleChatNotifications();
return true;
default:
return false;
}
return false;
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

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

View File

@ -1,38 +1,29 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.google.common.collect.ImmutableList;
public class McscoreboardCommand implements TabExecutor {
private static final List<String> FIRST_ARGS = ImmutableList.of("keep", "time", "clear");
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
if (!mcMMO.p.getGeneralConfig().getScoreboardsEnabled()) {
sender.sendMessage(LocaleLoader.getString("Scoreboard.Disabled"));
return true;
}
if (!ScoreboardManager.isPlayerBoardSetup(sender.getName())) {
sender.sendMessage(LocaleLoader.getString("Scoreboard.NotSetupYet"));
return true;
}
switch (args.length) {
case 1:
if (args[0].equalsIgnoreCase("clear") || args[0].equalsIgnoreCase("reset")) {
@ -42,7 +33,7 @@ public class McscoreboardCommand implements TabExecutor {
}
if (args[0].equalsIgnoreCase("keep")) {
if (!mcMMO.p.getGeneralConfig().getAllowKeepBoard() || !mcMMO.p.getGeneralConfig().getScoreboardsEnabled()) {
if (!Config.getInstance().getAllowKeepBoard()) {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true;
}
@ -80,11 +71,13 @@ public class McscoreboardCommand implements TabExecutor {
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
if (args.length == 1) {
return StringUtil.copyPartialMatches(args[0], FIRST_ARGS, new ArrayList<>(FIRST_ARGS.size()));
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], FIRST_ARGS, new ArrayList<String>(FIRST_ARGS.size()));
default:
return ImmutableList.of();
}
return ImmutableList.of();
}
private boolean help(CommandSender sender) {

View File

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

View File

@ -1,21 +1,22 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public abstract class ToggleCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (CommandUtils.noConsoleUsage(sender)) {
@ -27,10 +28,6 @@ public abstract class ToggleCommand implements TabExecutor {
return true;
}
if (!CommandUtils.hasPlayerDataKey(sender)) {
return true;
}
applyCommandAction(UserManager.getPlayer(sender.getName()));
return true;
@ -61,12 +58,14 @@ public abstract class ToggleCommand implements TabExecutor {
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
if (args.length == 1) {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();
}
return ImmutableList.of();
}
protected abstract boolean hasOtherPermission(CommandSender sender);

View File

@ -1,32 +1,30 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.notifications.SensitiveCommandType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.text.StringUtils;
import com.google.common.collect.ImmutableList;
import org.bukkit.ChatColor;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.google.common.collect.ImmutableList;
public class XprateCommand implements TabExecutor {
private final double ORIGINAL_XP_RATE = ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier();
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) {
if (!args[0].equalsIgnoreCase("reset")) {
return false;
}
@ -36,22 +34,7 @@ public class XprateCommand implements TabExecutor {
}
if (mcMMO.p.isXPEventEnabled()) {
if (mcMMO.p.getAdvancedConfig().useTitlesForXPEvent()) {
NotificationManager.broadcastTitle(mcMMO.p.getServer(),
LocaleLoader.getString("Commands.Event.Stop"),
LocaleLoader.getString("Commands.Event.Stop.Subtitle"),
10, 10*20, 20);
}
if (mcMMO.p.getGeneralConfig().broadcastEventMessages()) {
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop.Subtitle"));
}
//Admin notification
NotificationManager.processSensitiveCommandNotification(sender, SensitiveCommandType.XPRATE_END);
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.over"));
mcMMO.p.toggleXpEventEnabled();
}
@ -70,36 +53,25 @@ public class XprateCommand implements TabExecutor {
if (CommandUtils.shouldDisableToggle(args[1])) {
mcMMO.p.setXPEventEnabled(false);
} else if (CommandUtils.shouldEnableToggle(args[1])) {
}
else if (CommandUtils.shouldEnableToggle(args[1])) {
mcMMO.p.setXPEventEnabled(true);
} else {
}
else {
return false;
}
int newXpRate = Integer.parseInt(args[0]);
if (newXpRate < 0) {
sender.sendMessage(ChatColor.RED+LocaleLoader.getString("Commands.NegativeNumberWarn"));
return true;
}
ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate);
if (mcMMO.p.getAdvancedConfig().useTitlesForXPEvent()) {
NotificationManager.broadcastTitle(mcMMO.p.getServer(),
LocaleLoader.getString("Commands.Event.Start"),
LocaleLoader.getString("Commands.Event.XP", newXpRate),
10, 10*20, 20);
if (mcMMO.p.isXPEventEnabled()) {
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.0"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.1", newXpRate));
}
if (mcMMO.p.getGeneralConfig().broadcastEventMessages()) {
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate));
else {
sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate));
}
//Admin notification
NotificationManager.processSensitiveCommandNotification(sender, SensitiveCommandType.XPRATE_MODIFY, String.valueOf(newXpRate));
return true;
default:
@ -108,16 +80,16 @@ public class XprateCommand implements TabExecutor {
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
if (StringUtils.isInt(args[0])) {
return ImmutableList.of();
}
return StringUtil.copyPartialMatches(args[0], CommandUtils.RESET_OPTIONS, new ArrayList<>(CommandUtils.RESET_OPTIONS.size()));
return StringUtil.copyPartialMatches(args[0], CommandUtils.RESET_OPTIONS, new ArrayList<String>(CommandUtils.RESET_OPTIONS.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
return StringUtil.copyPartialMatches(args[1], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
default:
return ImmutableList.of();
}

View File

@ -1,28 +0,0 @@
package com.gmail.nossr50.commands.admin;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
public class CompatibilityCommand implements CommandExecutor {
/**
* Executes the given command, returning its success.
* <br>
* If false is returned, then the "usage" plugin.yml entry for this command
* (if defined) will be sent to the player.
*
* @param commandSender Source of the command
* @param command Command which was executed
* @param s Alias of the command which was used
* @param strings Passed command arguments
* @return true if a valid command, otherwise false
*/
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
mcMMO.getCompatibilityManager().reportCompatibilityStatus(commandSender);
return true;
}
}

View File

@ -1,57 +0,0 @@
//package com.gmail.nossr50.commands.admin;
//
//import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
//import com.gmail.nossr50.datatypes.player.McMMOPlayer;
//import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
//import com.gmail.nossr50.datatypes.treasure.Rarity;
//import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.skills.fishing.FishingManager;
//import com.gmail.nossr50.util.player.UserManager;
//import org.bukkit.Location;
//import org.bukkit.command.Command;
//import org.bukkit.command.CommandExecutor;
//import org.bukkit.command.CommandSender;
//import org.bukkit.entity.Player;
//import org.jetbrains.annotations.NotNull;
//
//public class DropTreasureCommand implements CommandExecutor {
// @Override
// public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
// if (sender instanceof Player) {
// if (!sender.isOp()) {
// sender.sendMessage("This command is for Operators only");
// return false;
// }
//
// Player player = (Player) sender;
// Location location = player.getLocation();
// McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
//
// if (mmoPlayer == null) {
// //TODO: Localize
// player.sendMessage("Your player data is not loaded yet");
// return false;
// }
//
// if (args.length == 0) {
// mcMMO.p.getLogger().info(player.toString() +" is dropping all mcMMO treasures via admin command at location "+location.toString());
// for(Rarity rarity : FishingTreasureConfig.getInstance().fishingRewards.keySet()) {
// for(FishingTreasure fishingTreasure : FishingTreasureConfig.getInstance().fishingRewards.get(rarity)) {
// FishingManager fishingManager = mmoPlayer.getFishingManager();
// }
// }
// //TODO: impl
// } else {
// String targetTreasure = args[1];
//
// //Drop all treasures matching the name
// //TODO: impl
// }
//
// return true;
// } else {
// sender.sendMessage("No console support for this command");
// return false;
// }
// }
//}

View File

@ -1,29 +0,0 @@
package com.gmail.nossr50.commands.admin;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
/**
* @author Mark Vainomaa
*/
public final class McmmoReloadLocaleCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 0) {
if (!Permissions.reloadlocale(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
LocaleLoader.reloadLocale();
sender.sendMessage(LocaleLoader.getString("Locale.Reloaded"));
return true;
}
return false;
}
}

View File

@ -1,26 +0,0 @@
package com.gmail.nossr50.commands.admin;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class PlayerDebugCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (sender instanceof Player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
mcMMOPlayer.toggleDebugMode(); //Toggle debug mode
NotificationManager.sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode()));
return true;
} else {
return false;
}
}
}

View File

@ -1,52 +1,16 @@
package com.gmail.nossr50.commands.chat;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Default;
import com.gmail.nossr50.commands.CommandManager;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import org.jetbrains.annotations.NotNull;
import org.bukkit.command.CommandSender;
@CommandPermission("mcmmo.chat.adminchat")
@CommandAlias("ac|a|adminchat|achat") //Kept for historical reasons
public class AdminChatCommand extends BaseCommand {
private final @NotNull mcMMO pluginRef;
import com.gmail.nossr50.datatypes.chat.ChatMode;
public AdminChatCommand(@NotNull mcMMO pluginRef) {
this.pluginRef = pluginRef;
public class AdminChatCommand extends ChatCommand {
public AdminChatCommand() {
super(ChatMode.ADMIN);
}
@Default @Conditions(CommandManager.ADMIN_CONDITION)
public void processCommand(String[] args) {
BukkitCommandIssuer bukkitCommandIssuer = (BukkitCommandIssuer) getCurrentCommandIssuer();
if (args == null || args.length == 0) {
//Process with no arguments
if (bukkitCommandIssuer.isPlayer()) {
McMMOPlayer mmoPlayer = UserManager.getPlayer(bukkitCommandIssuer.getPlayer());
pluginRef.getChatManager().setOrToggleChatChannel(mmoPlayer, ChatChannel.ADMIN);
} else {
//Not support for console
mcMMO.p.getLogger().info("You cannot switch chat channels as console, please provide full arguments.");
}
} else {
if (bukkitCommandIssuer.isPlayer()) {
McMMOPlayer mmoPlayer = UserManager.getPlayer(bukkitCommandIssuer.getPlayer());
if (mmoPlayer == null)
return;
//Message contains the original command so it needs to be passed to this method to trim it
pluginRef.getChatManager().processPlayerMessage(mmoPlayer, args, ChatChannel.ADMIN);
} else {
pluginRef.getChatManager().processConsoleMessage(args);
}
//Arguments are greater than 0, therefore directly send message and skip toggles
}
@Override
protected void handleChatSending(CommandSender sender, String[] args) {
chatManager.handleChat(sender.getName(), getDisplayName(sender), buildChatMessage(args, 0));
}
}

View File

@ -0,0 +1,134 @@
package com.gmail.nossr50.commands.chat;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.chat.ChatManager;
import com.gmail.nossr50.chat.ChatManagerFactory;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public abstract class ChatCommand implements TabExecutor {
private ChatMode chatMode;
protected ChatManager chatManager;
public ChatCommand(ChatMode chatMode) {
this.chatMode = chatMode;
this.chatManager = ChatManagerFactory.getChatManager(mcMMO.p, chatMode);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
McMMOPlayer mcMMOPlayer;
switch (args.length) {
case 0:
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
mcMMOPlayer = UserManager.getPlayer(sender.getName());
if (mcMMOPlayer.isChatEnabled(chatMode)) {
disableChatMode(mcMMOPlayer, sender);
}
else {
enableChatMode(mcMMOPlayer, sender);
}
return true;
case 1:
if (CommandUtils.shouldEnableToggle(args[0])) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
enableChatMode(UserManager.getPlayer(sender.getName()), sender);
return true;
}
if (CommandUtils.shouldDisableToggle(args[0])) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
disableChatMode(UserManager.getPlayer(sender.getName()), sender);
return true;
}
// Fallthrough
default:
handleChatSending(sender, args);
return true;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
default:
return ImmutableList.of();
}
}
protected String buildChatMessage(String[] args, int index) {
StringBuilder builder = new StringBuilder();
builder.append(args[index]);
for (int i = index + 1; i < args.length; i++) {
builder.append(" ");
builder.append(args[i]);
}
return builder.toString();
}
protected String getDisplayName(CommandSender sender) {
return (sender instanceof Player) ? ((Player) sender).getDisplayName() : LocaleLoader.getString("Commands.Chat.Console");
}
protected abstract void handleChatSending(CommandSender sender, String[] args);
private void enableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
return;
}
if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
return;
}
mcMMOPlayer.enableChat(chatMode);
sender.sendMessage(chatMode.getEnabledMessage());
}
private void disableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
return;
}
mcMMOPlayer.disableChat(chatMode);
sender.sendMessage(chatMode.getDisabledMessage());
}
}

View File

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

View File

@ -1,89 +1,59 @@
package com.gmail.nossr50.commands.chat;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Default;
import com.gmail.nossr50.commands.CommandManager;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.text.StringUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@CommandPermission("mcmmo.chat.partychat")
@CommandAlias("pc|p|partychat|pchat") //Kept for historical reasons
public class PartyChatCommand extends BaseCommand {
private final @NotNull mcMMO pluginRef;
import com.gmail.nossr50.chat.PartyChatManager;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
public PartyChatCommand(@NotNull mcMMO pluginRef) {
this.pluginRef = pluginRef;
public class PartyChatCommand extends ChatCommand {
public PartyChatCommand() {
super(ChatMode.PARTY);
}
@Default
@Conditions(CommandManager.PARTY_CONDITION)
public void processCommand(String[] args) {
BukkitCommandIssuer bukkitCommandIssuer = (BukkitCommandIssuer) getCurrentCommandIssuer();
@Override
protected void handleChatSending(CommandSender sender, String[] args) {
Party party;
String message;
if (args == null || args.length == 0) {
//Process with no arguments
if (bukkitCommandIssuer.isPlayer()) {
McMMOPlayer mmoPlayer = UserManager.getPlayer(bukkitCommandIssuer.getPlayer());
pluginRef.getChatManager().setOrToggleChatChannel(mmoPlayer, ChatChannel.PARTY);
} else {
//Not support for console
mcMMO.p.getLogger().info("You cannot switch chat channels as console, please provide full arguments.");
}
} else {
//Here we split the logic, consoles need to target a party name and players do not
if (sender instanceof Player) {
party = UserManager.getPlayer((Player) sender).getParty();
/*
* Player Logic
*/
if (bukkitCommandIssuer.getIssuer() instanceof Player) {
McMMOPlayer mmoPlayer = UserManager.getPlayer(bukkitCommandIssuer.getPlayer());
processCommandArgsPlayer(mmoPlayer, args);
/*
* Console Logic
*/
} else {
processCommandArgsConsole(args);
if (party == null) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
return;
}
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) {
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
return;
}
message = buildChatMessage(args, 0);
}
}
/**
* Processes the command with arguments for a {@link McMMOPlayer}
* @param mmoPlayer target player
* @param args command arguments
*/
private void processCommandArgsPlayer(@NotNull McMMOPlayer mmoPlayer, @NotNull String[] args) {
//Player is not toggling and is chatting directly to party
pluginRef.getChatManager().processPlayerMessage(mmoPlayer, args, ChatChannel.PARTY);
}
/**
* Processes the command with arguments for a {@link com.gmail.nossr50.chat.author.ConsoleAuthor}
* @param args command arguments
*/
private void processCommandArgsConsole(@NotNull String[] args) {
if (args.length <= 1) {
//Only specific a party and not the message
mcMMO.p.getLogger().severe("You need to specify a party name and then write a message afterwards.");
} else {
//Grab party
Party targetParty = mcMMO.p.getPartyManager().getParty(args[0]);
if (targetParty != null) {
pluginRef.getChatManager().processConsoleMessage(StringUtils.buildStringAfterNthElement(args, 1), targetParty);
} else {
mcMMO.p.getLogger().severe("A party with that name doesn't exist!");
else {
if (args.length < 2) {
sender.sendMessage(LocaleLoader.getString("Party.Specify"));
return;
}
party = PartyManager.getParty(args[0]);
if (party == null) {
sender.sendMessage(LocaleLoader.getString("Party.InvalidName"));
return;
}
message = buildChatMessage(args, 1);
}
((PartyChatManager) chatManager).setParty(party);
chatManager.handleChat(sender.getName(), getDisplayName(sender), message);
}
}

View File

@ -1,75 +1,74 @@
package com.gmail.nossr50.commands.database;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.database.DatabaseConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class ConvertDatabaseCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 2) {
DatabaseType previousType = DatabaseType.getDatabaseType(args[1]);
DatabaseType newType = mcMMO.getDatabaseManager().getDatabaseType();
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
DatabaseType previousType = DatabaseType.getDatabaseType(args[1]);
DatabaseType newType = mcMMO.getDatabaseManager().getDatabaseType();
if (previousType == newType || (newType == DatabaseType.CUSTOM && DatabaseManagerFactory.getCustomDatabaseManagerClass().getSimpleName().equalsIgnoreCase(args[1]))) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Same", newType.toString()));
return true;
}
if (previousType == newType || (newType == DatabaseType.CUSTOM && DatabaseManagerFactory.getCustomDatabaseManagerClass().getSimpleName().equalsIgnoreCase(args[1]))) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Same", newType.toString()));
return true;
}
DatabaseManager oldDatabase = DatabaseManagerFactory.createDatabaseManager(previousType, mcMMO.getUsersFilePath(), mcMMO.p.getLogger(), mcMMO.p.getPurgeTime(), mcMMO.p.getAdvancedConfig().getStartingLevel());
if (oldDatabase == null) {
sender.sendMessage("Unable to load the old database! Check your log for errors.");
return true;
}
DatabaseManager oldDatabase = DatabaseManagerFactory.createDatabaseManager(previousType);
if (previousType == DatabaseType.CUSTOM) {
Class<?> clazz;
if (previousType == DatabaseType.CUSTOM) {
Class<?> clazz;
try {
clazz = Class.forName(args[1]);
try {
clazz = Class.forName(args[1]);
if (!DatabaseManager.class.isAssignableFrom(clazz)) {
if (!DatabaseManager.class.isAssignableFrom(clazz)) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1]));
return true;
}
oldDatabase = DatabaseManagerFactory.createCustomDatabaseManager((Class<? extends DatabaseManager>) clazz);
}
catch (Throwable e) {
e.printStackTrace();
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1]));
return true;
}
oldDatabase = DatabaseManagerFactory.createCustomDatabaseManager((Class<? extends DatabaseManager>) clazz);
} catch (Throwable e) {
e.printStackTrace();
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1]));
return true;
}
}
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Start", previousType.toString(), newType.toString()));
UserManager.saveAll();
UserManager.clearAll();
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
PlayerProfile profile = oldDatabase.loadPlayerProfile(player);
if (profile.isLoaded()) {
mcMMO.getDatabaseManager().saveUser(profile);
}
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Start", previousType.toString(), newType.toString()));
mcMMO.p.getFoliaLib().getScheduler().runAsync(new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()));
return true;
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);
return true;
default:
return false;
}
return false;
}
}

View File

@ -1,33 +1,38 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.google.common.collect.ImmutableList;
public class McpurgeCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 0) {
mcMMO.getDatabaseManager().purgePowerlessUsers();
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
mcMMO.getDatabaseManager().purgePowerlessUsers();
if (mcMMO.p.getGeneralConfig().getOldUsersCutoff() != -1) {
mcMMO.getDatabaseManager().purgeOldUsers();
}
if (Config.getInstance().getOldUsersCutoff() != -1) {
mcMMO.getDatabaseManager().purgeOldUsers();
}
sender.sendMessage(LocaleLoader.getString("Commands.mcpurge.Success"));
return true;
sender.sendMessage(LocaleLoader.getString("Commands.mcpurge.Success"));
return true;
default:
return false;
}
return false;
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@ -1,54 +1,53 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import org.bukkit.Bukkit;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public class McremoveCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 1) {
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
if (UserManager.getOfflinePlayer(playerName) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
return true;
}
if (mcMMO.getDatabaseManager().removeUser(playerName)) {
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", playerName));
}
else {
sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen.
}
if (UserManager.getOfflinePlayer(playerName) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName))) {
return true;
}
UUID uuid = null;
if (Bukkit.getPlayer(playerName) != null) {
uuid = Bukkit.getPlayer(playerName).getUniqueId();
}
if (mcMMO.getDatabaseManager().removeUser(playerName, uuid)) {
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", playerName));
} else {
sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen.
}
return true;
default:
return false;
}
return false;
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
if (args.length == 1) {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
default:
return ImmutableList.of();
}
return ImmutableList.of();
}
}

View File

@ -1,35 +1,39 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.locale.LocaleLoader;
import com.google.common.collect.ImmutableList;
public class MmoshowdbCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 0) {
Class<?> clazz = DatabaseManagerFactory.getCustomDatabaseManagerClass();
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
Class<?> clazz = DatabaseManagerFactory.getCustomDatabaseManagerClass();
if (clazz != null) {
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", clazz.getName()));
if (clazz != null) {
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", clazz.getName()));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (Config.getInstance().getUseMySQL() ? "sql" : "flatfile")));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (mcMMO.p.getGeneralConfig().getUseMySQL() ? "sql" : "flatfile")));
return true;
default:
return false;
}
return false;
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@ -1,17 +1,14 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
public class AddlevelsCommand extends ExperienceCommand {
@Override
protected boolean permissionsCheckSelf(CommandSender sender) {
@ -24,38 +21,25 @@ public class AddlevelsCommand extends ExperienceCommand {
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
float xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.addLevels(skill, value);
if (player == null) {
profile.scheduleAsyncSave();
profile.save();
return;
}
McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
if (mmoPlayer == null) {
EventUtils.tryLevelChangeEvent(player, skill, value, xpRemoved, true, XPGainReason.COMMAND);
} else {
EventUtils.tryLevelChangeEvent(mmoPlayer, skill, value, xpRemoved, true, XPGainReason.COMMAND);
}
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, true);
}
@Override
protected void handlePlayerMessageAll(Player player, int value, boolean isSilent) {
if (isSilent)
return;
protected void handlePlayerMessageAll(Player player, int value) {
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", value));
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill, boolean isSilent) {
if (isSilent)
return;
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, mcMMO.p.getSkillTools().getLocalizedSkillName(skill)));
protected void handlePlayerMessageSkill(Player player, int value, SkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, skill.getName()));
}
}

View File

@ -1,16 +1,14 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
public class AddxpCommand extends ExperienceCommand {
@Override
protected boolean permissionsCheckSelf(CommandSender sender) {
@ -23,32 +21,23 @@ public class AddxpCommand extends ExperienceCommand {
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
if (player != null) {
//Check if player profile is loaded
if (UserManager.getPlayer(player) == null)
return;
UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND);
} else {
UserManager.getPlayer(player).applyXpGain(skill, value);
}
else {
profile.addXp(skill, value);
profile.scheduleAsyncSave();
profile.save();
}
}
@Override
protected void handlePlayerMessageAll(Player player, int value, boolean isSilent) {
if (isSilent)
return;
protected void handlePlayerMessageAll(Player player, int value) {
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", value));
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill, boolean isSilent) {
if (isSilent)
return;
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, mcMMO.p.getSkillTools().getLocalizedSkillName(skill)));
protected void handlePlayerMessageSkill(Player player, int value, SkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, skill.getName()));
}
}

View File

@ -1,49 +1,49 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.database.FormulaConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.Locale;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.database.FormulaConversionTask;
import com.gmail.nossr50.util.player.UserManager;
public class ConvertExperienceCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 2) {
FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType();
FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase(Locale.ENGLISH));
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType();
FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase());
if (newType == FormulaType.UNKNOWN) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid"));
return true;
}
if (previousType == newType) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Same", newType.toString()));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Start", previousType.toString(), newType.toString()));
UserManager.saveAll();
UserManager.clearAll();
new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1);
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
UserManager.addUser(player);
}
if (newType == FormulaType.UNKNOWN) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid"));
return true;
}
if (previousType == newType) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Same", newType.toString()));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Start", previousType.toString(), newType.toString()));
UserManager.saveAll();
UserManager.clearAll();
mcMMO.p.getFoliaLib().getScheduler().runLater(new FormulaConversionTask(sender, newType), 1);
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
return true;
default:
return false;
}
return false;
}
}

View File

@ -1,41 +1,37 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillTools;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
public abstract class ExperienceCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
PrimarySkillType skill;
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
SkillType skill;
if (args.length < 2) {
return false;
} else {
if (args.length == 2 && !isSilent(args) || args.length == 3 && isSilent(args)) {
switch (args.length) {
case 2:
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
if (!permissionsCheckSelf(sender)) {
if (command.getPermissionMessage() != null)
sender.sendMessage(command.getPermissionMessage());
sender.sendMessage("(mcMMO) No permission!");
sender.sendMessage(command.getPermissionMessage());
return true;
}
@ -43,28 +39,16 @@ public abstract class ExperienceCommand implements TabExecutor {
return true;
}
skill = mcMMO.p.getSkillTools().matchSkill(args[0]);
skill = SkillType.getSkill(args[0]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
if (skill != null && SkillTools.isChildSkill(skill)) {
sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill"));
return true;
}
//Profile not loaded
if (UserManager.getPlayer(sender.getName()) == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]), isSilent(args));
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]));
return true;
} else if ((args.length == 3 && !isSilent(args))
|| (args.length == 4 && isSilent(args))) {
case 3:
if (!permissionsCheckOthers(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
@ -74,17 +58,12 @@ public abstract class ExperienceCommand implements TabExecutor {
return true;
}
skill = mcMMO.p.getSkillTools().matchSkill(args[1]);
skill = SkillType.getSkill(args[1]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
if (skill != null && SkillTools.isChildSkill(skill)) {
sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill"));
return true;
}
int value = Integer.parseInt(args[2]);
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
@ -92,51 +71,34 @@ public abstract class ExperienceCommand implements TabExecutor {
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
PlayerProfile profile;
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false);
profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName);
//Check loading by UUID
if (CommandUtils.unloadedProfile(sender, profile)) {
//Check loading by name
profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName);
if (CommandUtils.unloadedProfile(sender, profile)) {
return true;
}
return true;
}
editValues(null, profile, skill, value, isSilent(args));
} else {
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, value, isSilent(args));
editValues(null, profile, skill, value);
}
else {
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, value);
}
handleSenderMessage(sender, playerName, skill);
return true;
} else {
default:
return false;
}
}
}
private boolean isSilent(String[] args) {
int length = args.length;
if (length == 0)
return false;
return args[length-1].equalsIgnoreCase("-s");
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], mcMMO.p.getSkillTools().LOCALIZED_SKILL_NAMES, new ArrayList<>(mcMMO.p.getSkillTools().LOCALIZED_SKILL_NAMES.size()));
return StringUtil.copyPartialMatches(args[1], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
@ -144,36 +106,38 @@ public abstract class ExperienceCommand implements TabExecutor {
protected abstract boolean permissionsCheckSelf(CommandSender sender);
protected abstract boolean permissionsCheckOthers(CommandSender sender);
protected abstract void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value);
protected abstract void handlePlayerMessageAll(Player player, int value, boolean isSilent);
protected abstract void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill, boolean isSilent);
protected abstract void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value);
protected abstract void handlePlayerMessageAll(Player player, int value);
protected abstract void handlePlayerMessageSkill(Player player, int value, SkillType skill);
private boolean validateArguments(CommandSender sender, String skillName, String value) {
return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName)));
}
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
if (skill == null) {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
} else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", mcMMO.p.getSkillTools().getLocalizedSkillName(skill), playerName));
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
}
}
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill, int value, boolean isSilent) {
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
if (skill == null) {
for (PrimarySkillType primarySkillType : SkillTools.NON_CHILD_SKILLS) {
handleCommand(player, profile, primarySkillType, value);
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, skillType, value);
}
if (player != null) {
handlePlayerMessageAll(player, value, isSilent);
handlePlayerMessageAll(player, value);
}
} else {
}
else {
handleCommand(player, profile, skill, value);
if (player != null) {
handlePlayerMessageSkill(player, value, skill, isSilent);
handlePlayerMessageSkill(player, value, skill);
}
}
}

View File

@ -1,17 +1,14 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
public class MmoeditCommand extends ExperienceCommand {
@Override
protected boolean permissionsCheckSelf(CommandSender sender) {
@ -24,14 +21,14 @@ public class MmoeditCommand extends ExperienceCommand {
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
int skillLevel = profile.getSkillLevel(skill);
float xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.modifySkill(skill, value);
if (player == null) {
profile.scheduleAsyncSave();
profile.save();
return;
}
@ -39,29 +36,16 @@ public class MmoeditCommand extends ExperienceCommand {
return;
}
McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
if (mmoPlayer != null) {
EventUtils.tryLevelEditEvent(mmoPlayer, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND, skillLevel);
} else {
EventUtils.tryLevelEditEvent(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND, skillLevel);
}
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, value > skillLevel);
}
@Override
protected void handlePlayerMessageAll(Player player, int value, boolean isSilent) {
if (isSilent)
return;
protected void handlePlayerMessageAll(Player player, int value) {
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.AllSkills.1", value));
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill, boolean isSilent) {
if (isSilent)
return;
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", mcMMO.p.getSkillTools().getLocalizedSkillName(skill), value));
protected void handlePlayerMessageSkill(Player player, int value, SkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", skill.getName(), value));
}
}

View File

@ -1,27 +1,25 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillTools;
import com.google.common.collect.ImmutableList;
import org.bukkit.OfflinePlayer;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
/**
* This class mirrors the structure of ExperienceCommand, except the
@ -29,8 +27,7 @@ import java.util.List;
*/
public class SkillresetCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
PrimarySkillType skill;
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if (CommandUtils.noConsoleUsage(sender)) {
@ -46,13 +43,7 @@ public class SkillresetCommand implements TabExecutor {
return true;
}
if (args[0].equalsIgnoreCase("all")) {
skill = null;
} else {
skill = mcMMO.p.getSkillTools().matchSkill(args[0]);
}
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill);
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]));
return true;
case 2:
@ -65,10 +56,12 @@ public class SkillresetCommand implements TabExecutor {
return true;
}
SkillType skill;
if (args[1].equalsIgnoreCase("all")) {
skill = null;
} else {
skill = mcMMO.p.getSkillTools().matchSkill(args[1]);
}
else {
skill = SkillType.getSkill(args[1]);
}
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
@ -76,22 +69,15 @@ public class SkillresetCommand implements TabExecutor {
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
OfflinePlayer offlinePlayer = mcMMO.p.getServer().getOfflinePlayer(playerName);
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(offlinePlayer);
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false);
//Check loading by UUID
if (CommandUtils.unloadedProfile(sender, profile)) {
//Didn't find it by UUID so try to find it by name
profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName);
//Check if it was present in DB
if (CommandUtils.unloadedProfile(sender, profile)) {
return true;
}
return true;
}
editValues(null, profile, skill);
} else {
}
else {
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill);
}
@ -104,30 +90,30 @@ public class SkillresetCommand implements TabExecutor {
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], mcMMO.p.getSkillTools().LOCALIZED_SKILL_NAMES, new ArrayList<>(mcMMO.p.getSkillTools().LOCALIZED_SKILL_NAMES.size()));
return StringUtil.copyPartialMatches(args[1], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill) {
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill) {
int levelsRemoved = profile.getSkillLevel(skill);
float xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.modifySkill(skill, 0);
if (player == null) {
profile.scheduleAsyncSave();
profile.save();
return;
}
EventUtils.tryLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false, XPGainReason.COMMAND);
EventUtils.handleLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false);
}
protected boolean permissionsCheckSelf(CommandSender sender) {
@ -142,32 +128,34 @@ public class SkillresetCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Commands.Reset.All"));
}
protected void handlePlayerMessageSkill(Player player, PrimarySkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", mcMMO.p.getSkillTools().getLocalizedSkillName(skill)));
protected void handlePlayerMessageSkill(Player player, SkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
}
private boolean validateArguments(CommandSender sender, String skillName) {
return skillName.equalsIgnoreCase("all") || !CommandUtils.isInvalidSkill(sender, skillName);
return !(CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all"));
}
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
if (skill == null) {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
} else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", mcMMO.p.getSkillTools().getLocalizedSkillName(skill), playerName));
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
}
}
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill) {
protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
if (skill == null) {
for (PrimarySkillType primarySkillType : SkillTools.NON_CHILD_SKILLS) {
handleCommand(player, profile, primarySkillType);
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
handleCommand(player, profile, skillType);
}
if (player != null) {
handlePlayerMessageAll(player);
}
} else {
}
else {
handleCommand(player, profile, skill);
if (player != null) {

View File

@ -1,64 +1,65 @@
//package com.gmail.nossr50.commands.hardcore;
//
//import com.gmail.nossr50.config.Config;
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.locale.LocaleLoader;
//import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.util.Permissions;
//import org.bukkit.command.CommandSender;
//
//public class HardcoreCommand extends HardcoreModeCommand {
// @Override
// protected boolean checkTogglePermissions(CommandSender sender) {
// return Permissions.hardcoreToggle(sender);
// }
//
// @Override
// protected boolean checkModifyPermissions(CommandSender sender) {
// return Permissions.hardcoreModify(sender);
// }
//
// @Override
// protected boolean checkEnabled(PrimarySkillType skill) {
// if (skill == null) {
// for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
// if (!primarySkillType.getHardcoreStatLossEnabled()) {
// return false;
// }
// }
//
// return true;
// }
//
// return skill.getHardcoreStatLossEnabled();
// }
//
// @Override
// protected void enable(PrimarySkillType skill) {
// toggle(true, skill);
// }
//
// @Override
// protected void disable(PrimarySkillType skill) {
// toggle(false, skill);
// }
//
// @Override
// protected void modify(CommandSender sender, double newPercentage) {
// Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage);
// sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
// }
//
// private void toggle(boolean enable, PrimarySkillType skill) {
// if (skill == null) {
// for (PrimarySkillType primarySkillType : SkillTools.NON_CHILD_SKILLS) {
// primarySkillType.setHardcoreStatLossEnabled(enable);
// }
// }
// else {
// skill.setHardcoreStatLossEnabled(enable);
// }
//
// mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : mcMMO.p.getSkillTools().getLocalizedSkillName(skill))));
// }
//}
package com.gmail.nossr50.commands.hardcore;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class HardcoreCommand extends HardcoreModeCommand {
@Override
protected boolean checkTogglePermissions(CommandSender sender) {
return Permissions.hardcoreToggle(sender);
}
@Override
protected boolean checkModifyPermissions(CommandSender sender) {
return Permissions.hardcoreModify(sender);
}
@Override
protected boolean checkEnabled(SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.values()) {
if (!skillType.getHardcoreStatLossEnabled()) {
return false;
}
}
return true;
}
return skill.getHardcoreStatLossEnabled();
}
@Override
protected void enable(SkillType skill) {
toggle(true, skill);
}
@Override
protected void disable(SkillType skill) {
toggle(false, skill);
}
@Override
protected void modify(CommandSender sender, double newPercentage) {
Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage);
sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
}
private void toggle(boolean enable, SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
skillType.setHardcoreStatLossEnabled(enable);
}
}
else {
skill.setHardcoreStatLossEnabled(enable);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName())));
}
}

View File

@ -1,129 +1,132 @@
//package com.gmail.nossr50.commands.hardcore;
//
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.util.Permissions;
//import com.gmail.nossr50.util.commands.CommandUtils;
//import com.gmail.nossr50.util.text.StringUtils;
//import com.google.common.collect.ImmutableList;
//import org.bukkit.command.Command;
//import org.bukkit.command.CommandSender;
//import org.bukkit.command.TabExecutor;
//import org.bukkit.util.StringUtil;
//import org.jetbrains.annotations.NotNull;
//
//import java.text.DecimalFormat;
//import java.util.ArrayList;
//import java.util.List;
//
//public abstract class HardcoreModeCommand implements TabExecutor {
// protected final DecimalFormat percent = new DecimalFormat("##0.00%");
//
// @Override
// public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
// switch (args.length) {
// case 0:
// if (!checkTogglePermissions(sender)) {
// sender.sendMessage(command.getPermissionMessage());
// return true;
// }
//
// if (checkEnabled(null)) {
// disable(null);
// }
// else {
// enable(null);
// }
//
// return true;
//
// case 1:
// if (CommandUtils.shouldEnableToggle(args[0])) {
// if (!Permissions.hardcoreToggle(sender)) {
// sender.sendMessage(command.getPermissionMessage());
// return true;
// }
//
// enable(null);
// return true;
// }
//
// if (CommandUtils.shouldDisableToggle(args[0])) {
// if (!Permissions.hardcoreToggle(sender)) {
// sender.sendMessage(command.getPermissionMessage());
// return true;
// }
//
// disable(null);
// return true;
// }
//
// if (CommandUtils.isInvalidDouble(sender, args[0])) {
// return true;
// }
//
// if (!Permissions.hardcoreModify(sender)) {
// sender.sendMessage(command.getPermissionMessage());
// return true;
// }
//
// modify(sender, Double.parseDouble(args[0]));
// return true;
//
//
// case 2:
// if (CommandUtils.isInvalidSkill(sender, args[0])) {
// return true;
// }
//
// PrimarySkillType skill = PrimarySkillType.getSkill(args[0]);
//
// if (!CommandUtils.isChildSkill(sender, skill)) {
// return true;
// }
//
// if (CommandUtils.shouldEnableToggle(args[1])) {
// if (!Permissions.hardcoreToggle(sender)) {
// sender.sendMessage(command.getPermissionMessage());
// return true;
// }
//
// enable(skill);
// return true;
// }
//
// if (CommandUtils.shouldDisableToggle(args[1])) {
// if (!Permissions.hardcoreToggle(sender)) {
// sender.sendMessage(command.getPermissionMessage());
// return true;
// }
//
// enable(skill);
// return true;
// }
//
// return true;
//
// default:
// return false;
// }
// }
//
// @Override
// public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
// if (args.length == 1) {
// if (StringUtils.isDouble(args[0])) {
// return ImmutableList.of();
// }
//
// return StringUtil.copyPartialMatches(args[0], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
// }
// return ImmutableList.of();
// }
//
// protected abstract boolean checkTogglePermissions(CommandSender sender);
// protected abstract boolean checkModifyPermissions(CommandSender sender);
// protected abstract boolean checkEnabled(PrimarySkillType skill);
// protected abstract void enable(PrimarySkillType skill);
// protected abstract void disable(PrimarySkillType skill);
// protected abstract void modify(CommandSender sender, double newPercentage);
//}
package com.gmail.nossr50.commands.hardcore;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.google.common.collect.ImmutableList;
public abstract class HardcoreModeCommand implements TabExecutor {
protected final DecimalFormat percent = new DecimalFormat("##0.00%");
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (!checkTogglePermissions(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (checkEnabled(null)) {
disable(null);
}
else {
enable(null);
}
return true;
case 1:
if (CommandUtils.shouldEnableToggle(args[0])) {
if (!Permissions.hardcoreToggle(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
enable(null);
return true;
}
if (CommandUtils.shouldDisableToggle(args[0])) {
if (!Permissions.hardcoreToggle(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
disable(null);
return true;
}
if (CommandUtils.isInvalidDouble(sender, args[0])) {
return true;
}
if (!Permissions.hardcoreModify(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
modify(sender, Double.parseDouble(args[0]));
return true;
case 2:
if (CommandUtils.isInvalidSkill(sender, args[0])) {
return true;
}
SkillType skill = SkillType.getSkill(args[0]);
if (!CommandUtils.isChildSkill(sender, skill)) {
return true;
}
if (CommandUtils.shouldEnableToggle(args[1])) {
if (!Permissions.hardcoreToggle(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
enable(skill);
return true;
}
if (CommandUtils.shouldDisableToggle(args[1])) {
if (!Permissions.hardcoreToggle(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
enable(skill);
return true;
}
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
if (StringUtils.isDouble(args[0])) {
return ImmutableList.of();
}
return StringUtil.copyPartialMatches(args[0], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
default:
return ImmutableList.of();
}
}
protected abstract boolean checkTogglePermissions(CommandSender sender);
protected abstract boolean checkModifyPermissions(CommandSender sender);
protected abstract boolean checkEnabled(SkillType skill);
protected abstract void enable(SkillType skill);
protected abstract void disable(SkillType skill);
protected abstract void modify(CommandSender sender, double newPercentage);
}

View File

@ -1,64 +1,65 @@
//package com.gmail.nossr50.commands.hardcore;
//
//import com.gmail.nossr50.config.Config;
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.locale.LocaleLoader;
//import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.util.Permissions;
//import org.bukkit.command.CommandSender;
//
//public class VampirismCommand extends HardcoreModeCommand {
// @Override
// protected boolean checkTogglePermissions(CommandSender sender) {
// return Permissions.vampirismToggle(sender);
// }
//
// @Override
// protected boolean checkModifyPermissions(CommandSender sender) {
// return Permissions.vampirismModify(sender);
// }
//
// @Override
// protected boolean checkEnabled(PrimarySkillType skill) {
// if (skill == null) {
// for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
// if (!primarySkillType.getHardcoreVampirismEnabled()) {
// return false;
// }
// }
//
// return true;
// }
//
// return skill.getHardcoreVampirismEnabled();
// }
//
// @Override
// protected void enable(PrimarySkillType skill) {
// toggle(true, skill);
// }
//
// @Override
// protected void disable(PrimarySkillType skill) {
// toggle(false, skill);
// }
//
// @Override
// protected void modify(CommandSender sender, double newPercentage) {
// Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage);
// sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
// }
//
// private void toggle(boolean enable, PrimarySkillType skill) {
// if (skill == null) {
// for (PrimarySkillType primarySkillType : SkillTools.NON_CHILD_SKILLS) {
// primarySkillType.setHardcoreVampirismEnabled(enable);
// }
// }
// else {
// skill.setHardcoreVampirismEnabled(enable);
// }
//
// mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill)));
// }
//}
package com.gmail.nossr50.commands.hardcore;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class VampirismCommand extends HardcoreModeCommand {
@Override
protected boolean checkTogglePermissions(CommandSender sender) {
return Permissions.vampirismToggle(sender);
}
@Override
protected boolean checkModifyPermissions(CommandSender sender) {
return Permissions.vampirismModify(sender);
}
@Override
protected boolean checkEnabled(SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.values()) {
if (!skillType.getHardcoreVampirismEnabled()) {
return false;
}
}
return true;
}
return skill.getHardcoreVampirismEnabled();
}
@Override
protected void enable(SkillType skill) {
toggle(true, skill);
}
@Override
protected void disable(SkillType skill) {
toggle(false, skill);
}
@Override
protected void modify(CommandSender sender, double newPercentage) {
Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage);
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
}
private void toggle(boolean enable, SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
skillType.setHardcoreVampirismEnabled(enable);
}
}
else {
skill.setHardcoreVampirismEnabled(enable);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill)));
}
}

View File

@ -1,44 +1,39 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
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 PartyAcceptCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 1) {
Player player = (Player) sender;
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Check if player profile is loaded
if (UserManager.getPlayer(player) == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
if (!mcMMOPlayer.hasPartyInvite()) {
sender.sendMessage(LocaleLoader.getString("mcMMO.NoInvites"));
return true;
}
// Changing parties
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, mcMMOPlayer.getPartyInvite().getName())) {
return true;
}
PartyManager.joinInvitedParty(mcMMOPlayer);
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (!mcMMOPlayer.hasPartyInvite()) {
sender.sendMessage(LocaleLoader.getString("mcMMO.NoInvites"));
default:
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "accept"));
return true;
}
// Changing parties
if (!mcMMO.p.getPartyManager().changeOrJoinParty(mcMMOPlayer, mcMMOPlayer.getPartyInvite().getName())) {
return true;
}
mcMMO.p.getPartyManager().joinInvitedParty(mcMMOPlayer);
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "accept"));
return true;
}
}

View File

@ -1,39 +1,35 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
public class PartyChangeOwnerCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 2) {//Check if player profile is loaded
if (UserManager.getPlayer((Player) sender) == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
if (!playerParty.getMembers().contains(targetName)) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
return true;
}
PartyManager.setPartyLeader(targetName, playerParty);
return true;
}
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);
if (!playerParty.hasMember(target.getUniqueId())) {
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
default:
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "owner", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
return true;
}
mcMMO.p.getPartyManager().setPartyLeader(target.getUniqueId(), playerParty);
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "owner", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
return true;
}
}

View File

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

View File

@ -1,5 +1,19 @@
package com.gmail.nossr50.commands.party;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
import com.gmail.nossr50.datatypes.party.Party;
@ -8,61 +22,16 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.ImmutableList;
public class PartyCommand implements TabExecutor {
private final List<String> PARTY_SUBCOMMANDS;
private final List<String> XPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
private final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc");
private final CommandExecutor partyJoinCommand;
private final CommandExecutor partyAcceptCommand;
private final CommandExecutor partyCreateCommand;
private final CommandExecutor partyQuitCommand;
private final CommandExecutor partyXpShareCommand;
private final CommandExecutor partyItemShareCommand;
private final CommandExecutor partyInviteCommand;
private final CommandExecutor partyKickCommand;
private final CommandExecutor partyDisbandCommand;
private final CommandExecutor partyChangeOwnerCommand;
private final CommandExecutor partyLockCommand;
private final CommandExecutor partyChangePasswordCommand;
private final CommandExecutor partyRenameCommand;
private final CommandExecutor partyInfoCommand;
private final CommandExecutor partyHelpCommand;
private final CommandExecutor partyTeleportCommand;
private final CommandExecutor partyAllianceCommand;
public PartyCommand() {
partyJoinCommand = new PartyJoinCommand();
partyAcceptCommand = new PartyAcceptCommand();
partyCreateCommand = new PartyCreateCommand();
partyQuitCommand = new PartyQuitCommand();
partyXpShareCommand = new PartyXpShareCommand();
partyItemShareCommand = new PartyItemShareCommand();
partyInviteCommand = new PartyInviteCommand();
partyKickCommand = new PartyKickCommand();
partyDisbandCommand = new PartyDisbandCommand();
partyChangeOwnerCommand = new PartyChangeOwnerCommand();
partyLockCommand = new PartyLockCommand();
partyChangePasswordCommand = new PartyChangePasswordCommand();
partyRenameCommand = new PartyRenameCommand();
partyInfoCommand = new PartyInfoCommand();
partyHelpCommand = new PartyHelpCommand();
partyTeleportCommand = new PtpCommand();
partyAllianceCommand = new PartyAllianceCommand();
private static final List<String> PARTY_SUBCOMMANDS;
private static final List<String> XPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
private static final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc");
ArrayList<String> subcommands = new ArrayList<>();
static {
ArrayList<String> subcommands = new ArrayList<String>();
for (PartySubcommandType subcommand : PartySubcommandType.values()) {
subcommands.add(subcommand.toString());
@ -72,8 +41,27 @@ public class PartyCommand implements TabExecutor {
PARTY_SUBCOMMANDS = ImmutableList.copyOf(subcommands);
}
private CommandExecutor partyJoinCommand = new PartyJoinCommand();
private CommandExecutor partyAcceptCommand = new PartyAcceptCommand();
private CommandExecutor partyCreateCommand = new PartyCreateCommand();
private CommandExecutor partyQuitCommand = new PartyQuitCommand();
private CommandExecutor partyXpShareCommand = new PartyXpShareCommand();
private CommandExecutor partyItemShareCommand = new PartyItemShareCommand();
private CommandExecutor partyInviteCommand = new PartyInviteCommand();
private CommandExecutor partyKickCommand = new PartyKickCommand();
private CommandExecutor partyDisbandCommand = new PartyDisbandCommand();
private CommandExecutor partyChangeOwnerCommand = new PartyChangeOwnerCommand();
private CommandExecutor partyLockCommand = new PartyLockCommand();
private CommandExecutor partyChangePasswordCommand = new PartyChangePasswordCommand();
private CommandExecutor partyRenameCommand = new PartyRenameCommand();
private CommandExecutor partyInfoCommand = new PartyInfoCommand();
private CommandExecutor partyHelpCommand = new PartyHelpCommand();
private CommandExecutor partyTeleportCommand = mcMMO.p.getCommand("ptp").getExecutor();
private CommandExecutor partyChatCommand = new PartyChatCommand();
private CommandExecutor partyAllianceCommand = new PartyAllianceCommand();
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandUtils.noConsoleUsage(sender)) {
return true;
}
@ -84,17 +72,7 @@ public class PartyCommand implements TabExecutor {
}
Player player = (Player) sender;
if (!UserManager.hasPlayerDataKey(player)) {
return true;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (mcMMOPlayer == null) {
player.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
if (args.length < 1) {
if (!mcMMOPlayer.inParty()) {
@ -145,35 +123,50 @@ public class PartyCommand implements TabExecutor {
return partyInviteCommand.onCommand(sender, command, label, args);
case TELEPORT:
return partyTeleportCommand.onCommand(sender, command, label, extractArgs(args));
case CHAT:
return partyChatCommand.onCommand(sender, command, label, extractArgs(args));
default:
break;
}
// Party leader commands
if (!mcMMOPlayer.getParty().getLeader().getUniqueId().equals(player.getUniqueId())) {
if (!mcMMOPlayer.getParty().getLeader().equalsIgnoreCase(player.getName())) {
sender.sendMessage(LocaleLoader.getString("Party.NotOwner"));
return true;
}
return switch (subcommand) {
case XPSHARE -> partyXpShareCommand.onCommand(sender, command, label, args);
case ITEMSHARE -> partyItemShareCommand.onCommand(sender, command, label, args);
case KICK -> partyKickCommand.onCommand(sender, command, label, args);
case DISBAND -> partyDisbandCommand.onCommand(sender, command, label, args);
case OWNER -> partyChangeOwnerCommand.onCommand(sender, command, label, args);
case LOCK, UNLOCK -> partyLockCommand.onCommand(sender, command, label, args);
case PASSWORD -> partyChangePasswordCommand.onCommand(sender, command, label, args);
case RENAME -> partyRenameCommand.onCommand(sender, command, label, args);
case ALLIANCE -> partyAllianceCommand.onCommand(sender, command, label, args);
default -> true;
};
switch (subcommand) {
case XPSHARE:
return partyXpShareCommand.onCommand(sender, command, label, args);
case ITEMSHARE:
return partyItemShareCommand.onCommand(sender, command, label, args);
case KICK:
return partyKickCommand.onCommand(sender, command, label, args);
case DISBAND:
return partyDisbandCommand.onCommand(sender, command, label, args);
case OWNER:
return partyChangeOwnerCommand.onCommand(sender, command, label, args);
case LOCK:
case UNLOCK:
return partyLockCommand.onCommand(sender, command, label, args);
case PASSWORD:
return partyChangePasswordCommand.onCommand(sender, command, label, args);
case RENAME:
return partyRenameCommand.onCommand(sender, command, label, args);
case ALLIANCE:
return partyAllianceCommand.onCommand(sender, command, label, args);
default:
break;
}
return true;
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], PARTY_SUBCOMMANDS, new ArrayList<>(PARTY_SUBCOMMANDS.size()));
return StringUtil.copyPartialMatches(args[0], PARTY_SUBCOMMANDS, new ArrayList<String>(PARTY_SUBCOMMANDS.size()));
case 2:
PartySubcommandType subcommand = PartySubcommandType.getSubcommand(args[0]);
@ -181,43 +174,31 @@ public class PartyCommand implements TabExecutor {
return ImmutableList.of();
}
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
switch (subcommand) {
case JOIN:
case INVITE:
case KICK:
case OWNER:
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<>(playerNames.size()));
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
case XPSHARE:
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<>(XPSHARE_COMPLETIONS.size()));
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<String>(XPSHARE_COMPLETIONS.size()));
case ITEMSHARE:
return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<>(ITEMSHARE_COMPLETIONS.size()));
return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<String>(ITEMSHARE_COMPLETIONS.size()));
case LOCK:
case CHAT:
return StringUtil.copyPartialMatches(args[1], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
return StringUtil.copyPartialMatches(args[1], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
case PASSWORD:
return StringUtil.copyPartialMatches(args[1], CommandUtils.RESET_OPTIONS, new ArrayList<>(CommandUtils.RESET_OPTIONS.size()));
return StringUtil.copyPartialMatches(args[1], CommandUtils.RESET_OPTIONS, new ArrayList<String>(CommandUtils.RESET_OPTIONS.size()));
case TELEPORT:
List<String> matches = StringUtil.copyPartialMatches(args[1], PtpCommand.TELEPORT_SUBCOMMANDS, new ArrayList<>(PtpCommand.TELEPORT_SUBCOMMANDS.size()));
List<String> matches = StringUtil.copyPartialMatches(args[1], PtpCommand.TELEPORT_SUBCOMMANDS, new ArrayList<String>(PtpCommand.TELEPORT_SUBCOMMANDS.size()));
if (matches.isEmpty()) {
if (matches.size() == 0) {
Player player = (Player) sender;
final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Not Loaded
if (mcMMOPlayer == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return ImmutableList.of();
}
if (mcMMOPlayer.getParty() == null)
return ImmutableList.of();
final Party party = mcMMOPlayer.getParty();
Party party = UserManager.getPlayer(player).getParty();
playerNames = party.getOnlinePlayerNames(player);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<>(playerNames.size()));
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
}
return matches;
@ -226,7 +207,7 @@ public class PartyCommand implements TabExecutor {
}
case 3:
if (PartySubcommandType.getSubcommand(args[0]) == PartySubcommandType.ITEMSHARE && isItemShareCategory(args[1])) {
return StringUtil.copyPartialMatches(args[2], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
return StringUtil.copyPartialMatches(args[2], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
}
return ImmutableList.of();

View File

@ -1,40 +1,35 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
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 PartyCreateCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
case 3:
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (UserManager.getPlayer(player) == null) {
player.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
// Check to see if the party exists, and if it does cancel creating a new party
if (mcMMO.p.getPartyManager().checkPartyExistence(player, args[1])) {
if (PartyManager.checkPartyExistence(player, args[1])) {
return true;
}
// Changing parties
if (!mcMMO.p.getPartyManager().changeOrJoinParty(mcMMOPlayer, args[1])) {
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, args[1])) {
return true;
}
mcMMO.p.getPartyManager().createParty(mcMMOPlayer, args[1], getPassword(args));
PartyManager.createParty(mcMMOPlayer, args[1], getPassword(args));
return true;
default:

View File

@ -1,42 +1,38 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
public class PartyDisbandCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length == 1) {
final McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
if (mcMMOPlayer == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
String partyName = playerParty.getName();
final Party playerParty = mcMMOPlayer.getParty();
final String partyName = playerParty.getName();
for (Player member : playerParty.getOnlineMembers()) {
if (!PartyManager.handlePartyChangeEvent(member, partyName, null, EventReason.KICKED_FROM_PARTY)) {
return true;
}
for (Player member : playerParty.getOnlineMembers()) {
if (!mcMMO.p.getPartyManager().handlePartyChangeEvent(member, partyName, null, EventReason.KICKED_FROM_PARTY)) {
return true;
member.sendMessage(LocaleLoader.getString("Party.Disband"));
}
member.sendMessage(LocaleLoader.getString("Party.Disband"));
}
PartyManager.disbandParty(playerParty);
return true;
mcMMO.p.getPartyManager().disbandParty(mcMMOPlayer, playerParty);
return true;
default:
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "disband"));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "disband"));
return true;
}
}

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