mirror of
https://github.com/RoinujNosde/SimpleClans.git
synced 2026-11-05 09:10:14 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fce8399840 | ||
|
|
cc2fc201fe | ||
|
|
373f41f9ee | ||
|
|
f1e4bbf043 | ||
|
|
b902f5f71d | ||
|
|
6461b5bc8c | ||
|
|
169ebe543e | ||
|
|
6018c793d4 | ||
|
|
ded9077dda | ||
|
|
0dd519dabd | ||
|
|
9563fc383c | ||
|
|
846574e613 | ||
|
|
cd40fdc704 | ||
|
|
7f01696a56 | ||
|
|
52da3def88 | ||
|
|
baea60473a | ||
|
|
4d6d2b550a | ||
|
|
ae99204f58 | ||
|
|
03e95cfa23 | ||
|
|
25f854b155 | ||
|
|
a32c751aaa | ||
|
|
e212e17bef | ||
|
|
4a7036cd82 | ||
|
|
d7d7620c24 | ||
|
|
3d545acda5 | ||
|
|
1d5a8beb3d | ||
|
|
82a14a8f24 | ||
|
|
d07ff8aa17 | ||
|
|
855927e1cd | ||
|
|
a67beb0fda | ||
|
|
b3e2720bc9 | ||
|
|
99cb9e332a | ||
|
|
541e775fdb | ||
|
|
0c220c79f2 | ||
|
|
abc0bfe3ae | ||
|
|
ff28d67e4b | ||
|
|
a723e8acff | ||
|
|
9c20ef0575 | ||
|
|
00b19d8c99 | ||
|
|
8bcb1f2177 | ||
|
|
37be7fbfc7 | ||
|
|
29ef92e3b8 | ||
|
|
accddf319d | ||
|
|
dafae75b21 | ||
|
|
6e477ec091 | ||
|
|
8ae504024e | ||
|
|
665ac47150 | ||
|
|
f6d1356873 | ||
|
|
40a749b304 | ||
|
|
628b26543f | ||
|
|
c25c982264 | ||
|
|
32e21dbf50 | ||
|
|
7653b494fe | ||
|
|
d20def4647 | ||
|
|
759796402e | ||
|
|
13281ebff9 | ||
|
|
2d52da106b | ||
|
|
587f74e6aa | ||
|
|
74ba2ff568 | ||
|
|
7e658c08b6 | ||
|
|
cdda69d8b6 | ||
|
|
41721b02a7 | ||
|
|
6bb3afb707 | ||
|
|
3550d3909e | ||
|
|
1f0b251885 | ||
|
|
701d70681f | ||
|
|
9f312800e1 | ||
|
|
d892b03142 | ||
|
|
105ed018b1 | ||
|
|
7d872f1a4b | ||
|
|
5a1173f257 | ||
|
|
567e64462b | ||
|
|
95c5b11352 | ||
|
|
26ceb59564 | ||
|
|
ddf11b732f | ||
|
|
d35007b369 | ||
|
|
aa011357bc | ||
|
|
53296485e8 | ||
|
|
3f4fe0429f | ||
|
|
31389485fd | ||
|
|
c84f88b607 | ||
|
|
a3cee92371 | ||
|
|
8ae79e6b3d | ||
|
|
93fb4eafd4 | ||
|
|
5f2c20fe13 | ||
|
|
27b81f00d1 | ||
|
|
0d0ad0a73f | ||
|
|
7f20cd47f2 | ||
|
|
ddabe9f86e | ||
|
|
22cee2c494 |
No files matched your search
@@ -1,29 +0,0 @@
|
||||
name: Publish to Bintray (Spigot 1.13+)
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
server-id: bintray-roinujnosde-bukkit-plugins # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
server-username: MAVEN_USERNAME
|
||||
server-password: MAVEN_PASSWORD
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
- name: Publish to Bintray
|
||||
run: mvn -B deploy
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.BINTRAY_USERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.BINTRAY_TOKEN }}
|
||||
@@ -22,10 +22,8 @@ jobs:
|
||||
java-version: 1.8
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
- name: Create Staging
|
||||
run: mkdir staging && cp target/SimpleClans.jar staging
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: SimpleClans
|
||||
path: staging
|
||||
path: target/SimpleClans.jar
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Publish to CurseForge
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
- name: Upload artifact
|
||||
uses: itsmeow/curseforge-upload@v3
|
||||
with:
|
||||
token: ${{ secrets.CURSEFORGE_TOKEN }}
|
||||
project_id: 380814
|
||||
game_endpoint: minecraft
|
||||
file_path: target/SimpleClans.jar
|
||||
changelog: ${{ github.event.release.body }}
|
||||
display_name: ${{ github.event.release.tag_name }}
|
||||
game_versions: 7915,7667,7330,7105,6588,630,591,585,531
|
||||
release_type: release
|
||||
relations: vault:optionalDependency,worldguard:optionalDependency,grief-prevention:optionalDependency
|
||||
@@ -6,3 +6,4 @@
|
||||
/dependency-reduced-pom.xml
|
||||
*.jar
|
||||
.settings
|
||||
.factorypath
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
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.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
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.
|
||||
|
||||
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 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.
|
||||
|
||||
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
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
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>.
|
||||
@@ -1,4 +1,4 @@
|
||||
[](https://www.spigotmc.org/resources/simpleclans.71242/)
|
||||
[](https://www.spigotmc.org/resources/simpleclans.71242/)
|
||||
|
||||
SimpleClans
|
||||
==========
|
||||
@@ -50,15 +50,17 @@ Including SimpleClans with Maven:
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>bintray-roinujnosde-bukkit-plugins</id>
|
||||
<url>https://dl.bintray.com/roinujnosde/bukkit-plugins</url>
|
||||
<id>codemc-repo</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
```xml
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
|
||||
<artifactId>SimpleClans</artifactId>
|
||||
<version>2.14.3</version> <!-- You can find the latest version at the bottom -->
|
||||
<version>2.15.0</version> <!-- You can find the latest version at the bottom -->
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -68,16 +70,15 @@ Using Gradle:
|
||||
```groovy
|
||||
repositories {
|
||||
maven {
|
||||
url "https://dl.bintray.com/roinujnosde/bukkit-plugins"
|
||||
url "https://repo.codemc.org/repository/maven-public"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
compileOnly "net.sacredlabyrinth.phaed.simpleclans:SimpleClans:2.14.3" // You can find the latest version at the bottom
|
||||
compileOnly "net.sacredlabyrinth.phaed.simpleclans:SimpleClans:2.15.0"
|
||||
}
|
||||
```
|
||||
|
||||
##### Latest version:
|
||||
[](https://bintray.com/roinujnosde/bukkit-plugins/SimpleClans/_latestVersion)
|
||||
|
||||
[]()
|
||||
##### API Examples
|
||||
* [Examples of how to use the API](https://simpleclans.gitbook.io/simpleclans/other/simpleclans-api)
|
||||
@@ -43,5 +43,67 @@
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.0.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.1.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard:worldguard-bukkit:7.0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard:worldguard-core:7.0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard.worldguard-libs:core:7.0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-core:7.2.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit.worldedit-libs:core:7.2.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-profile-default_2.13:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.scala-lang:scala-library:2.13.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-http:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-kernel-spec:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-annotations:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:annotations:3.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-cio:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-io:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-services:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-logging:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.inject:javax.inject:1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpclient:4.5.10" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpcore:4.4.12" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:jcl-over-slf4j:1.7.28" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-odf:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-zipdriver:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-zip:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bouncycastle:bcprov-jdk15on:1.63" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-tardriver:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar-bzip2:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar-gzip:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar-xz:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.tukaani:xz:1.8" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-zip-raes:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-profile-base_2.13:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-access-swing:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-access:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-file:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-jar:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-zip:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-ibm437:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-kernel-impl_2.13:0.12.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-console:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-default:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-swing:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-macosx:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-spec:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-shed:2.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.dev.jna:jna:4.1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mozilla:rhino-runtime:1.7.12" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: it.unimi.dsi:fastutil:8.2.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.antlr:antlr4-runtime:4.7.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.flywaydb:flyway-core:3.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TechFortress:GriefPrevention:16.17.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.plotsquared:PlotSquared-Core:5.13.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.plotsquared:PlotSquared-Bukkit:5.13.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.plotsquared:plotsquared-api:3.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.plotsquared:plotsquared-bukkitapi:3.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.7" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,3 @@
|
||||
files:
|
||||
- source: src/main/resources/messages.properties
|
||||
translation: /src/main/resources/%file_name%_%locale_with_underscore%.%file_extension%
|
||||
+119
-8
@@ -4,7 +4,7 @@
|
||||
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
|
||||
<artifactId>SimpleClans</artifactId>
|
||||
<name>SimpleClans</name>
|
||||
<version>2.14.7</version>
|
||||
<version>2.15.1</version>
|
||||
<url>http://dev.bukkit.org/server-mods/simpleclans/</url>
|
||||
<build>
|
||||
<resources>
|
||||
@@ -103,10 +103,6 @@
|
||||
<id>bstats-repo</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
@@ -115,6 +111,22 @@
|
||||
<id>aikar</id>
|
||||
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>IntellectualSites</id>
|
||||
<url>https://mvn.intellectualsites.com/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plotsquared</id>
|
||||
<url>https://plotsquared.com/mvn/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@@ -201,13 +213,112 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.4</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>worldguard-core</artifactId>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>commandbook</artifactId>
|
||||
<groupId>com.sk89q</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.TechFortress</groupId>
|
||||
<artifactId>GriefPrevention</artifactId>
|
||||
<version>16.17.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>PlotSquared-Core</artifactId>
|
||||
<version>5.13.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>PlotSquared-Bukkit</artifactId>
|
||||
<version>5.13.3</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>PlotSquared-Core</artifactId>
|
||||
<groupId>*</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>plotsquared-api</artifactId>
|
||||
<version>3.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>*</artifactId>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<groupId>org.yaml</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>gson</artifactId>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>plotsquared-bukkitapi</artifactId>
|
||||
<version>3.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>*</artifactId>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>Core</artifactId>
|
||||
<groupId>PlotSquared</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>bintray-roinujnosde-bukkit-plugins</id>
|
||||
<name>roinujnosde-bukkit-plugins</name>
|
||||
<url>https://api.bintray.com/maven/roinujnosde/bukkit-plugins/SimpleClans/;publish=1</url>
|
||||
<id>codemc-releases</id>
|
||||
<url>https://repo.codemc.io/repository/maven-releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>codemc-snapshots</id>
|
||||
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<root>
|
||||
<item name='org.bukkit.configuration.MemorySection java.lang.String getString(java.lang.String, java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_, _, -> !null""/>
|
||||
<val val=""_, _ -> !null""/>
|
||||
</annotation>
|
||||
</item>
|
||||
</root>
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
|
||||
<artifactId>SimpleClans</artifactId>
|
||||
<version>2.14.7</version>
|
||||
<version>2.15.2</version>
|
||||
<name>SimpleClans</name>
|
||||
<url>http://dev.bukkit.org/server-mods/simpleclans/</url>
|
||||
|
||||
@@ -170,6 +170,64 @@
|
||||
<version>5.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.TechFortress</groupId>
|
||||
<artifactId>GriefPrevention</artifactId>
|
||||
<version>16.17.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>PlotSquared-Core</artifactId>
|
||||
<version>5.13.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>PlotSquared-Bukkit</artifactId>
|
||||
<version>5.13.3</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>*</groupId>
|
||||
<artifactId>PlotSquared-Core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>plotsquared-api</artifactId>
|
||||
<version>3.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>plotsquared-bukkitapi</artifactId>
|
||||
<version>3.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>PlotSquared</groupId>
|
||||
<artifactId>Core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- Repositories -->
|
||||
@@ -186,10 +244,6 @@
|
||||
<id>bstats-repo</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
@@ -198,6 +252,22 @@
|
||||
<id>aikar</id>
|
||||
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>IntellectualSites</id>
|
||||
<url>https://mvn.intellectualsites.com/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plotsquared</id>
|
||||
<url>https://plotsquared.com/mvn/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
@@ -208,9 +278,12 @@
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>bintray-roinujnosde-bukkit-plugins</id>
|
||||
<name>roinujnosde-bukkit-plugins</name>
|
||||
<url>https://api.bintray.com/maven/roinujnosde/bukkit-plugins/SimpleClans/;publish=1</url>
|
||||
<id>codemc-releases</id>
|
||||
<url>https://repo.codemc.io/repository/maven-releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>codemc-snapshots</id>
|
||||
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
@@ -3,6 +3,7 @@ package net.sacredlabyrinth.phaed.simpleclans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -10,7 +11,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
@@ -28,33 +28,23 @@ public class ChatBlock {
|
||||
private boolean padRight = true;
|
||||
|
||||
public void setCropRight(boolean cropRight) {
|
||||
this.cropRight = cropRight;
|
||||
this.cropRight = cropRight;
|
||||
}
|
||||
|
||||
|
||||
public void setPadRight(boolean padRight) {
|
||||
this.padRight = padRight;
|
||||
this.padRight = padRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param columnAlignment
|
||||
*/
|
||||
|
||||
public void setAlignment(String... columnAlignment) {
|
||||
columnAlignments.addAll(Arrays.asList(columnAlignment));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param columnFlex
|
||||
*/
|
||||
public void setFlexibility(boolean... columnFlex) {
|
||||
for (boolean flex : columnFlex) {
|
||||
columnFlexes.add(flex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param columnPercentages
|
||||
* @param prefix
|
||||
*/
|
||||
public void setColumnSizes(String prefix, double... columnPercentages) {
|
||||
int ll = LINE_LENGTH;
|
||||
|
||||
@@ -67,73 +57,38 @@ public class ChatBlock {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public boolean hasContent() {
|
||||
return !rows.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contents
|
||||
*/
|
||||
public void addRow(String... contents) {
|
||||
rows.add(contents);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public int size() {
|
||||
return rows.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return rows.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void clear() {
|
||||
rows.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
public boolean sendBlock(CommandSender player) {
|
||||
return sendBlock(player, null, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param prefix
|
||||
* @return
|
||||
*/
|
||||
public boolean sendBlock(CommandSender player, String prefix) {
|
||||
return sendBlock(player, prefix, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public boolean sendBlock(CommandSender player, int amount) {
|
||||
return sendBlock(player, null, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param prefix
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
boolean sendBlock(CommandSender player, String prefix, int amount) {
|
||||
if (player == null) {
|
||||
return false;
|
||||
@@ -194,27 +149,27 @@ public class ChatBlock {
|
||||
}
|
||||
} else if (align.equalsIgnoreCase("l")) {
|
||||
if (msgLength(section) > colsize) {
|
||||
if (cropRight) {
|
||||
col = cropRightToFit(section, colsize);
|
||||
if (cropRight) {
|
||||
col = cropRightToFit(section, colsize);
|
||||
} else {
|
||||
col = section;
|
||||
col = section;
|
||||
}
|
||||
} else if (msgLength(section) < colsize) {
|
||||
if (padRight) {
|
||||
col = paddRightToFit(section, colsize);
|
||||
} else {
|
||||
col = section;
|
||||
}
|
||||
if (padRight) {
|
||||
col = paddRightToFit(section, colsize);
|
||||
} else {
|
||||
col = section;
|
||||
}
|
||||
}
|
||||
} else if (align.equalsIgnoreCase("c")) {
|
||||
if (msgLength(section) > colsize) {
|
||||
if (cropRight) {
|
||||
col = cropRightToFit(section, colsize);
|
||||
} else {
|
||||
col = section;
|
||||
}
|
||||
if (cropRight) {
|
||||
col = cropRightToFit(section, colsize);
|
||||
} else {
|
||||
col = section;
|
||||
}
|
||||
} else if (msgLength(section) < colsize) {
|
||||
col = centerInLineOf(section, colsize);
|
||||
col = centerInLineOf(section, colsize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +234,7 @@ public class ChatBlock {
|
||||
// crop and print out
|
||||
String msg = (prefix_used ? empty_prefix : prefix + " ") + finalString;
|
||||
if (cropRight) {
|
||||
msg = cropRightToFit(msg, LINE_LENGTH);
|
||||
msg = cropRightToFit(msg, LINE_LENGTH);
|
||||
}
|
||||
if (color.length() > 0) {
|
||||
msg = color + msg;
|
||||
@@ -304,10 +259,6 @@ public class ChatBlock {
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param col
|
||||
* @return
|
||||
*/
|
||||
int getMaxWidth(int col) {
|
||||
double maxWidth = 0;
|
||||
|
||||
@@ -318,19 +269,10 @@ public class ChatBlock {
|
||||
return (int) maxWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param msg
|
||||
* @return
|
||||
*/
|
||||
public static String centerInLine(String msg) {
|
||||
return centerInLineOf(msg, LINE_LENGTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param msg
|
||||
* @param lineLength
|
||||
* @return
|
||||
*/
|
||||
private static String centerInLineOf(String msg, double lineLength) {
|
||||
double length = msgLength(msg);
|
||||
double diff = lineLength - length;
|
||||
@@ -355,10 +297,6 @@ public class ChatBlock {
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static String makeEmpty(String str) {
|
||||
if (str == null) {
|
||||
return "";
|
||||
@@ -367,11 +305,6 @@ public class ChatBlock {
|
||||
return paddLeftToFit("", msgLength(str));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param msg
|
||||
* @param length
|
||||
* @return
|
||||
*/
|
||||
private static String cropRightToFit(String msg, double length) {
|
||||
if (msg == null || msg.length() == 0 || length == 0) {
|
||||
return "";
|
||||
@@ -384,11 +317,6 @@ public class ChatBlock {
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param msg
|
||||
* @param length
|
||||
* @return
|
||||
*/
|
||||
private static String cropLeftToFit(String msg, double length) {
|
||||
if (msg == null || msg.length() == 0 || length == 0) {
|
||||
return "";
|
||||
@@ -402,11 +330,11 @@ public class ChatBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Padds left til the string is a certain size
|
||||
* Pads left til the string is a certain size
|
||||
*
|
||||
* @param msg
|
||||
* @param length
|
||||
* @return
|
||||
* @param msg the message to pad
|
||||
* @param length the message length
|
||||
* @return the padded message
|
||||
*/
|
||||
private static String paddLeftToFit(String msg, double length) {
|
||||
if (msgLength(msg) >= length) {
|
||||
@@ -421,11 +349,11 @@ public class ChatBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Padds right til the string is a certain size
|
||||
* Pads right til the string is a certain size
|
||||
*
|
||||
* @param msg
|
||||
* @param length
|
||||
* @return
|
||||
* @param msg the message to pad
|
||||
* @param length the message length
|
||||
* @return the padded message
|
||||
*/
|
||||
private static String paddRightToFit(String msg, double length) {
|
||||
if (msgLength(msg) >= length) {
|
||||
@@ -441,9 +369,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Finds the length on the screen of a string. Ignores colors.
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
private static double msgLength(String str) {
|
||||
double length = 0;
|
||||
@@ -464,9 +389,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Finds the visual length of the character on the screen.
|
||||
*
|
||||
* @param x
|
||||
* @return
|
||||
*/
|
||||
private static int charLength(char x) {
|
||||
String normalized = StringSimplifier.simplifiedString(x + "");
|
||||
@@ -492,7 +414,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Cuts the message apart into whole words short enough to fit on one line
|
||||
*
|
||||
*/
|
||||
private static String[] wordWrap(String msg) {
|
||||
// Split each word apart
|
||||
@@ -546,8 +467,6 @@ public class ChatBlock {
|
||||
return out.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
private static String combineSplit(String[] string) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String aString : string) {
|
||||
@@ -561,7 +480,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Cuts apart a word that is too long to fit on one line
|
||||
*
|
||||
*/
|
||||
private static String[] wordCut(int lengthBefore, String str) {
|
||||
int length = lengthBefore;
|
||||
@@ -595,7 +513,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Outputs a single line out, crops overflow
|
||||
*
|
||||
*/
|
||||
public static void saySingle(CommandSender receiver, String msg) {
|
||||
if (receiver == null) {
|
||||
@@ -607,7 +524,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Outputs a message to a user
|
||||
*
|
||||
*/
|
||||
public static void sendMessage(@Nullable CommandSender receiver, @NotNull String msg) {
|
||||
if (receiver == null) {
|
||||
@@ -622,6 +538,19 @@ public class ChatBlock {
|
||||
// }
|
||||
}
|
||||
|
||||
public static void sendMessage(@Nullable ClanPlayer receiver, @NotNull String msg) {
|
||||
if (receiver == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = receiver.toPlayer();
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendMessage(ChatUtils.parseColors(msg));
|
||||
}
|
||||
|
||||
public static void sendMessageKey(@Nullable CommandSender receiver, @NotNull String key, @NotNull Object... args) {
|
||||
sendMessage(receiver, lang(key, receiver, args));
|
||||
}
|
||||
@@ -632,7 +561,6 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Send blank line
|
||||
*
|
||||
*/
|
||||
public static void sendBlank(CommandSender receiver) {
|
||||
if (receiver == null) {
|
||||
@@ -644,12 +572,11 @@ public class ChatBlock {
|
||||
|
||||
/**
|
||||
* Colors each line
|
||||
*
|
||||
*/
|
||||
public static String[] say(String message) {
|
||||
return colorize(wordWrap(message));
|
||||
}
|
||||
|
||||
|
||||
public static String[] getColorizedMessage(String msg) {
|
||||
return colorize(wordWrap(msg));
|
||||
}
|
||||
@@ -663,7 +590,7 @@ public class ChatBlock {
|
||||
}
|
||||
|
||||
public static @Nullable String colorize(String message) {
|
||||
return colorizeBase(new String[]{ message })[0];
|
||||
return colorizeBase(new String[]{message})[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
public enum EconomyResponse {
|
||||
SUCCESS, NEGATIVE_VALUE, NOT_ENOUGH_BALANCE, CANCELLED
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.JSONValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Flags {
|
||||
|
||||
private final JSONObject flags;
|
||||
|
||||
public Flags(@Nullable String json) {
|
||||
JSONObject flags = null;
|
||||
if (json != null && !json.isEmpty()) {
|
||||
flags = (JSONObject) JSONValue.parse(json);
|
||||
}
|
||||
if (flags == null) {
|
||||
flags = new JSONObject();
|
||||
}
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<String> getStringList(@NotNull String key) {
|
||||
Object object = flags.get(key);
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
if (object instanceof JSONArray) {
|
||||
for (Object o : ((JSONArray) object)) {
|
||||
list.add(String.valueOf(o));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getString(@NotNull String key) {
|
||||
Object object = flags.get(key);
|
||||
if (object == null) {
|
||||
return null;
|
||||
}
|
||||
return String.valueOf(object);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getString(@NotNull String key, @NotNull String def) {
|
||||
String string = getString(key);
|
||||
if (string == null) {
|
||||
return def;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Number getNumber(@NotNull String key) {
|
||||
Object object = flags.get(key);
|
||||
if (object instanceof Number) {
|
||||
return (Number) object;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean getBoolean(@NotNull String key) {
|
||||
return getBoolean(key, false);
|
||||
}
|
||||
|
||||
public boolean getBoolean(@NotNull String key, boolean def) {
|
||||
Object object = flags.get(key);
|
||||
if (object instanceof Boolean) {
|
||||
return (Boolean) object;
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void put(@NotNull String key, @NotNull List<?> value) {
|
||||
JSONArray array = new JSONArray();
|
||||
array.addAll(value);
|
||||
flags.put(key, array);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void put(@NotNull String key, @NotNull Object object) {
|
||||
flags.put(key, object);
|
||||
}
|
||||
|
||||
public String toJSONString() {
|
||||
return flags.toJSONString();
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import net.sacredlabyrinth.phaed.simpleclans.utils.VanishUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
@@ -18,6 +19,8 @@ import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.HttpURLConnection;
|
||||
@@ -28,6 +31,7 @@ import java.time.LocalTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -97,7 +101,7 @@ public class Helper {
|
||||
* @param jo the JSON Object
|
||||
* @return a list of ranks or null if the JSON String is null/empty
|
||||
*/
|
||||
public static @Nullable List<Rank> ranksFromJson(JSONObject jo) {
|
||||
public static @Nullable List<Rank> ranksFromJson(@Nullable JSONObject jo) {
|
||||
if (jo != null && !jo.isEmpty()) {
|
||||
Object ranks = jo.get("ranks");
|
||||
if (ranks != null) {
|
||||
@@ -127,7 +131,7 @@ public class Helper {
|
||||
* @param jo the JSON object
|
||||
* @return the default rank or null if not found and/or it does not exist
|
||||
*/
|
||||
public static @Nullable String defaultRankFromJson(JSONObject jo) {
|
||||
public static @Nullable String defaultRankFromJson(@Nullable JSONObject jo) {
|
||||
if (jo != null && !jo.isEmpty()) {
|
||||
if (!jo.containsKey("defaultRank")) {
|
||||
return null;
|
||||
@@ -900,7 +904,7 @@ public class Helper {
|
||||
*
|
||||
* @param cp Sender
|
||||
* @param msg The chat message
|
||||
* @return The formated message
|
||||
* @return The formatted message
|
||||
*/
|
||||
public static String formatSpyClanChat(ClanPlayer cp, String msg) {
|
||||
msg = stripColors(msg);
|
||||
@@ -911,4 +915,47 @@ public class Helper {
|
||||
return ChatColor.DARK_GRAY + "[" + cp.getTag() + "] " + msg;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats max inactive days to an infinity symbol if it's negative or 0
|
||||
*
|
||||
* @param max inactive days
|
||||
* @return formatted message
|
||||
*/
|
||||
public static String formatMaxInactiveDays(int max) {
|
||||
if (max <= 0) {
|
||||
return "∞";
|
||||
} else {
|
||||
return String.valueOf(max);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getFormattedClanStatus(Clan clan, CommandSender sender) {
|
||||
ArrayList<String> statuses = new ArrayList<>();
|
||||
if (clan.isPermanent()) {
|
||||
statuses.add(lang("permanent", sender));
|
||||
}
|
||||
if (clan.isVerified()) {
|
||||
statuses.add(lang("verified", sender));
|
||||
} else {
|
||||
statuses.add(lang("unverified", sender));
|
||||
}
|
||||
return String.join(", ", statuses);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if all passed materials are some kind of AIR
|
||||
*
|
||||
* @param materials materials to test
|
||||
* @return true if all materials are AIR
|
||||
*/
|
||||
public static boolean isAir(@NotNull Material... materials) {
|
||||
for (Material m : materials) {
|
||||
if (!m.name().contains("AIR")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class Kill {
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
CIVILIAN("c"), RIVAL("r"), NEUTRAL("n");
|
||||
CIVILIAN("c"), RIVAL("r"), NEUTRAL("n"), ALLY("a");
|
||||
|
||||
Type(String shortName) {
|
||||
this.shortName = shortName;
|
||||
|
||||
@@ -45,6 +45,7 @@ public class SimpleClans extends JavaPlugin {
|
||||
private SettingsManager settingsManager;
|
||||
private PermissionsManager permissionsManager;
|
||||
private TeleportManager teleportManager;
|
||||
private ProtectionManager protectionManager;
|
||||
private boolean hasUUID;
|
||||
private static final Pattern ACF_PLACEHOLDER_PATTERN = Pattern.compile("\\{(?<key>[a-zA-Z]+?)}");
|
||||
|
||||
@@ -91,6 +92,8 @@ public class SimpleClans extends JavaPlugin {
|
||||
clanManager = new ClanManager();
|
||||
storageManager = new StorageManager();
|
||||
teleportManager = new TeleportManager();
|
||||
protectionManager = new ProtectionManager();
|
||||
protectionManager.registerListeners();
|
||||
migrateChatFormat();
|
||||
registerEvents();
|
||||
permissionsManager.loadPermissions();
|
||||
@@ -223,6 +226,10 @@ public class SimpleClans extends JavaPlugin {
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
public ProtectionManager getProtectionManager() {
|
||||
return protectionManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the path within the language file
|
||||
* @return the lang
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class War {
|
||||
private final Map<Clan, Integer> clans = new HashMap<>();
|
||||
|
||||
public War(@NotNull Clan clan1, @NotNull Clan clan2) {
|
||||
clans.put(clan1, 0);
|
||||
clans.put(clan2, 0);
|
||||
}
|
||||
|
||||
public List<Clan> getClans() {
|
||||
return new ArrayList<>(clans.keySet());
|
||||
}
|
||||
|
||||
public int getTotalCasualties() {
|
||||
return clans.values().stream().mapToInt(value -> value).sum();
|
||||
}
|
||||
|
||||
public int getCasualties(@NotNull Clan clan) {
|
||||
return clans.getOrDefault(clan, 0);
|
||||
}
|
||||
|
||||
public void increaseCasualties(@NotNull Clan clan) {
|
||||
clans.computeIfPresent(clan, (c, i) -> i + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof War) {
|
||||
return clans.equals(((War) obj).clans);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return clans.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,7 @@ public class SCCommandManager extends PaperCommandManager {
|
||||
registerDependency(StorageManager.class, plugin.getStorageManager());
|
||||
registerDependency(PermissionsManager.class, plugin.getPermissionsManager());
|
||||
registerDependency(RequestManager.class, plugin.getRequestManager());
|
||||
registerDependency(ProtectionManager.class, plugin.getProtectionManager());
|
||||
}
|
||||
|
||||
private void registerCompletions() {
|
||||
@@ -217,6 +218,7 @@ public class SCCommandManager extends PaperCommandManager {
|
||||
"alliances", "leaderboard", "allow", "block", "auto", "check", "assign", "unassign", "delete", "me",
|
||||
"setdisplayname", "permissions", "tag", "deposit", "withdraw", "set", "status", "tp", "all", "everyone",
|
||||
"lookup", "roster", "profile", "list", "create", "description", "start", "end", "admin", "help", "mod",
|
||||
"setdefault", "removedefault");
|
||||
"setdefault", "removedefault", "land", "break", "interact", "place_block", "damage", "interact_entity",
|
||||
"container", "permanent", "take", "give");
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,13 @@ import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.EconomyResponse;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.BankDepositEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.BankWithdrawEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ClanBalanceUpdateEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
@@ -42,6 +48,7 @@ public class BankCommand extends BaseCommand {
|
||||
processWithdraw(player, clan, amount);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void processWithdraw(Player player, Clan clan, double amount) {
|
||||
if (!clan.isAllowWithdraw()) {
|
||||
String message = getCurrentCommandManager().getCommandReplacements()
|
||||
@@ -50,7 +57,25 @@ public class BankCommand extends BaseCommand {
|
||||
return;
|
||||
}
|
||||
amount = Math.abs(amount);
|
||||
clan.withdraw(amount, player);
|
||||
BankWithdrawEvent event = new BankWithdrawEvent(player, clan, amount);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (clan.withdraw(player, ClanBalanceUpdateEvent.Cause.COMMAND, amount)) {
|
||||
case SUCCESS:
|
||||
if (SimpleClans.getInstance().getPermissionsManager().playerGrantMoney(player, amount)) {
|
||||
player.sendMessage(AQUA + lang("player.clan.withdraw", player, amount));
|
||||
clan.addBb(player.getName(), AQUA + lang("bb.clan.withdraw", amount));
|
||||
} else {
|
||||
clan.setBalance(player, ClanBalanceUpdateEvent.Cause.REVERT, clan.getBalance() + amount);
|
||||
}
|
||||
break;
|
||||
case NOT_ENOUGH_BALANCE:
|
||||
player.sendMessage(lang("clan.bank.not.enough.money", player));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%deposit %all")
|
||||
@@ -69,6 +94,7 @@ public class BankCommand extends BaseCommand {
|
||||
processDeposit(player, clan, amount);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void processDeposit(Player player, Clan clan, double amount) {
|
||||
if (!clan.isAllowDeposit()) {
|
||||
String message = getCurrentCommandManager().getCommandReplacements()
|
||||
@@ -77,6 +103,24 @@ public class BankCommand extends BaseCommand {
|
||||
return;
|
||||
}
|
||||
amount = Math.abs(amount);
|
||||
clan.deposit(amount, player);
|
||||
BankDepositEvent event = new BankDepositEvent(player, clan, amount);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (!permissions.playerHasMoney(player, amount)) {
|
||||
player.sendMessage(AQUA + lang("not.sufficient.money", player));
|
||||
return;
|
||||
}
|
||||
EconomyResponse response = clan.deposit(player, ClanBalanceUpdateEvent.Cause.COMMAND, amount);
|
||||
if (response == EconomyResponse.SUCCESS) {
|
||||
if (permissions.playerChargeMoney(player, amount)) {
|
||||
player.sendMessage(AQUA + lang("player.clan.deposit", player, amount));
|
||||
clan.addBb(player.getName(), AQUA + lang("bb.clan.deposit", amount));
|
||||
} else {
|
||||
//Reverts the deposit if something went wrong with Vault
|
||||
clan.setBalance(player, ClanBalanceUpdateEvent.Cause.REVERT, clan.getBalance() - amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-13
@@ -36,30 +36,29 @@ public class ClanCommands extends BaseCommand {
|
||||
private PermissionsManager permissions;
|
||||
@Dependency
|
||||
private RequestManager requestManager;
|
||||
@Dependency
|
||||
private ProtectionManager protectionManager;
|
||||
|
||||
@Subcommand("%war %start")
|
||||
@CommandPermission("simpleclans.leader.war")
|
||||
@Conditions("verified|rank:name=WAR_START")
|
||||
@Description("{@@command.description.war.start}")
|
||||
@CommandCompletion("@rivals")
|
||||
public void startWar(Player player, ClanPlayer cp, Clan issuerClan, @Name("clan") ClanInput other) {
|
||||
Clan war = other.getClan();
|
||||
if (!issuerClan.isRival(war.getTag())) {
|
||||
ChatBlock.sendMessage(player, RED + lang("you.can.only.start.war.with.rivals", player));
|
||||
return;
|
||||
}
|
||||
if (!issuerClan.isWarring(war.getTag())) {
|
||||
List<ClanPlayer> onlineLeaders = Helper.stripOffLinePlayers(issuerClan.getLeaders());
|
||||
public void startWar(Player player, ClanPlayer requester, Clan requestClan, @Conditions("can_war_target") @Name("clan") ClanInput targetClanInput) {
|
||||
Clan targetClan = targetClanInput.getClan();
|
||||
|
||||
List<ClanPlayer> onlineLeaders = Helper.stripOffLinePlayers(requestClan.getLeaders());
|
||||
|
||||
if (settings.isWarRequestEnabled()) {
|
||||
if (!onlineLeaders.isEmpty()) {
|
||||
requestManager.addWarStartRequest(cp, war, issuerClan);
|
||||
requestManager.addWarStartRequest(requester, targetClan, requestClan);
|
||||
ChatBlock.sendMessage(player, AQUA + lang("leaders.have.been.asked.to.accept.the.war.request",
|
||||
player, war.getName()));
|
||||
player, targetClan.getName()));
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, RED + lang("at.least.one.leader.accept.the.alliance", player));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, RED + lang("clans.already.at.war", player));
|
||||
protectionManager.addWar(requester, requestClan, targetClan);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,11 +126,11 @@ public class ClanCommands extends BaseCommand {
|
||||
|
||||
@Subcommand("%invite")
|
||||
@CommandPermission("simpleclans.leader.invite")
|
||||
@CommandCompletion("@non_members")
|
||||
@CommandCompletion("@non_members:ignore_vanished")
|
||||
@Conditions("rank:name=INVITE")
|
||||
@Description("{@@command.description.invite}")
|
||||
public void invite(Player sender, ClanPlayer cp, Clan clan,
|
||||
@Conditions("not_banned|not_in_clan|online") @Name("player") ClanPlayerInput invited) {
|
||||
@Conditions("not_banned|not_in_clan|online:ignore_vanished") @Name("player") ClanPlayerInput invited) {
|
||||
Player invitedPlayer = invited.getClanPlayer().toPlayer();
|
||||
if (invitedPlayer == null) return;
|
||||
if (!permissions.has(invitedPlayer, "simpleclans.member.can-join")) {
|
||||
|
||||
+15
-4
@@ -5,7 +5,10 @@ import co.aikar.commands.annotation.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.HomeRegroupEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.PlayerHomeSetEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ProtectionManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.VanishUtils;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -23,6 +26,8 @@ public class HomeCommands extends BaseCommand {
|
||||
@Dependency
|
||||
private SettingsManager settings;
|
||||
@Dependency
|
||||
private ProtectionManager protection;
|
||||
@Dependency
|
||||
private ClanManager cm;
|
||||
|
||||
@Subcommand("%regroup %me")
|
||||
@@ -35,10 +40,10 @@ public class HomeCommands extends BaseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
processTeleport(player, cp, clan, player.getLocation());
|
||||
processRegroup(player, cp, clan, player.getLocation());
|
||||
}
|
||||
|
||||
private void processTeleport(Player player, ClanPlayer cp, Clan clan, Location location) {
|
||||
private void processRegroup(Player player, ClanPlayer cp, Clan clan, Location location) {
|
||||
HomeRegroupEvent homeRegroupEvent = new HomeRegroupEvent(clan, cp, VanishUtils.getNonVanished(player, clan), location);
|
||||
plugin.getServer().getPluginManager().callEvent(homeRegroupEvent);
|
||||
|
||||
@@ -64,7 +69,7 @@ public class HomeCommands extends BaseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
processTeleport(player, cp, clan, location);
|
||||
processRegroup(player, cp, clan, location);
|
||||
}
|
||||
|
||||
@Subcommand("%home")
|
||||
@@ -109,6 +114,12 @@ public class HomeCommands extends BaseCommand {
|
||||
ChatBlock.sendMessage(player, RED + lang("home.base.only.once", player));
|
||||
return;
|
||||
}
|
||||
if (settings.isSetBaseOnlyInLand()) {
|
||||
if (!protection.isOwner(player, player.getLocation())) {
|
||||
ChatBlock.sendMessageKey(player, "you.can.only.set.base.in.your.land");
|
||||
return;
|
||||
}
|
||||
}
|
||||
PlayerHomeSetEvent homeSetEvent = new PlayerHomeSetEvent(clan, cp, player.getLocation());
|
||||
plugin.getServer().getPluginManager().callEvent(homeSetEvent);
|
||||
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.clan;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ProtectionManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@CommandAlias("%clan")
|
||||
@Subcommand("%land")
|
||||
@Conditions("%basic_conditions|land_sharing|own_land")
|
||||
@CommandPermission("simpleclans.member.land")
|
||||
public class LandCommand extends BaseCommand {
|
||||
|
||||
@Dependency
|
||||
private ProtectionManager protection;
|
||||
@Dependency
|
||||
private SettingsManager settings;
|
||||
|
||||
private Set<Land> getLands(ClanPlayer cp, Location location) {
|
||||
Player player = Objects.requireNonNull(cp.toPlayer());
|
||||
if (settings.isEditAllLands()) {
|
||||
return protection.getLands(player, location);
|
||||
} else {
|
||||
return protection.getLandsAt(location).stream().filter(l -> l.getOwners().contains(player.getUniqueId()))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%allow")
|
||||
public class AllowCommand extends BaseCommand {
|
||||
|
||||
private void allow(ClanPlayer cp, ProtectionManager.Action action, Location location) {
|
||||
allow(cp, action, location, true);
|
||||
}
|
||||
|
||||
private void allow(ClanPlayer cp, ProtectionManager.Action action, Location location, boolean notify) {
|
||||
for (Land land : getLands(cp, location)) {
|
||||
cp.allow(action, land.getId());
|
||||
}
|
||||
if (notify) {
|
||||
ChatBlock.sendMessageKey(cp.toPlayer(), "land.allowed.action");
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%container")
|
||||
@Description("{@@command.description.land.allow.container}")
|
||||
@CommandPermission("simpleclans.member.land.allow.container")
|
||||
public void container(Player player, ClanPlayer cp) {
|
||||
allow(cp, ProtectionManager.Action.CONTAINER, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%place")
|
||||
@Description("{@@command.description.land.allow.place}")
|
||||
@CommandPermission("simpleclans.member.land.allow.place")
|
||||
public void place(Player player, ClanPlayer cp) {
|
||||
allow(cp, ProtectionManager.Action.PLACE, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%damage")
|
||||
@Description("{@@command.description.land.allow.damage}")
|
||||
@CommandPermission("simpleclans.member.land.allow.damage")
|
||||
public void damage(Player player, ClanPlayer cp) {
|
||||
allow(cp, ProtectionManager.Action.DAMAGE, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%interact_entity")
|
||||
@Description("{@@command.description.land.allow.interact_entity}")
|
||||
@CommandPermission("simpleclans.member.land.allow.interact_entity")
|
||||
public void interactEntity(Player player, ClanPlayer cp) {
|
||||
allow(cp, ProtectionManager.Action.INTERACT_ENTITY, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%interact")
|
||||
@Description("{@@command.description.land.allow.interact}")
|
||||
@CommandPermission("simpleclans.member.land.allow.interact")
|
||||
public void interact(Player player, ClanPlayer cp) {
|
||||
allow(cp, ProtectionManager.Action.INTERACT, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%break")
|
||||
@Description("{@@command.description.land.allow.break}")
|
||||
@CommandPermission("simpleclans.member.land.allow.break")
|
||||
public void allowBreak(Player player, ClanPlayer cp) {
|
||||
allow(cp, ProtectionManager.Action.BREAK, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%all")
|
||||
@Description("{@@command.description.land.allow.all}")
|
||||
@CommandPermission("simpleclans.member.land.allow.all")
|
||||
public void all(Player player, ClanPlayer cp) {
|
||||
for (ProtectionManager.Action action : ProtectionManager.Action.values()) {
|
||||
allow(cp, action, player.getLocation(), false);
|
||||
}
|
||||
ChatBlock.sendMessageKey(player, "land.allowed.all.actions");
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%block")
|
||||
public class BlockCommand extends BaseCommand {
|
||||
|
||||
private void block(ClanPlayer cp, ProtectionManager.Action action, Location location) {
|
||||
block(cp, action, location, true);
|
||||
}
|
||||
|
||||
private void block(ClanPlayer cp, ProtectionManager.Action action, Location location, boolean notify) {
|
||||
for (Land land : getLands(cp, location)) {
|
||||
cp.disallow(action, land.getId());
|
||||
}
|
||||
if (notify) {
|
||||
ChatBlock.sendMessageKey(cp.toPlayer(), "land.blocked.action");
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%container")
|
||||
@Description("{@@command.description.land.block.container}")
|
||||
@CommandPermission("simpleclans.member.land.block.container")
|
||||
public void container(Player player, ClanPlayer cp) {
|
||||
block(cp, ProtectionManager.Action.CONTAINER, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%place")
|
||||
@Description("{@@command.description.land.block.place}")
|
||||
@CommandPermission("simpleclans.member.land.block.place")
|
||||
public void place(Player player, ClanPlayer cp) {
|
||||
block(cp, ProtectionManager.Action.PLACE, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%damage")
|
||||
@Description("{@@command.description.land.block.damage}")
|
||||
@CommandPermission("simpleclans.member.land.block.damage")
|
||||
public void damage(Player player, ClanPlayer cp) {
|
||||
block(cp, ProtectionManager.Action.DAMAGE, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%interact_entity")
|
||||
@Description("{@@command.description.land.block.interact_entity}")
|
||||
@CommandPermission("simpleclans.member.land.block.interact_entity")
|
||||
public void interactEntity(Player player, ClanPlayer cp) {
|
||||
block(cp, ProtectionManager.Action.INTERACT_ENTITY, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%interact")
|
||||
@Description("{@@command.description.land.block.interact}")
|
||||
@CommandPermission("simpleclans.member.land.block.interact")
|
||||
public void interact(Player player, ClanPlayer cp) {
|
||||
block(cp, ProtectionManager.Action.INTERACT, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%break")
|
||||
@Description("{@@command.description.land.block.break}")
|
||||
@CommandPermission("simpleclans.member.land.block.break")
|
||||
public void blockBreak(Player player, ClanPlayer cp) {
|
||||
block(cp, ProtectionManager.Action.BREAK, player.getLocation());
|
||||
}
|
||||
|
||||
@Subcommand("%all")
|
||||
@Description("{@@command.description.land.block.all}")
|
||||
@CommandPermission("simpleclans.member.land.block.all")
|
||||
public void all(Player player, ClanPlayer cp) {
|
||||
protection.getLandsAt(player.getLocation());
|
||||
for (ProtectionManager.Action action : ProtectionManager.Action.values()) {
|
||||
block(cp, action, player.getLocation(), false);
|
||||
}
|
||||
ChatBlock.sendMessageKey(player, "land.blocked.all.actions");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -102,8 +102,7 @@ public class LeaderCommands extends BaseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
clan.clanAnnounce(player.getName(), AQUA + lang("clan.has.been.disbanded", clan.getName()));
|
||||
clan.disband();
|
||||
clan.disband(player, true, false);
|
||||
}
|
||||
|
||||
@Subcommand("%verify")
|
||||
|
||||
@@ -5,9 +5,12 @@ import co.aikar.commands.annotation.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.commands.ClanPlayerInput;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.conversation.CreateRankNamePrompt;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.DeleteRankEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.PlayerRankUpdateEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.StorageManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.Conversation;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
@@ -37,11 +40,17 @@ public class RankCommand extends BaseCommand {
|
||||
@CommandPermission("simpleclans.leader.rank.assign")
|
||||
@CommandCompletion("@clan_members @ranks")
|
||||
@Description("{@@command.description.rank.assign}")
|
||||
public void assign(Player player,
|
||||
public void assign(ClanPlayer player,
|
||||
Clan clan,
|
||||
@Name("member") @Conditions("same_clan") ClanPlayerInput member,
|
||||
@Name("rank") Rank rank) {
|
||||
ClanPlayer memberInput = member.getClanPlayer();
|
||||
|
||||
PlayerRankUpdateEvent event = new PlayerRankUpdateEvent(player, memberInput, clan, clan.getRank(memberInput.getRankId()), rank);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
if (memberInput.getRankId().equals(rank.getName())) {
|
||||
ChatBlock.sendMessage(player, lang("player.already.has.that.rank", player));
|
||||
return;
|
||||
@@ -56,10 +65,16 @@ public class RankCommand extends BaseCommand {
|
||||
@CommandPermission("simpleclans.leader.rank.unassign")
|
||||
@CommandCompletion("@clan_members")
|
||||
@Description("{@@command.description.rank.unassign}")
|
||||
public void unassign(Player player, @Conditions("same_clan") @Name("member") ClanPlayerInput cp) {
|
||||
ClanPlayer cpInput = cp.getClanPlayer();
|
||||
cpInput.setRank(null);
|
||||
storage.updateClanPlayer(cpInput);
|
||||
public void unassign(ClanPlayer player, Clan clan, @Conditions("same_clan") @Name("member") ClanPlayerInput cp) {
|
||||
ClanPlayer memberInput = cp.getClanPlayer();
|
||||
|
||||
PlayerRankUpdateEvent event = new PlayerRankUpdateEvent(player, memberInput, clan, clan.getRank(memberInput.getRankId()), null);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
memberInput.setRank(null);
|
||||
storage.updateClanPlayer(memberInput);
|
||||
ChatBlock.sendMessage(player, AQUA + lang("player.unassigned.from.rank", player));
|
||||
}
|
||||
|
||||
@@ -78,9 +93,14 @@ public class RankCommand extends BaseCommand {
|
||||
@CommandCompletion("@ranks")
|
||||
@Description("{@@command.description.rank.delete}")
|
||||
public void delete(Player player, Clan clan, @Name("rank") Rank rank) {
|
||||
clan.deleteRank(rank.getName());
|
||||
storage.updateClan(clan, true);
|
||||
ChatBlock.sendMessage(player, AQUA + lang("rank.0.deleted", player, rank.getDisplayName()));
|
||||
DeleteRankEvent event = new DeleteRankEvent(player, clan, rank);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
clan.deleteRank(rank.getName());
|
||||
storage.updateClan(clan, true);
|
||||
ChatBlock.sendMessage(player, AQUA + lang("rank.0.deleted", player, rank.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%list")
|
||||
|
||||
+13
-6
@@ -3,12 +3,13 @@ package net.sacredlabyrinth.phaed.simpleclans.commands.completions;
|
||||
import co.aikar.commands.BukkitCommandCompletionContext;
|
||||
import co.aikar.commands.InvalidCommandArgument;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.VanishUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class NonMembersCompletion extends AbstractSyncCompletion {
|
||||
@@ -23,10 +24,16 @@ public class NonMembersCompletion extends AbstractSyncCompletion {
|
||||
|
||||
@Override
|
||||
public Collection<String> getCompletions(BukkitCommandCompletionContext c) throws InvalidCommandArgument {
|
||||
Player player = c.getPlayer();
|
||||
return Bukkit.getOnlinePlayers().stream()
|
||||
.filter(p -> clanManager.getClanByPlayerUniqueId(p.getUniqueId()) == null
|
||||
&& (player == null || player.canSee(p)))
|
||||
.map(Player::getName).collect(Collectors.toList());
|
||||
Collection<String> onlinePlayers = new ArrayList<>();
|
||||
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
boolean vanished = VanishUtils.isVanished(c.getSender(), onlinePlayer);
|
||||
if (clanManager.getClanByPlayerUniqueId(onlinePlayer.getUniqueId()) != null || (c.hasConfig("ignore_vanished") && vanished)) {
|
||||
continue;
|
||||
}
|
||||
onlinePlayers.add(onlinePlayer.getName());
|
||||
}
|
||||
|
||||
return onlinePlayers;
|
||||
}
|
||||
}
|
||||
+3
-4
@@ -1,10 +1,7 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.conditions;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.RequestManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class AbstractCondition implements IdentifiableCondition {
|
||||
@@ -14,6 +11,7 @@ public abstract class AbstractCondition implements IdentifiableCondition {
|
||||
protected final ClanManager clanManager;
|
||||
protected final RequestManager requestManager;
|
||||
protected final SettingsManager settingsManager;
|
||||
protected final ProtectionManager protectionManager;
|
||||
|
||||
public AbstractCondition(@NotNull SimpleClans plugin) {
|
||||
this.plugin = plugin;
|
||||
@@ -21,5 +19,6 @@ public abstract class AbstractCondition implements IdentifiableCondition {
|
||||
clanManager = plugin.getClanManager();
|
||||
requestManager = plugin.getRequestManager();
|
||||
settingsManager = plugin.getSettingsManager();
|
||||
protectionManager = plugin.getProtectionManager();
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.conditions;
|
||||
|
||||
import co.aikar.commands.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.commands.ClanInput;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
public class CanWarTargetCondition extends AbstractParameterCondition<ClanInput> {
|
||||
public CanWarTargetCondition(@NotNull SimpleClans plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<ClanInput> getType() {
|
||||
return ClanInput.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateCondition(ConditionContext<BukkitCommandIssuer> context, BukkitCommandExecutionContext execContext, ClanInput target) throws InvalidCommandArgument {
|
||||
BukkitCommandIssuer issuer = execContext.getIssuer();
|
||||
Clan issuerClan = Conditions.assertClanMember(clanManager, issuer);
|
||||
Clan targetClan = target.getClan();
|
||||
|
||||
if (!issuerClan.isRival(targetClan.getTag())) {
|
||||
throw new ConditionFailedException(lang("you.can.only.start.war.with.rivals", issuer));
|
||||
}
|
||||
|
||||
if (issuerClan.isWarring(targetClan)) {
|
||||
throw new ConditionFailedException(lang("clans.already.at.war", issuer));
|
||||
}
|
||||
|
||||
boolean isWarRequestEnabled = settingsManager.isWarRequestEnabled();
|
||||
int maxDifference = settingsManager.getMembersOnlineMaxDifference();
|
||||
|
||||
if (!isWarRequestEnabled && maxDifference >= 0) {
|
||||
int difference = Math.abs(issuerClan.getOnlineMembers().size() - targetClan.getOnlineMembers().size());
|
||||
if (difference > maxDifference)
|
||||
throw new ConditionFailedException(lang("you.cant.start.war.online.members.difference", issuer));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getId() {
|
||||
return "can_war_target";
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.conditions;
|
||||
|
||||
import co.aikar.commands.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class LandSharingCondition extends AbstractCommandCondition {
|
||||
|
||||
public LandSharingCondition(@NotNull SimpleClans plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateCondition(ConditionContext<BukkitCommandIssuer> context) throws InvalidCommandArgument {
|
||||
if (!settingsManager.isLandSharing()) {
|
||||
throw new ConditionFailedException(lang("land.sharing.disabled", context.getIssuer()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getId() {
|
||||
return "land_sharing";
|
||||
}
|
||||
}
|
||||
+11
-2
@@ -3,6 +3,8 @@ package net.sacredlabyrinth.phaed.simpleclans.commands.conditions;
|
||||
import co.aikar.commands.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.commands.ClanPlayerInput;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.VanishUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
@@ -21,9 +23,16 @@ public class OnlineCondition extends AbstractParameterCondition<ClanPlayerInput>
|
||||
|
||||
@Override
|
||||
public void validateCondition(ConditionContext<BukkitCommandIssuer> context, BukkitCommandExecutionContext execContext, ClanPlayerInput value) throws InvalidCommandArgument {
|
||||
if (value.getClanPlayer().toPlayer() == null) {
|
||||
throw new ConditionFailedException(lang("other.player.must.be.online", execContext.getSender()));
|
||||
Player player = value.getClanPlayer().toPlayer();
|
||||
|
||||
if (player != null) {
|
||||
boolean isVanished = VanishUtils.isVanished(execContext.getSender(), player);
|
||||
if (!isVanished || !context.hasConfig("ignore_vanished")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
throw new ConditionFailedException(lang("other.player.must.be.online", execContext.getSender()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.conditions;
|
||||
|
||||
import co.aikar.commands.BukkitCommandIssuer;
|
||||
import co.aikar.commands.ConditionContext;
|
||||
import co.aikar.commands.ConditionFailedException;
|
||||
import co.aikar.commands.InvalidCommandArgument;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class OwnLandCondition extends AbstractCommandCondition {
|
||||
public OwnLandCondition(@NotNull SimpleClans plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateCondition(ConditionContext<BukkitCommandIssuer> context) throws InvalidCommandArgument {
|
||||
Player player = Conditions.assertPlayer(context.getIssuer());
|
||||
if (protectionManager.getLands(player, player.getLocation()).isEmpty()) {
|
||||
throw new ConditionFailedException(lang("you.do.not.own.lands", player));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getId() {
|
||||
return "own_land";
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -18,9 +18,12 @@ public class ClanPlayerInputContextResolver extends AbstractInputOnlyContextReso
|
||||
@Override
|
||||
public ClanPlayerInput getContext(BukkitCommandExecutionContext context) throws InvalidCommandArgument {
|
||||
String arg = context.popFirstArg();
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(arg);
|
||||
ClanPlayer cp = clanManager.getCreateClanPlayer(offlinePlayer.getUniqueId());
|
||||
ClanPlayer cp = clanManager.getAnyClanPlayer(arg);
|
||||
if (cp == null) {
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(arg);
|
||||
cp = clanManager.getCreateClanPlayer(offlinePlayer.getUniqueId());
|
||||
}
|
||||
|
||||
return new ClanPlayerInput(cp);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.data;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.KDRFormat;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.VanishUtils;
|
||||
@@ -23,7 +24,7 @@ public class ClanProfile extends Sendable {
|
||||
String message = lang("clan.profile").replace("%clan_name%", clan.getName())
|
||||
.replace("%clan_color_tag%", clan.getColorTag())
|
||||
.replace("%clan_description%", getDescription())
|
||||
.replace("%clan_verified%", getVerifiedStatus())
|
||||
.replace("%clan_status%", Helper.getFormattedClanStatus(clan, sender))
|
||||
.replace("%clan_leaders%", clan.getLeadersString(sm.getPageLeaderColor(), subColor + ", "))
|
||||
.replace("%clan_online_count%", String.valueOf(VanishUtils.getNonVanished(sender, clan).size()))
|
||||
.replace("%clan_size%", String.valueOf(clan.getSize()))
|
||||
@@ -31,6 +32,7 @@ public class ClanProfile extends Sendable {
|
||||
.replace("%clan_rival_kills%", String.valueOf(clan.getTotalRival()))
|
||||
.replace("%clan_neutral_kills%", String.valueOf(clan.getTotalNeutral()))
|
||||
.replace("%clan_civilian_kills%", String.valueOf(clan.getTotalCivilian()))
|
||||
.replace("%clan_ally_kills%", String.valueOf(clan.getTotalAlly()))
|
||||
.replace("%clan_deaths%", String.valueOf(clan.getTotalDeaths()))
|
||||
.replace("%clan_fee_enabled%", getFeeEnabled())
|
||||
.replace("%clan_fee_value%", String.valueOf(clan.getMemberFee()))
|
||||
@@ -38,27 +40,15 @@ public class ClanProfile extends Sendable {
|
||||
.replace("%clan_rivals%", clan.getRivalString(subColor + ", "))
|
||||
.replace("%clan_founded%", clan.getFoundedString())
|
||||
.replace("%clan_inactive_days%", String.valueOf(clan.getInactiveDays()))
|
||||
.replace("%clan_max_inactive_days%", getMaxInactiveDays());
|
||||
.replace("%clan_max_inactive_days%", Helper.formatMaxInactiveDays(clan.getMaxInactiveDays()));
|
||||
sender.sendMessage(message);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getMaxInactiveDays() {
|
||||
return String.valueOf(clan.isVerified() ?
|
||||
sm.getPurgeClan() : sm.getPurgeUnverified());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getFeeEnabled() {
|
||||
return clan.isMemberFeeEnabled() ? lang("fee.enabled", sender) : lang("fee.disabled", sender);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getVerifiedStatus() {
|
||||
return clan.isVerified() ? sm.getPageTrustedColor() + lang("verified", sender) :
|
||||
sm.getPageUnTrustedColor() + lang("unverified", sender);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getDescription() {
|
||||
return clan.getDescription() != null && !clan.getDescription().isEmpty() ? clan.getDescription() :
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.data;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.KDRFormat;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -38,18 +39,19 @@ public class Lookup extends Sendable {
|
||||
String lookup = lang("player.lookup", sender)
|
||||
.replace("%player_name%", target.getName())
|
||||
.replace("%clan_name%", getClanName())
|
||||
.replace("%player_rank%", Helper.parseColors(target.getRankDisplayName()))
|
||||
.replace("%player_rank%", ChatUtils.parseColors(target.getRankDisplayName()))
|
||||
.replace("%player_status%", getPlayerStatus())
|
||||
.replace("%player_kdr%", KDRFormat.format(target.getKDR()))
|
||||
.replace("%player_rival_kills%", String.valueOf(target.getRivalKills()))
|
||||
.replace("%player_neutral_kills%", String.valueOf(target.getNeutralKills()))
|
||||
.replace("%player_civilian_kills%", String.valueOf(target.getCivilianKills()))
|
||||
.replace("%player_ally_kills%", String.valueOf(target.getAllyKills()))
|
||||
.replace("%player_deaths%", String.valueOf(target.getDeaths()))
|
||||
.replace("%player_join_date%", target.getJoinDateString())
|
||||
.replace("%player_last_seen%", target.getLastSeenString(sender))
|
||||
.replace("%player_past_clans%", target.getPastClansString(headColor + ", "))
|
||||
.replace("%player_inactive_days%", String.valueOf(target.getInactiveDays()))
|
||||
.replace("%player_max_inactive_days%", String.valueOf(sm.getPurgePlayers()))
|
||||
.replace("%player_max_inactive_days%", Helper.formatMaxInactiveDays(sm.getPurgePlayers()))
|
||||
.replace("%kill_type_line%", getKillTypeLine());
|
||||
sender.sendMessage(lookup);
|
||||
} else {
|
||||
@@ -84,7 +86,7 @@ public class Lookup extends Sendable {
|
||||
if (target.isTrusted()) {
|
||||
return sm.getPageTrustedColor() + lang("trusted", sender);
|
||||
}
|
||||
if (target.getRankId() != null && !target.getRankId().isEmpty()) {
|
||||
if (!target.getRankId().isEmpty()) {
|
||||
return sm.getPageTrustedColor() + lang("in.rank", sender);
|
||||
}
|
||||
return sm.getPageUnTrustedColor() + lang("untrusted", sender);
|
||||
@@ -98,8 +100,13 @@ public class Lookup extends Sendable {
|
||||
|
||||
if (targetClan == null) {
|
||||
killType = DARK_GRAY + lang("civilian", sender);
|
||||
} else if (senderClan != null && senderClan.isRival(targetClan.getTag())) {
|
||||
killType = WHITE + lang("rival", sender);
|
||||
} else if (senderClan != null) {
|
||||
if (senderClan.isRival(targetClan.getTag())) {
|
||||
killType = WHITE + lang("rival", sender);
|
||||
}
|
||||
if (senderClan.equals(targetClan) || senderClan.isAlly(targetClan.getTag())) {
|
||||
killType = RED + lang("ally", sender);
|
||||
}
|
||||
}
|
||||
|
||||
killTypeLine = lang("player.lookup.killtype", sender).replace("%player_kill_type%", killType);
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands.staff;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.EconomyResponse;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.commands.ClanInput;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ClanBalanceUpdateEvent;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import static net.md_5.bungee.api.ChatColor.RED;
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
import static org.bukkit.ChatColor.AQUA;
|
||||
|
||||
@CommandAlias("%clan")
|
||||
@Conditions("%basic_conditions")
|
||||
@Subcommand("%admin %bank")
|
||||
public class BankCommand extends BaseCommand {
|
||||
|
||||
@Subcommand("%status")
|
||||
@CommandPermission("simpleclans.admin.bank.status")
|
||||
@CommandCompletion("@clans")
|
||||
@Description("{@@command.description.bank.admin.status}")
|
||||
public void status(CommandSender sender, @Name("clan") ClanInput clanInput) {
|
||||
Clan clan = clanInput.getClan();
|
||||
ChatBlock.sendMessage(sender, AQUA + lang("clan.admin.balance", sender, clan.getName(), clan.getBalance()));
|
||||
}
|
||||
|
||||
@Subcommand("%take")
|
||||
@CommandPermission("simpleclans.admin.bank.take")
|
||||
@CommandCompletion("@clans")
|
||||
@Description("{@@command.description.bank.admin.take}")
|
||||
public void take(CommandSender sender, @Name("clan") ClanInput clanInput, @Name("amount") double amount) {
|
||||
Clan clan = clanInput.getClan();
|
||||
amount = Math.abs(amount);
|
||||
|
||||
EconomyResponse economyResponse = clan.withdraw(sender, ClanBalanceUpdateEvent.Cause.COMMAND, amount);
|
||||
switch (economyResponse) {
|
||||
case SUCCESS:
|
||||
ChatBlock.sendMessage(sender, AQUA + lang("clan.admin.take", sender, amount, clan.getName()));
|
||||
clan.addBb(sender.getName(), AQUA + lang("bb.clan.take", sender, amount));
|
||||
break;
|
||||
case NOT_ENOUGH_BALANCE:
|
||||
sender.sendMessage(RED + lang("clan.admin.bank.not.enough.money", sender, clan.getName()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%give")
|
||||
@CommandPermission("simpleclans.admin.bank.give")
|
||||
@CommandCompletion("@clans")
|
||||
@Description("{@@command.description.bank.admin.give}")
|
||||
public void give(CommandSender sender, @Name("clan") ClanInput clanInput, @Name("amount") double amount) {
|
||||
Clan clan = clanInput.getClan();
|
||||
amount = Math.abs(amount);
|
||||
|
||||
EconomyResponse economyResponse = clan.deposit(sender, ClanBalanceUpdateEvent.Cause.COMMAND, amount);
|
||||
if (economyResponse == EconomyResponse.SUCCESS) {
|
||||
ChatBlock.sendMessage(sender, AQUA + lang("clan.admin.give", sender, amount, clan.getName()));
|
||||
clan.addBb(sender.getName(), AQUA + lang("bb.clan.give", sender, amount));
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("%set")
|
||||
@CommandPermission("simpleclans.admin.bank.set")
|
||||
@CommandCompletion("@clans")
|
||||
@Description("{@@command.description.bank.admin.set}")
|
||||
public void set(CommandSender sender, @Name("clan") ClanInput clanInput, @Name("amount") double amount) {
|
||||
Clan clan = clanInput.getClan();
|
||||
amount = Math.abs(amount);
|
||||
|
||||
EconomyResponse response = clan.setBalance(sender, ClanBalanceUpdateEvent.Cause.COMMAND, amount);
|
||||
if (response == EconomyResponse.SUCCESS) {
|
||||
ChatBlock.sendMessage(sender, AQUA + lang("clan.admin.set", sender, clan.getName(), amount));
|
||||
clan.addBb(sender.getName(), AQUA + lang("bb.clan.set", sender, amount));
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-5
@@ -60,8 +60,7 @@ public class StaffCommands extends BaseCommand {
|
||||
ChatBlock.sendMessage(sender, lang("player.already.in.this.clan", sender));
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldClan.isLeader(player) && oldClan.getLeaders().size() <= 1) {
|
||||
if (!oldClan.isPermanent() && oldClan.isLeader(player) && oldClan.getLeaders().size() <= 1) {
|
||||
ChatBlock.sendMessage(sender, RED + lang("you.cannot.move.the.last.leader", sender));
|
||||
return;
|
||||
} else {
|
||||
@@ -245,7 +244,7 @@ public class StaffCommands extends BaseCommand {
|
||||
|
||||
Clan clan = player.getClanPlayer().getClan();
|
||||
if (clan != null && clan.getMembers().size() == 1) {
|
||||
clan.disband();
|
||||
clan.disband(sender, false, false);
|
||||
}
|
||||
cm.deleteClanPlayer(player.getClanPlayer());
|
||||
ChatBlock.sendMessage(sender, AQUA + lang("player.purged", sender));
|
||||
@@ -273,8 +272,7 @@ public class StaffCommands extends BaseCommand {
|
||||
@CommandPermission("simpleclans.mod.disband")
|
||||
@Description("{@@command.description.mod.disband}")
|
||||
public void disband(CommandSender sender, @Name("clan") ClanInput clan) {
|
||||
cm.serverAnnounce(AQUA + lang("clan.has.been.disbanded", clan.getClan().getName()));
|
||||
clan.getClan().disband();
|
||||
clan.getClan().disband(sender, true, true);
|
||||
}
|
||||
|
||||
@Subcommand("%admin %promote")
|
||||
@@ -335,4 +333,15 @@ public class StaffCommands extends BaseCommand {
|
||||
cm.resetKdr(cp);
|
||||
ChatBlock.sendMessage(sender, RED + lang("you.have.reseted.0.kdr", sender, cp.getName()));
|
||||
}
|
||||
|
||||
@Subcommand("%admin %permanent")
|
||||
@CommandCompletion("@clans")
|
||||
@CommandPermission("simpleclans.admin.permanent")
|
||||
@Description("{@@command.description.admin.permanent}")
|
||||
public void togglePermanent(CommandSender sender, @Name("clan") ClanInput clan) {
|
||||
boolean permanent = !clan.getClan().isPermanent();
|
||||
clan.getClan().setPermanent(permanent);
|
||||
clan.getClan().addBb(sender.getName(), lang((permanent) ? "permanent.status.enabled" : "permanent.status.disabled", sender.getName()));
|
||||
ChatBlock.sendMessage(sender, AQUA + lang("you.have.toggled.permanent.status", sender, clan.getClan().getName()));
|
||||
}
|
||||
}
|
||||
+5
-4
@@ -2,9 +2,10 @@ package net.sacredlabyrinth.phaed.simpleclans.conversation;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.PreCreateClanEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
@@ -83,13 +84,13 @@ public class CreateClanNamePrompt extends StringPrompt {
|
||||
@Nullable
|
||||
private Prompt validateName(@NotNull SimpleClans plugin, @NotNull Player player, @NotNull String input) {
|
||||
boolean bypass = plugin.getPermissionsManager().has(player, "simpleclans.mod.bypass");
|
||||
if (bypass) {
|
||||
if (Helper.stripColors(input).length() > plugin.getSettingsManager().getClanMaxLength()) {
|
||||
if (!bypass) {
|
||||
if (ChatUtils.stripColors(input).length() > plugin.getSettingsManager().getClanMaxLength()) {
|
||||
return new MessagePromptImpl(ChatColor.RED +
|
||||
lang("your.clan.name.cannot.be.longer.than.characters", player,
|
||||
plugin.getSettingsManager().getClanMaxLength()), this);
|
||||
}
|
||||
if (Helper.stripColors(input).length() <= plugin.getSettingsManager().getClanMinLength()) {
|
||||
if (ChatUtils.stripColors(input).length() <= plugin.getSettingsManager().getClanMinLength()) {
|
||||
return new MessagePromptImpl(ChatColor.RED +
|
||||
lang("your.clan.name.must.be.longer.than.characters", player,
|
||||
plugin.getSettingsManager().getClanMinLength()), this);
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.conversation;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.TagValidator;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
@@ -46,7 +46,7 @@ public class CreateClanTagPrompt extends StringPrompt {
|
||||
|
||||
@Nullable
|
||||
private Prompt validateTag(SimpleClans plugin, Player player, @NotNull String clanTag) {
|
||||
String cleanTag = Helper.stripColors(clanTag);
|
||||
String cleanTag = ChatUtils.stripColors(clanTag);
|
||||
if (plugin.getClanManager().isClan(cleanTag)) {
|
||||
return new MessagePromptImpl(ChatColor.RED +
|
||||
lang("clan.with.this.tag.already.exists", player), this);
|
||||
|
||||
+12
-1
@@ -2,6 +2,9 @@ package net.sacredlabyrinth.phaed.simpleclans.conversation;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.CreateRankEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.PreCreateRankEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
@@ -27,11 +30,19 @@ public class CreateRankNamePrompt extends StringPrompt {
|
||||
if (input == null) return this;
|
||||
|
||||
String rank = input.toLowerCase().replace(" ", "_");
|
||||
PreCreateRankEvent event = new PreCreateRankEvent(player, clan, rank);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
rank = event.getRankName();
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
if (clan.hasRank(rank)) {
|
||||
return new MessagePromptImpl(ChatColor.RED + lang("rank.already.exists", player), this);
|
||||
}
|
||||
|
||||
|
||||
clan.createRank(rank);
|
||||
Bukkit.getServer().getPluginManager().callEvent(new CreateRankEvent(player, clan, clan.getRank(rank)));
|
||||
plugin.getStorageManager().updateClan(clan, true);
|
||||
return new MessagePromptImpl(ChatColor.AQUA + lang("rank.created", player));
|
||||
}
|
||||
|
||||
+11
-16
@@ -1,9 +1,5 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.conversation;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
@@ -15,10 +11,13 @@ import org.bukkit.conversations.StringPrompt;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class ResignPrompt extends StringPrompt {
|
||||
@@ -35,26 +34,22 @@ public class ResignPrompt extends StringPrompt {
|
||||
if (clan == null) {
|
||||
return END_OF_CONVERSATION;
|
||||
}
|
||||
|
||||
|
||||
if (yes.equalsIgnoreCase(input)) {
|
||||
if (!clan.isLeader(player) || clan.getLeaders().size() > 1) {
|
||||
if (clan.isPermanent() || !clan.isLeader(player) || clan.getLeaders().size() > 1) {
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + lang("0.has.resigned", player.getName()));
|
||||
cp.addResignTime(clan.getTag());
|
||||
clan.removePlayerFromClan(player.getUniqueId());
|
||||
|
||||
|
||||
return new MessagePromptImpl(ChatColor.AQUA + lang("resign.success", player));
|
||||
} else if (clan.isLeader(player) && clan.getLeaders().size() == 1) {
|
||||
clan.disband();
|
||||
String msgKey = "clan.has.been.disbanded";
|
||||
//message for the server
|
||||
plugin.getClanManager().serverAnnounce(ChatColor.AQUA + lang(msgKey, clan.getName()));
|
||||
//message for the player
|
||||
return new MessagePromptImpl(ChatColor.AQUA + lang(msgKey, player, clan.getName()));
|
||||
clan.disband(player, true, false);
|
||||
return null;
|
||||
} else {
|
||||
return new MessagePromptImpl(ChatColor.RED + lang("last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan", player));
|
||||
}
|
||||
} else {
|
||||
return new MessagePromptImpl(ChatColor.RED + lang("resign.request.cancelled", player));
|
||||
return new MessagePromptImpl(ChatColor.RED + lang("resign.request.cancelled", player));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +58,7 @@ public class ResignPrompt extends StringPrompt {
|
||||
Player player = (Player) cc.getForWhom();
|
||||
return ChatColor.RED + MessageFormat.format(
|
||||
lang("resign.confirmation", player), Arrays.asList(
|
||||
lang("resign.yes", player), lang("resign.no", player)));
|
||||
lang("resign.yes", player), lang("resign.no", player)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,10 @@ import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link ClanBalanceUpdateEvent}
|
||||
*/
|
||||
@Deprecated
|
||||
public class BankDepositEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
@@ -7,6 +7,10 @@ import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link ClanBalanceUpdateEvent}
|
||||
*/
|
||||
@Deprecated
|
||||
public class BankWithdrawEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private final Clan clan;
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class ClanBalanceUpdateEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
private final CommandSender updater;
|
||||
private final Clan clan;
|
||||
private final Cause cause;
|
||||
private final double balance;
|
||||
private double newBalance;
|
||||
private boolean cancelled;
|
||||
|
||||
public ClanBalanceUpdateEvent(@Nullable CommandSender updater,
|
||||
@NotNull Clan clan,
|
||||
double balance,
|
||||
double newBalance,
|
||||
@NotNull Cause cause) {
|
||||
this.updater = updater;
|
||||
this.balance = balance;
|
||||
this.newBalance = newBalance;
|
||||
this.clan = clan;
|
||||
this.cause = cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the balance updater, may be null
|
||||
*/
|
||||
public @Nullable CommandSender getUpdater() {
|
||||
return updater;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Clan involved
|
||||
*/
|
||||
public @NotNull Clan getClan() {
|
||||
return clan;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Clan's current balance
|
||||
*/
|
||||
public double getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Clan's new balance
|
||||
*/
|
||||
public double getNewBalance() {
|
||||
return newBalance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Clan's new balance
|
||||
*
|
||||
* @param newBalance the new balance
|
||||
* @throws IllegalArgumentException if newBalance is negative
|
||||
*/
|
||||
public void setNewBalance(double newBalance) {
|
||||
if (newBalance < 0) {
|
||||
throw new IllegalArgumentException("newBalance cannot be negative");
|
||||
}
|
||||
this.newBalance = newBalance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the update cause
|
||||
*/
|
||||
public @NotNull Cause getCause() {
|
||||
return cause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws IllegalStateException if the cause of the event is {@link Cause#REVERT}
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean isCancelled) {
|
||||
if (getCause() == Cause.REVERT) {
|
||||
throw new IllegalStateException("cannot cancel REVERT update");
|
||||
}
|
||||
this.cancelled = isCancelled;
|
||||
}
|
||||
|
||||
public enum Cause {
|
||||
UPKEEP,
|
||||
MEMBER_FEE,
|
||||
/**
|
||||
* When a command such as /clan bank deposit causes the update
|
||||
*/
|
||||
COMMAND,
|
||||
/**
|
||||
* When the balance is updated via API methods
|
||||
*/
|
||||
API,
|
||||
/**
|
||||
* When the clan data is being loaded and the balance is set, usually on server start up or plugin reload
|
||||
*/
|
||||
LOADING,
|
||||
/**
|
||||
* When a failed deposit is being refunded, cannot be cancelled
|
||||
*/
|
||||
REVERT
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Rank;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Minat0_
|
||||
*/
|
||||
public class CreateRankEvent extends PlayerEvent {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
private final Rank rank;
|
||||
private final Clan clan;
|
||||
|
||||
public CreateRankEvent(Player who, Clan clan, Rank rank) {
|
||||
super(who);
|
||||
this.clan = clan;
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Rank getRank() {
|
||||
return rank;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Clan getClan() {
|
||||
return clan;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Rank;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Minat0_
|
||||
*/
|
||||
public class DeleteRankEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
private final Rank rank;
|
||||
private final Clan clan;
|
||||
private boolean cancelled;
|
||||
|
||||
public DeleteRankEvent(Player who, Clan clan, Rank rank) {
|
||||
super(who);
|
||||
this.rank = rank;
|
||||
this.clan = clan;
|
||||
}
|
||||
|
||||
public Rank getRank() {
|
||||
return rank;
|
||||
}
|
||||
|
||||
public Clan getClan() {
|
||||
return clan;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Rank;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Minat0_
|
||||
*/
|
||||
public class PlayerRankUpdateEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
private final ClanPlayer target;
|
||||
private final ClanPlayer issuer;
|
||||
|
||||
private final Rank oldRank;
|
||||
private final Rank newRank;
|
||||
private final Clan clan;
|
||||
private boolean cancelled;
|
||||
|
||||
public PlayerRankUpdateEvent(@NotNull ClanPlayer issuer, @NotNull ClanPlayer target, @NotNull Clan clan,
|
||||
@Nullable Rank oldRank, @Nullable Rank newRank) {
|
||||
this.target = target;
|
||||
this.issuer = issuer;
|
||||
this.oldRank = oldRank;
|
||||
this.clan = clan;
|
||||
this.newRank = newRank;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Rank getOldRank() {
|
||||
return oldRank;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Clan getClan() {
|
||||
return clan;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Rank getNewRank() {
|
||||
return newRank;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ClanPlayer getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ClanPlayer getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean isCancelled) {
|
||||
this.cancelled = isCancelled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Minat0_
|
||||
*/
|
||||
public class PreCreateRankEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
private String rankName;
|
||||
private final Clan clan;
|
||||
private boolean cancelled;
|
||||
|
||||
public PreCreateRankEvent(Player who, Clan clan, String rankName) {
|
||||
super(who);
|
||||
this.clan = clan;
|
||||
this.rankName = rankName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Clan getClan() {
|
||||
return clan;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getRankName() {
|
||||
return rankName;
|
||||
}
|
||||
|
||||
public void setRankName(@NotNull String rankName) {
|
||||
this.rankName = rankName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean isCancelled) {
|
||||
this.cancelled = isCancelled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.War;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class WarEndEvent extends Event {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
private final War war;
|
||||
private final Reason reason;
|
||||
|
||||
public WarEndEvent(@NotNull War war, @NotNull Reason reason) {
|
||||
this.war = war;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public War getWar() {
|
||||
return war;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Reason getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public enum Reason {
|
||||
REQUEST, EXPIRATION
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.events;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.War;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class WarStartEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
private final War war;
|
||||
private boolean cancel;
|
||||
|
||||
public WarStartEvent(@NotNull War war) {
|
||||
this.war = war;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public War getWar() {
|
||||
return war;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.papi.resolvers;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.papi.PlaceholderResolver;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.KDRFormat;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class KdrResolver extends PlaceholderResolver {
|
||||
public KdrResolver(@NotNull SimpleClans plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getId() {
|
||||
return "kdr";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String resolve(@Nullable OfflinePlayer player, @NotNull Object object, @NotNull Method method,
|
||||
@NotNull String placeholder, @NotNull Map<String, String> config) {
|
||||
Object result = invoke(object, method, placeholder);
|
||||
if (result instanceof Number) {
|
||||
return KDRFormat.format(((Number) result).floatValue());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Land {
|
||||
|
||||
private final String id;
|
||||
private final Set<UUID> owners;
|
||||
|
||||
public Land(@NotNull String id, @NotNull Set<UUID> owners) {
|
||||
this.id = id;
|
||||
this.owners = owners;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UUID> getOwners() {
|
||||
return owners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Land land = (Land) o;
|
||||
return id.equals(land.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface ProtectionProvider {
|
||||
|
||||
void setup();
|
||||
|
||||
@NotNull
|
||||
Set<Land> getLandsAt(@NotNull Location location);
|
||||
|
||||
@NotNull
|
||||
Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world);
|
||||
|
||||
@NotNull
|
||||
String getIdPrefix();
|
||||
|
||||
void deleteLand(@NotNull String id, @NotNull World world);
|
||||
|
||||
@Nullable Class<? extends Event> getCreateLandEvent();
|
||||
|
||||
@Nullable
|
||||
Player getPlayer(Event event);
|
||||
|
||||
@Nullable
|
||||
String getRequiredPluginName();
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection.providers;
|
||||
|
||||
import me.ryanhamshire.GriefPrevention.Claim;
|
||||
import me.ryanhamshire.GriefPrevention.DataStore;
|
||||
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
||||
import me.ryanhamshire.GriefPrevention.events.ClaimCreatedEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class GriefPreventionProvider implements ProtectionProvider {
|
||||
|
||||
@Override
|
||||
public void setup() {}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsAt(@NotNull Location location) {
|
||||
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, true, null);
|
||||
if (claim == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
return Collections.singleton(getLand(claim));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Land getLand(@Nullable Claim claim) {
|
||||
if (claim == null) {
|
||||
return null;
|
||||
}
|
||||
return new Land(getIdPrefix() + claim.getID().toString(), Collections.singleton(claim.getOwnerID()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world) {
|
||||
HashSet<Land> lands = new HashSet<>();
|
||||
for (Claim claim : GriefPrevention.instance.dataStore.getPlayerData(player.getUniqueId()).getClaims()) {
|
||||
if (claim == null) {
|
||||
continue;
|
||||
}
|
||||
lands.add(getLand(claim));
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdPrefix() {
|
||||
return "gp";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLand(@NotNull String id, @NotNull World world) {
|
||||
DataStore dataStore = GriefPrevention.instance.dataStore;
|
||||
Claim claim = dataStore.getClaim(Long.parseLong(id.replaceFirst(getIdPrefix(), "")));
|
||||
if (claim != null) {
|
||||
dataStore.deleteClaim(claim);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Class<? extends Event> getCreateLandEvent() {
|
||||
return ClaimCreatedEvent.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Player getPlayer(Event event) {
|
||||
if (event instanceof ClaimCreatedEvent) {
|
||||
if (((ClaimCreatedEvent) event).getCreator() instanceof Player) {
|
||||
return ((Player) ((ClaimCreatedEvent) event).getCreator());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getRequiredPluginName() {
|
||||
return "GriefPrevention";
|
||||
}
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection.providers;
|
||||
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.plotsquared.bukkit.events.PlayerClaimPlotEvent;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class PlotSquared3Provider implements ProtectionProvider {
|
||||
|
||||
private Method getLocation;
|
||||
private Method getPlots;
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
try {
|
||||
Class.forName("com.intellectualcrafters.plot.object.Location");
|
||||
Class.forName("com.intellectualcrafters.plot.object.Plot");
|
||||
getLocation = BukkitUtil.class.getMethod("getLocation", Location.class);
|
||||
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsAt(@NotNull Location location) {
|
||||
Plot plot = getPlot(location);
|
||||
if (plot != null) {
|
||||
return Collections.singleton(getLand(plot));
|
||||
}
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
private @Nullable Plot getPlot(@NotNull Location location) {
|
||||
try {
|
||||
return Plot.getPlot((com.intellectualcrafters.plot.object.Location) getLocation.invoke(null, location));
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Land getLand(@NotNull Plot plot) {
|
||||
String id = getIdPrefix() + plot.getId().toString();
|
||||
return new Land(id, plot.getOwners());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world) {
|
||||
Set<Plot> plots = PS.get().getPlots(world.getName(), player.getUniqueId());
|
||||
|
||||
return plots.stream().map(this::getLand).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdPrefix() {
|
||||
return "ps";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLand(@NotNull String id, @NotNull World world) {
|
||||
id = id.replace(getIdPrefix(), "");
|
||||
Collection<Plot> plots = PS.get().getPlots(world.getName());
|
||||
for (Plot plot : plots) {
|
||||
if (plot.getId().toString().equals(id)) {
|
||||
plot.deletePlot(null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Class<? extends Event> getCreateLandEvent() {
|
||||
return PlayerClaimPlotEvent.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Player getPlayer(Event event) {
|
||||
if (event instanceof PlayerClaimPlotEvent) {
|
||||
return ((PlayerClaimPlotEvent) event).getPlayer();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getRequiredPluginName() {
|
||||
return "PlotSquared";
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection.providers;
|
||||
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class PlotSquared5Provider implements ProtectionProvider {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsAt(@NotNull Location location) {
|
||||
Plot plot = BukkitUtil.getPlot(location);
|
||||
if (plot != null) {
|
||||
return Collections.singleton(getLand(plot));
|
||||
}
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Land getLand(@NotNull Plot plot) {
|
||||
return new Land(getIdPrefix() + plot.getId().toString(), plot.getOwners());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world) {
|
||||
Set<Plot> plots = PlotSquared.get().getPlots(world.getName(), player.getUniqueId());
|
||||
return plots.stream().map(this::getLand).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdPrefix() {
|
||||
return "ps";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLand(@NotNull String id, @NotNull World world) {
|
||||
id = id.replace(getIdPrefix(), "");
|
||||
for (Plot plot : PlotSquared.get().getPlots(world.getName())) {
|
||||
if (plot.getId().toString().equals(id)) {
|
||||
plot.deletePlot(null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Class<? extends Event> getCreateLandEvent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Player getPlayer(Event event) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getRequiredPluginName() {
|
||||
return "PlotSquared";
|
||||
}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection.providers;
|
||||
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class WorldGuard6Provider implements ProtectionProvider {
|
||||
|
||||
private WorldGuardPlugin worldGuard;
|
||||
private Method getRegionManager;
|
||||
private Method getApplicableRegions;
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
worldGuard = WorldGuardPlugin.inst();
|
||||
try {
|
||||
getRegionManager = worldGuard.getClass().getMethod("getRegionManager", World.class);
|
||||
//noinspection JavaReflectionMemberAccess
|
||||
getApplicableRegions = RegionManager.class.getMethod("getApplicableRegions", Location.class);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private @Nullable RegionManager getRegionManager(@Nullable World world) {
|
||||
if (world != null) {
|
||||
try {
|
||||
return (RegionManager) getRegionManager.invoke(worldGuard, world);
|
||||
} catch (IllegalAccessException | InvocationTargetException ignored) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Set<ProtectedRegion> getApplicableRegions(RegionManager regionManager, Location location) {
|
||||
try {
|
||||
return ((ApplicableRegionSet) getApplicableRegions.invoke(regionManager, location)).getRegions();
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Land getLand(ProtectedRegion region) {
|
||||
return new Land(getIdPrefix() + region.getId(), region.getOwners().getUniqueIds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsAt(@NotNull Location location) {
|
||||
HashSet<Land> lands = new HashSet<>();
|
||||
RegionManager regionManager = getRegionManager(location.getWorld());
|
||||
|
||||
if (regionManager != null) {
|
||||
for (ProtectedRegion region : getApplicableRegions(regionManager, location)) {
|
||||
lands.add(getLand(region));
|
||||
}
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world) {
|
||||
HashSet<Land> lands = new HashSet<>();
|
||||
RegionManager regionManager = getRegionManager(world);
|
||||
|
||||
if (regionManager != null) {
|
||||
for (ProtectedRegion region : regionManager.getRegions().values()) {
|
||||
if (!region.getOwners().getUniqueIds().contains(player.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
lands.add(getLand(region));
|
||||
}
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdPrefix() {
|
||||
return "wg";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLand(@NotNull String id, @NotNull World world) {
|
||||
id = id.replaceFirst(getIdPrefix(), "");
|
||||
RegionManager regionManager = getRegionManager(world);
|
||||
if (regionManager != null) {
|
||||
regionManager.removeRegion(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Class<? extends Event> getCreateLandEvent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Player getPlayer(Event event) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getRequiredPluginName() {
|
||||
return "WorldGuard";
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.hooks.protection.providers;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import com.sk89q.worldguard.protection.regions.RegionContainer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings({"unused"})
|
||||
public class WorldGuardProvider implements ProtectionProvider {
|
||||
|
||||
private RegionContainer regionContainer;
|
||||
|
||||
public void setup() {
|
||||
regionContainer = WorldGuard.getInstance().getPlatform().getRegionContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsAt(@NotNull Location location) {
|
||||
RegionManager regionManager = getRegionManager(location.getWorld());
|
||||
if (regionManager == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
ApplicableRegionSet regions = regionManager.getApplicableRegions(BukkitAdapter.asBlockVector(location));
|
||||
Set<Land> lands = new HashSet<>();
|
||||
for (ProtectedRegion region : regions) {
|
||||
lands.add(getLand(region));
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Land getLand(ProtectedRegion region) {
|
||||
return new Land(getIdPrefix() + region.getId(), region.getOwners().getUniqueIds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world) {
|
||||
HashSet<Land> lands = new HashSet<>();
|
||||
RegionManager regionManager = getRegionManager(world);
|
||||
if (regionManager != null) {
|
||||
for (ProtectedRegion region : regionManager.getRegions().values()) {
|
||||
if (region.getOwners().contains(player.getUniqueId())) {
|
||||
lands.add(getLand(region));
|
||||
}
|
||||
}
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdPrefix() {
|
||||
return "wg";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLand(@NotNull String id, @NotNull World world) {
|
||||
id = id.replaceFirst(getIdPrefix(), "");
|
||||
RegionManager regionManager = getRegionManager(world);
|
||||
if (regionManager != null) {
|
||||
regionManager.removeRegion(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Class<? extends Event> getCreateLandEvent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Player getPlayer(Event event) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private RegionManager getRegionManager(@Nullable World world) {
|
||||
if (world == null) {
|
||||
return null;
|
||||
}
|
||||
return regionContainer.get(BukkitAdapter.adapt(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getRequiredPluginName() {
|
||||
return "WorldGuard";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.listeners;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ProtectionManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.managers.ProtectionManager.Action.*;
|
||||
|
||||
public class LandProtection implements Listener {
|
||||
|
||||
private final SimpleClans plugin;
|
||||
private final ProtectionManager protectionManager;
|
||||
private final ClanManager clanManager;
|
||||
private final SettingsManager settingsManager;
|
||||
private final EventPriority priority;
|
||||
|
||||
public LandProtection(@NotNull SimpleClans plugin) {
|
||||
this.plugin = plugin;
|
||||
protectionManager = plugin.getProtectionManager();
|
||||
clanManager = plugin.getClanManager();
|
||||
settingsManager = plugin.getSettingsManager();
|
||||
priority = settingsManager.getWarListenerPriority();
|
||||
}
|
||||
|
||||
public void registerListeners() {
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
registerBlockBreakListener();
|
||||
registerBlockPlaceListener();
|
||||
registerEntityDamageListener();
|
||||
registerInteractEntityListener();
|
||||
registerInteractListener();
|
||||
registerInventoryOpenListener();
|
||||
}
|
||||
|
||||
public void registerCreateLandEvent(ProtectionProvider provider, @Nullable Class<? extends Event> createLandEvent) {
|
||||
if (createLandEvent == null) return;
|
||||
Bukkit.getPluginManager().registerEvent(createLandEvent, this, EventPriority.NORMAL, (listener, event) -> {
|
||||
if (!createLandEvent.isInstance(createLandEvent)) {
|
||||
return;
|
||||
}
|
||||
Player player = provider.getPlayer(event);
|
||||
if (player == null) return;
|
||||
Clan clan = clanManager.getClanByPlayerUniqueId(player.getUniqueId());
|
||||
if ((clan == null || !clan.isLeader(player)) && settingsManager.isOnlyLeadersCanCreateLands()) {
|
||||
cancelWithMessage(player, event, "only.leaders.can.create.lands");
|
||||
return;
|
||||
}
|
||||
if (settingsManager.isOnlyOneLandPerClan()) {
|
||||
if (clan == null) {
|
||||
cancelWithMessage(player, event, "only.clan.members.can.create.lands");
|
||||
return;
|
||||
}
|
||||
for (ClanPlayer member : clan.getMembers()) {
|
||||
Set<Land> lands = protectionManager.getLandsOf(Bukkit.getOfflinePlayer(member.getUniqueId()), player.getWorld());
|
||||
if (lands.size() > 0) {
|
||||
cancelWithMessage(player, event, "only.one.land.per.clan");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, plugin, true);
|
||||
}
|
||||
|
||||
private void cancelWithMessage(Player player, Event event, String messageKey) {
|
||||
if (!(event instanceof Cancellable)) {
|
||||
return;
|
||||
}
|
||||
ChatBlock.sendMessageKey(player, messageKey);
|
||||
((Cancellable) event).setCancelled(true);
|
||||
}
|
||||
|
||||
private void registerBlockBreakListener() {
|
||||
Bukkit.getPluginManager().registerEvent(BlockBreakEvent.class, this, priority, (listener, event) -> {
|
||||
if (!(event instanceof BlockBreakEvent)) {
|
||||
return;
|
||||
}
|
||||
BlockBreakEvent blockBreakEvent = (BlockBreakEvent) event;
|
||||
if (protectionManager.can(BREAK, blockBreakEvent.getBlock().getLocation(), blockBreakEvent.getPlayer())) {
|
||||
blockBreakEvent.setCancelled(false);
|
||||
}
|
||||
}, plugin, false);
|
||||
}
|
||||
|
||||
private void registerBlockPlaceListener() {
|
||||
Bukkit.getPluginManager().registerEvent(BlockPlaceEvent.class, this, priority, (listener, event) -> {
|
||||
if (!(event instanceof BlockPlaceEvent)) {
|
||||
return;
|
||||
}
|
||||
BlockPlaceEvent blockPlaceEvent = (BlockPlaceEvent) event;
|
||||
Block block = blockPlaceEvent.getBlock();
|
||||
if (settingsManager.getIgnoredList(PLACE).contains(block.getType().name())) {
|
||||
return;
|
||||
}
|
||||
if (protectionManager.can(PLACE, block.getLocation(), blockPlaceEvent.getPlayer())) {
|
||||
blockPlaceEvent.setCancelled(false);
|
||||
}
|
||||
}, plugin, false);
|
||||
}
|
||||
|
||||
private void registerEntityDamageListener() {
|
||||
Bukkit.getPluginManager().registerEvent(EntityDamageByEntityEvent.class, this, priority,
|
||||
(listener, event) -> {
|
||||
if (!(event instanceof EntityDamageByEntityEvent)) {
|
||||
return;
|
||||
}
|
||||
EntityDamageByEntityEvent entityEvent = (EntityDamageByEntityEvent) event;
|
||||
if (!(entityEvent.getDamager() instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
Player attacker = ((Player) entityEvent.getDamager());
|
||||
Player victim = entityEvent.getEntity() instanceof Player ? ((Player) entityEvent.getEntity()) : null;
|
||||
if (protectionManager.can(DAMAGE, entityEvent.getEntity().getLocation(), attacker, victim)) {
|
||||
entityEvent.setCancelled(false);
|
||||
}
|
||||
}, plugin, false);
|
||||
}
|
||||
|
||||
private void registerInteractEntityListener() {
|
||||
Bukkit.getPluginManager().registerEvent(PlayerInteractEntityEvent.class, this, priority, (listener, event) -> {
|
||||
if (!(event instanceof PlayerInteractEntityEvent)) {
|
||||
return;
|
||||
}
|
||||
PlayerInteractEntityEvent interactEvent = (PlayerInteractEntityEvent) event;
|
||||
if (protectionManager.can(INTERACT_ENTITY, interactEvent.getRightClicked().getLocation(), interactEvent.getPlayer())) {
|
||||
interactEvent.setCancelled(false);
|
||||
}
|
||||
}, plugin, false);
|
||||
}
|
||||
|
||||
private void registerInventoryOpenListener() {
|
||||
Bukkit.getPluginManager().registerEvent(InventoryOpenEvent.class, this, priority, (l, e) -> {
|
||||
if (!(e instanceof InventoryOpenEvent)) {
|
||||
return;
|
||||
}
|
||||
InventoryOpenEvent event = ((InventoryOpenEvent) e);
|
||||
InventoryHolder holder = event.getInventory().getHolder();
|
||||
Location location = getLocation(holder);
|
||||
if (holder instanceof Entity && holder == event.getPlayer()) return;
|
||||
if (location == null) return;
|
||||
|
||||
if (protectionManager.can(CONTAINER, location, ((Player) event.getPlayer()))) {
|
||||
event.setCancelled(false);
|
||||
}
|
||||
}, plugin, false);
|
||||
}
|
||||
|
||||
private void registerInteractListener() {
|
||||
Bukkit.getPluginManager().registerEvent(PlayerInteractEvent.class, this, priority, (listener, event) -> {
|
||||
if (!(event instanceof PlayerInteractEvent)) {
|
||||
return;
|
||||
}
|
||||
PlayerInteractEvent interactEvent = (PlayerInteractEvent) event;
|
||||
if (interactEvent.getClickedBlock() == null) {
|
||||
return;
|
||||
}
|
||||
ProtectionManager.Action action = getInteractEventAction(interactEvent);
|
||||
if (protectionManager.can(action, interactEvent.getClickedBlock().getLocation(), interactEvent.getPlayer())) {
|
||||
interactEvent.setUseInteractedBlock(Event.Result.ALLOW);
|
||||
interactEvent.setUseItemInHand(Event.Result.ALLOW);
|
||||
interactEvent.setCancelled(false);
|
||||
}
|
||||
}, plugin, false);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onBreak(BlockBreakEvent event) {
|
||||
if (protectionManager.can(BREAK, event.getBlock().getLocation(), event.getPlayer())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlace(BlockPlaceEvent event) {
|
||||
Block block = event.getBlock();
|
||||
if (settingsManager.getIgnoredList(PLACE).contains(block.getType().name())) {
|
||||
return;
|
||||
}
|
||||
if (protectionManager.can(PLACE, block.getLocation(), event.getPlayer())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onDamage(EntityDamageByEntityEvent event) {
|
||||
Entity damager = event.getDamager();
|
||||
if (!(damager instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
Player victim = event.getEntity() instanceof Player ? ((Player) event.getEntity()) : null;
|
||||
if (protectionManager.can(DAMAGE, event.getEntity().getLocation(), (Player) damager, victim)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onInventoryOpen(InventoryOpenEvent event) {
|
||||
InventoryHolder holder = event.getInventory().getHolder();
|
||||
Location location = getLocation(holder);
|
||||
if (holder instanceof Entity && holder == event.getPlayer()) return;
|
||||
if (location == null) return;
|
||||
|
||||
if (protectionManager.can(CONTAINER, location, ((Player) event.getPlayer()))) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onInteractEntity(PlayerInteractEntityEvent event) {
|
||||
if (protectionManager.can(INTERACT_ENTITY, event.getRightClicked().getLocation(), event.getPlayer())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onInteract(PlayerInteractEvent event) {
|
||||
if (event.getClickedBlock() == null) {
|
||||
return;
|
||||
}
|
||||
ProtectionManager.Action action = getInteractEventAction(event);
|
||||
if (protectionManager.can(action, event.getClickedBlock().getLocation(), event.getPlayer())) {
|
||||
event.setUseItemInHand(Event.Result.DENY);
|
||||
event.setUseInteractedBlock(Event.Result.DENY);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private @Nullable Location getLocation(@Nullable InventoryHolder holder) {
|
||||
if (holder instanceof BlockState) {
|
||||
return ((BlockState) holder).getLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ProtectionManager.Action getInteractEventAction(PlayerInteractEvent event) {
|
||||
ProtectionManager.Action action;
|
||||
Block clickedBlock = event.getClickedBlock();
|
||||
if (clickedBlock != null && clickedBlock.getState() instanceof InventoryHolder) {
|
||||
action = CONTAINER;
|
||||
} else {
|
||||
action = INTERACT;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.listeners;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Kill;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.AddKillEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -58,12 +55,31 @@ public class PlayerDeath implements Listener {
|
||||
plugin.getStorageManager().updateClanPlayer(victimCp);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWarDeath(PlayerDeathEvent event) {
|
||||
Player player = event.getEntity();
|
||||
Player killer = player.getKiller();
|
||||
if (killer == null) {
|
||||
return;
|
||||
}
|
||||
Clan victimClan = plugin.getClanManager().getClanByPlayerUniqueId(player.getUniqueId());
|
||||
Clan killerClan = plugin.getClanManager().getClanByPlayerUniqueId(killer.getUniqueId());
|
||||
War war = plugin.getProtectionManager().getWar(victimClan, killerClan);
|
||||
if (war == null || victimClan == null) {
|
||||
return;
|
||||
}
|
||||
war.increaseCasualties(victimClan);
|
||||
}
|
||||
|
||||
private void addKill(@NotNull ClanPlayer victim, @NotNull ClanPlayer attacker) {
|
||||
if (victim.getClan() == null || attacker.getClan() == null || !victim.getClan().isVerified() ||
|
||||
!attacker.getClan().isVerified()) {
|
||||
Clan victimClan = victim.getClan();
|
||||
Clan attackerClan = attacker.getClan();
|
||||
if (victimClan == null || attackerClan == null || !victimClan.isVerified() || !attackerClan.isVerified()) {
|
||||
addKill(Kill.Type.CIVILIAN, attacker, victim);
|
||||
} else if (attacker.getClan().isRival(victim.getTag())) {
|
||||
} else if (attackerClan.isRival(victim.getTag())) {
|
||||
addKill(Kill.Type.RIVAL, attacker, victim);
|
||||
} else if (attackerClan.isAlly(victimClan.getTag()) || attackerClan.equals(victimClan)) {
|
||||
addKill(Kill.Type.ALLY, attacker, victim);
|
||||
} else {
|
||||
addKill(Kill.Type.NEUTRAL, attacker, victim);
|
||||
}
|
||||
|
||||
+27
-13
@@ -6,6 +6,8 @@ import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer.Channel;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -14,6 +16,8 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.ClanPlayer.Channel.CLAN;
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.ClanPlayer.Channel.NONE;
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
@@ -24,9 +28,11 @@ import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
public class SCPlayerListener implements Listener {
|
||||
|
||||
private final SimpleClans plugin;
|
||||
private final SettingsManager settingsManager;
|
||||
|
||||
public SCPlayerListener() {
|
||||
plugin = SimpleClans.getInstance();
|
||||
settingsManager = plugin.getSettingsManager();
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
@@ -34,12 +40,12 @@ public class SCPlayerListener implements Listener {
|
||||
String[] split = event.getMessage().substring(1).split(" ");
|
||||
String command = split[0];
|
||||
|
||||
if (plugin.getSettingsManager().isTagBasedClanChat()) {
|
||||
if (settingsManager.isTagBasedClanChat()) {
|
||||
Clan clan = plugin.getClanManager().getClan(command);
|
||||
if (clan == null || !clan.isMember(event.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
String replaced = event.getMessage().replaceFirst(command, plugin.getSettingsManager().getCommandClanChat());
|
||||
String replaced = event.getMessage().replaceFirst(command, settingsManager.getCommandClanChat());
|
||||
event.setMessage(replaced);
|
||||
}
|
||||
}
|
||||
@@ -48,7 +54,7 @@ public class SCPlayerListener implements Listener {
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player.getUniqueId());
|
||||
if (cp == null || plugin.getSettingsManager().isBlacklistedWorld(player.getLocation().getWorld())) {
|
||||
if (cp == null || settingsManager.isBlacklistedWorld(player.getLocation().getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,17 +77,17 @@ public class SCPlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void handleChatTags(AsyncPlayerChatEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (plugin.getSettingsManager().isBlacklistedWorld(player.getWorld())) {
|
||||
if (settingsManager.isBlacklistedWorld(player.getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getAnyClanPlayer(player.getUniqueId());
|
||||
String tagLabel = cp != null && cp.isTagEnabled() ? cp.getTagLabel() : null;
|
||||
|
||||
if (plugin.getSettingsManager().isCompatMode() && plugin.getSettingsManager().isChatTags()) {
|
||||
if (settingsManager.isCompatMode() && settingsManager.isChatTags()) {
|
||||
if (tagLabel != null) {
|
||||
if (player.getDisplayName().contains("{clan}")) {
|
||||
player.setDisplayName(player.getDisplayName().replace("{clan}", tagLabel));
|
||||
@@ -126,8 +132,8 @@ public class SCPlayerListener implements Listener {
|
||||
|
||||
SimpleClans.getInstance().getPermissionsManager().addPlayerPermissions(cp);
|
||||
|
||||
if (plugin.getSettingsManager().isBbShowOnLogin() && cp.isBbEnabled() && cp.getClan() != null) {
|
||||
cp.getClan().displayBb(player, plugin.getSettingsManager().getBbLoginSize());
|
||||
if (settingsManager.isBbShowOnLogin() && cp.isBbEnabled() && cp.getClan() != null) {
|
||||
cp.getClan().displayBb(player, settingsManager.getBbLoginSize());
|
||||
}
|
||||
|
||||
SimpleClans.getInstance().getPermissionsManager().addClanPermissions(cp);
|
||||
@@ -136,8 +142,7 @@ public class SCPlayerListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (!plugin.getSettingsManager().isTeleportOnSpawn() ||
|
||||
plugin.getSettingsManager().isBlacklistedWorld(player.getWorld())) {
|
||||
if (!settingsManager.isTeleportOnSpawn() || settingsManager.isBlacklistedWorld(player.getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -152,11 +157,20 @@ public class SCPlayerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
if (plugin.getSettingsManager().isBlacklistedWorld(event.getPlayer().getLocation().getWorld())) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(event.getPlayer());
|
||||
if (cp != null) {
|
||||
Clan clan = Objects.requireNonNull(cp.getClan());
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
if (clan.getOnlineMembers().isEmpty()) {
|
||||
plugin.getProtectionManager().setWarExpirationTime(cp.getClan(),
|
||||
settingsManager.getWarDisconnectExpirationTime());
|
||||
}
|
||||
});
|
||||
}
|
||||
if (settingsManager.isBlacklistedWorld(event.getPlayer().getLocation().getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(event.getPlayer());
|
||||
|
||||
SimpleClans.getInstance().getPermissionsManager().removeClanPlayerPermissions(cp);
|
||||
plugin.getClanManager().updateLastSeen(event.getPlayer());
|
||||
@@ -165,7 +179,7 @@ public class SCPlayerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerKick(PlayerKickEvent event) {
|
||||
if (plugin.getSettingsManager().isBlacklistedWorld(event.getPlayer().getLocation().getWorld())) {
|
||||
if (settingsManager.isBlacklistedWorld(event.getPlayer().getLocation().getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.sacredlabyrinth.phaed.simpleclans.managers;
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ChatEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ClanBalanceUpdateEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.CreateClanEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.VanishUtils;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
@@ -54,46 +55,44 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Adds a kill to the memory
|
||||
*
|
||||
*/
|
||||
public void addKill(Kill kill) {
|
||||
if (kill == null) {
|
||||
return;
|
||||
}
|
||||
if (kill == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Kill> list = kills.computeIfAbsent(kill.getKiller(), k -> new ArrayList<>());
|
||||
|
||||
Iterator<Kill> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Kill oldKill = iterator.next();
|
||||
if (oldKill.getVictim().equals(kill.getKiller())) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
//cleaning
|
||||
final int delay = plugin.getSettingsManager().getDelayBetweenKills();
|
||||
long timePassed = oldKill.getTime().until(LocalDateTime.now(), ChronoUnit.MINUTES);
|
||||
if (timePassed >= delay) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
list.add(kill);
|
||||
while (iterator.hasNext()) {
|
||||
Kill oldKill = iterator.next();
|
||||
if (oldKill.getVictim().equals(kill.getKiller())) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
//cleaning
|
||||
final int delay = plugin.getSettingsManager().getDelayBetweenKills();
|
||||
long timePassed = oldKill.getTime().until(LocalDateTime.now(), ChronoUnit.MINUTES);
|
||||
if (timePassed >= delay) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
list.add(kill);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if this kill respects the delay
|
||||
*
|
||||
*/
|
||||
public boolean isKillBeforeDelay(Kill kill) {
|
||||
if (kill == null) {
|
||||
return false;
|
||||
}
|
||||
List<Kill> list = kills.get(kill.getKiller());
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
public boolean isKillBeforeDelay(Kill kill) {
|
||||
if (kill == null) {
|
||||
return false;
|
||||
}
|
||||
List<Kill> list = kills.get(kill.getKiller());
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Kill oldKill : list) {
|
||||
if (oldKill.getVictim().equals(kill.getVictim())) {
|
||||
@@ -106,12 +105,11 @@ public final class ClanManager {
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a clan into the in-memory store
|
||||
*
|
||||
*/
|
||||
public void importClan(Clan clan) {
|
||||
this.clans.put(clan.getTag(), clan);
|
||||
@@ -119,17 +117,15 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Import a clan player into the in-memory store
|
||||
*
|
||||
*/
|
||||
public void importClanPlayer(ClanPlayer cp) {
|
||||
if (cp.getUniqueId() != null) {
|
||||
this.clanPlayers.put(cp.getUniqueId().toString(), cp);
|
||||
}
|
||||
if (cp.getUniqueId() != null) {
|
||||
this.clanPlayers.put(cp.getUniqueId().toString(), cp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new clan
|
||||
*
|
||||
*/
|
||||
public void createClan(Player player, String colorTag, String name) {
|
||||
ClanPlayer cp = getCreateClanPlayer(player.getUniqueId());
|
||||
@@ -144,13 +140,13 @@ public final class ClanManager {
|
||||
importClan(clan);
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
|
||||
plugin.getRequestManager().deny(cp); //denies any previous invitation
|
||||
SimpleClans.getInstance().getPermissionsManager().updateClanPermissions(clan);
|
||||
SimpleClans.getInstance().getServer().getPluginManager().callEvent(new CreateClanEvent(clan));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset a player's KDR
|
||||
*
|
||||
*/
|
||||
public void resetKdr(ClanPlayer cp) {
|
||||
cp.setCivilianKills(0);
|
||||
@@ -162,20 +158,18 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Delete a players data file
|
||||
*
|
||||
*/
|
||||
public void deleteClanPlayer(ClanPlayer cp) {
|
||||
Clan clan = cp.getClan();
|
||||
if (clan != null) {
|
||||
clan.removePlayerFromClan(cp.getUniqueId());
|
||||
}
|
||||
if (clan != null) {
|
||||
clan.removePlayerFromClan(cp.getUniqueId());
|
||||
}
|
||||
clanPlayers.remove(cp.getUniqueId().toString());
|
||||
plugin.getStorageManager().deleteClanPlayer(cp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a player data from memory
|
||||
*
|
||||
*/
|
||||
public void deleteClanPlayerFromMemory(UUID playerUniqueId) {
|
||||
clanPlayers.remove(playerUniqueId.toString());
|
||||
@@ -183,7 +177,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Remove a clan from memory
|
||||
*
|
||||
*/
|
||||
public void removeClan(String tag) {
|
||||
clans.remove(tag);
|
||||
@@ -191,7 +184,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Whether the tag belongs to a clan
|
||||
*
|
||||
*/
|
||||
public boolean isClan(String tag) {
|
||||
return clans.containsKey(Helper.cleanTag(tag));
|
||||
@@ -199,7 +191,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Returns the clan the tag belongs to
|
||||
*
|
||||
*/
|
||||
public Clan getClan(String tag) {
|
||||
return clans.get(Helper.cleanTag(tag));
|
||||
@@ -236,7 +227,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Returns the collection of all clan players, including the disabled ones
|
||||
*
|
||||
*/
|
||||
public List<ClanPlayer> getAllClanPlayers() {
|
||||
return new ArrayList<>(clanPlayers.values());
|
||||
@@ -245,7 +235,6 @@ public final class ClanManager {
|
||||
/**
|
||||
* Gets the ClanPlayer data object if a player is currently in a clan, null
|
||||
* if he's not in a clan Used for BungeeCord Reload ClanPlayer and your Clan
|
||||
*
|
||||
*/
|
||||
public @Nullable ClanPlayer getClanPlayerJoinEvent(Player player) {
|
||||
SimpleClans.getInstance().getStorageManager().importFromDatabaseOnePlayer(player);
|
||||
@@ -255,16 +244,14 @@ public final class ClanManager {
|
||||
/**
|
||||
* Gets the ClanPlayer data object if a player is currently in a clan, null
|
||||
* if he's not in a clan
|
||||
*
|
||||
*/
|
||||
public @Nullable ClanPlayer getClanPlayer(OfflinePlayer player) {
|
||||
return getClanPlayer(player.getUniqueId());
|
||||
return getClanPlayer(player.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ClanPlayer data object if a player is currently in a clan, null
|
||||
* if he's not in a clan
|
||||
*
|
||||
*/
|
||||
public @Nullable ClanPlayer getClanPlayer(Player player) {
|
||||
return getClanPlayer((OfflinePlayer) player);
|
||||
@@ -273,7 +260,6 @@ public final class ClanManager {
|
||||
/**
|
||||
* Gets the ClanPlayer data object if a player is currently in a clan, null
|
||||
* if he's not in a clan
|
||||
*
|
||||
*/
|
||||
public @Nullable ClanPlayer getClanPlayer(UUID playerUniqueId) {
|
||||
ClanPlayer cp = clanPlayers.get(playerUniqueId.toString());
|
||||
@@ -298,7 +284,6 @@ public final class ClanManager {
|
||||
/**
|
||||
* Gets the ClanPlayer data object if a player is currently in a clan, null
|
||||
* if he's not in a clan
|
||||
*
|
||||
*/
|
||||
public @Nullable ClanPlayer getClanPlayerName(String playerDisplayName) {
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(playerDisplayName);
|
||||
@@ -325,7 +310,6 @@ public final class ClanManager {
|
||||
* clan players as well, these are players who used to be in a clan but are
|
||||
* not currently in one, their data file persists and can be accessed. their
|
||||
* clan will be null though.
|
||||
*
|
||||
*/
|
||||
@Nullable
|
||||
public ClanPlayer getAnyClanPlayer(UUID playerUniqueId) {
|
||||
@@ -337,24 +321,24 @@ public final class ClanManager {
|
||||
public ClanPlayer getAnyClanPlayer(String playerName) {
|
||||
return getAnyClanPlayer(Bukkit.getOfflinePlayer(playerName).getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ClanPlayer object for the player, creates one if not found
|
||||
*
|
||||
*/
|
||||
public @Nullable ClanPlayer getCreateClanPlayerUUID(String playerDisplayName) {
|
||||
UUID playerUniqueId = UUIDMigration.getForcedPlayerUUID(playerDisplayName);
|
||||
if (playerUniqueId != null) {
|
||||
return getCreateClanPlayer(playerUniqueId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
UUID playerUniqueId = UUIDMigration.getForcedPlayerUUID(playerDisplayName);
|
||||
if (playerUniqueId != null) {
|
||||
return getCreateClanPlayer(playerUniqueId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ClanPlayer object for the player, creates one if not found
|
||||
*
|
||||
*/
|
||||
public ClanPlayer getCreateClanPlayer(UUID playerUniqueId) {
|
||||
Objects.requireNonNull(playerUniqueId, "UUID must not be null");
|
||||
if (clanPlayers.containsKey(playerUniqueId.toString())) {
|
||||
return clanPlayers.get(playerUniqueId.toString());
|
||||
}
|
||||
@@ -393,7 +377,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Update the players display name with his clan's tag
|
||||
*
|
||||
*/
|
||||
public void updateDisplayName(@Nullable Player player) {
|
||||
// do not update displayname if in compat mode
|
||||
@@ -434,7 +417,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Process a player and his clan's last seen date
|
||||
*
|
||||
*/
|
||||
public void updateLastSeen(Player player) {
|
||||
ClanPlayer cp = getAnyClanPlayer(player.getUniqueId());
|
||||
@@ -456,22 +438,22 @@ public final class ClanManager {
|
||||
public void ban(String playerName) {
|
||||
ban(Bukkit.getOfflinePlayer(playerName).getUniqueId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Bans a player from clan commands
|
||||
*
|
||||
*
|
||||
* @param uuid the player's uuid
|
||||
*/
|
||||
public void ban(UUID uuid) {
|
||||
ClanPlayer cp = getClanPlayer(uuid);
|
||||
Clan clan = null;
|
||||
if (cp != null) {
|
||||
clan = cp.getClan();
|
||||
clan = cp.getClan();
|
||||
}
|
||||
|
||||
if (clan != null) {
|
||||
if (clan.getSize() == 1) {
|
||||
clan.disband();
|
||||
clan.disband(null, false, false);
|
||||
} else {
|
||||
cp.setClan(null);
|
||||
cp.addPastClan(clan.getColorTag() + (cp.isLeader() ? ChatColor.DARK_RED + "*" : ""));
|
||||
@@ -489,7 +471,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Get a count of rivable clans
|
||||
*
|
||||
*/
|
||||
public int getRivableClanCount() {
|
||||
int clanCount = 0;
|
||||
@@ -505,7 +486,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Returns a formatted string detailing the players armor
|
||||
*
|
||||
*/
|
||||
public String getArmorString(PlayerInventory inv) {
|
||||
String out = "";
|
||||
@@ -515,7 +495,7 @@ public final class ClanManager {
|
||||
Player player = null;
|
||||
InventoryHolder holder = inv.getHolder();
|
||||
if (holder instanceof Player) {
|
||||
player = (Player) holder;
|
||||
player = (Player) holder;
|
||||
}
|
||||
|
||||
if (h != null) {
|
||||
@@ -602,7 +582,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Returns a formatted string detailing the players weapons
|
||||
*
|
||||
*/
|
||||
public String getWeaponString(PlayerInventory inv) {
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
@@ -612,7 +591,7 @@ public final class ClanManager {
|
||||
Player player = null;
|
||||
InventoryHolder holder = inv.getHolder();
|
||||
if (holder instanceof Player) {
|
||||
player = (Player) holder;
|
||||
player = (Player) holder;
|
||||
}
|
||||
|
||||
int count = getItemCount(inv, XMaterial.DIAMOND_SWORD);
|
||||
@@ -714,7 +693,7 @@ public final class ClanManager {
|
||||
Player player = null;
|
||||
InventoryHolder holder = inv.getHolder();
|
||||
if (holder instanceof Player) {
|
||||
player = (Player) holder;
|
||||
player = (Player) holder;
|
||||
}
|
||||
|
||||
double count = getFoodPoints(inv, XMaterial.APPLE, 4, 2.4);
|
||||
@@ -762,7 +741,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Returns a formatted string detailing the players health
|
||||
*
|
||||
*/
|
||||
public String getHealthString(double health) {
|
||||
StringBuilder out = new StringBuilder();
|
||||
@@ -784,7 +762,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Returns a formatted string detailing the players hunger
|
||||
*
|
||||
*/
|
||||
public String getHungerString(int health) {
|
||||
StringBuilder out = new StringBuilder();
|
||||
@@ -803,85 +780,79 @@ public final class ClanManager {
|
||||
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort clans by active
|
||||
*
|
||||
*/
|
||||
public void sortClansByActive(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Long.compare(c1.getLastUsed(), c2.getLastUsed()) * o;
|
||||
});
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Long.compare(c1.getLastUsed(), c2.getLastUsed()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort clans by founded date
|
||||
*
|
||||
*/
|
||||
public void sortClansByFounded(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Long.compare(c1.getFounded(), c2.getFounded()) * o;
|
||||
});
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Long.compare(c1.getFounded(), c2.getFounded()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort clans by kdr
|
||||
*
|
||||
*/
|
||||
public void sortClansByKDR(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Float.compare(c1.getTotalKDR(), c2.getTotalKDR()) * o;
|
||||
});
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Float.compare(c1.getTotalKDR(), c2.getTotalKDR()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort clans by size
|
||||
*
|
||||
*/
|
||||
public void sortClansBySize(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Integer.compare(c1.getSize(), c2.getSize()) * o;
|
||||
});
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return Integer.compare(c1.getSize(), c2.getSize()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort clans by name
|
||||
*
|
||||
*/
|
||||
public void sortClansByName(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return c1.getName().compareTo(c2.getName()) * o;
|
||||
});
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return c1.getName().compareTo(c2.getName()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by KDR
|
||||
*
|
||||
*/
|
||||
public void sortClansByKDR(List<Clan> clans) {
|
||||
clans.sort((c1, c2) -> {
|
||||
@@ -894,7 +865,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Sort clans by KDR
|
||||
*
|
||||
*/
|
||||
public void sortClansBySize(List<Clan> clans) {
|
||||
clans.sort((c1, c2) -> {
|
||||
@@ -907,7 +877,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Sort clan players by KDR
|
||||
*
|
||||
*/
|
||||
public void sortClanPlayersByKDR(List<ClanPlayer> cps) {
|
||||
cps.sort((c1, c2) -> {
|
||||
@@ -920,7 +889,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Sort clan players by last seen days
|
||||
*
|
||||
*/
|
||||
public void sortClanPlayersByLastSeen(List<ClanPlayer> cps) {
|
||||
cps.sort((c1, c2) -> {
|
||||
@@ -948,7 +916,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase member fee set
|
||||
*
|
||||
*/
|
||||
public boolean purchaseMemberFeeSet(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseMemberFeeSet()) {
|
||||
@@ -956,13 +923,13 @@ public final class ClanManager {
|
||||
}
|
||||
|
||||
double price = plugin.getSettingsManager().geteMemberFeeSetPrice();
|
||||
|
||||
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -972,7 +939,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase clan creation
|
||||
*
|
||||
*/
|
||||
public boolean purchaseCreation(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseCreation()) {
|
||||
@@ -984,9 +950,9 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -996,7 +962,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase invite
|
||||
*
|
||||
*/
|
||||
public boolean purchaseInvite(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseInvite()) {
|
||||
@@ -1008,9 +973,9 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1020,7 +985,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase Home Teleport
|
||||
*
|
||||
*/
|
||||
public boolean purchaseHomeTeleport(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseHomeTeleport()) {
|
||||
@@ -1032,9 +996,9 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1044,7 +1008,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase Home Teleport Set
|
||||
*
|
||||
*/
|
||||
public boolean purchaseHomeTeleportSet(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseHomeTeleportSet()) {
|
||||
@@ -1056,9 +1019,9 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1068,7 +1031,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase Reset Kdr
|
||||
*
|
||||
*/
|
||||
public boolean purchaseResetKdr(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseResetKdr()) {
|
||||
@@ -1080,9 +1042,9 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1092,7 +1054,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Purchase Home Regroup
|
||||
*
|
||||
*/
|
||||
public boolean purchaseHomeRegroup(Player player) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
@@ -1111,27 +1072,32 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
double balance = clan.getBalance();
|
||||
if (price > balance) {
|
||||
player.sendMessage(ChatColor.RED + lang("clan.bank.not.enough.money",player));
|
||||
return false;
|
||||
switch (clan.withdraw(player, ClanBalanceUpdateEvent.Cause.COMMAND, price)) {
|
||||
case SUCCESS:
|
||||
if (SimpleClans.getInstance().getPermissionsManager().playerGrantMoney(player, price)) {
|
||||
player.sendMessage(ChatColor.AQUA + lang("player.clan.withdraw", player, price));
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + lang("bb.clan.withdraw", price));
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case NOT_ENOUGH_BALANCE:
|
||||
player.sendMessage(lang("clan.bank.not.enough.money", player));
|
||||
break;
|
||||
}
|
||||
clan.withdraw(price, player);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purchase clan verification
|
||||
*
|
||||
*/
|
||||
public boolean purchaseVerification(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseVerification()) {
|
||||
@@ -1143,9 +1109,9 @@ public final class ClanManager {
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited",player), price));
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(lang("account.has.been.debited", player), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money",player));
|
||||
player.sendMessage(ChatColor.RED + lang("not.sufficient.money", player));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1155,7 +1121,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Processes a clan chat command
|
||||
*
|
||||
*/
|
||||
public void processClanChat(Player player, String tag, String msg) {
|
||||
Clan clan = plugin.getClanManager().getClan(tag);
|
||||
@@ -1169,7 +1134,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Processes a clan chat command
|
||||
*
|
||||
*/
|
||||
public void processClanChat(Player player, final String msg) {
|
||||
final ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
@@ -1186,15 +1150,15 @@ public final class ClanManager {
|
||||
|
||||
String command = split[0];
|
||||
|
||||
if (command.equals(lang("join",player))) {
|
||||
if (command.equals(lang("join", player))) {
|
||||
cp.setChannel(ClanPlayer.Channel.CLAN);
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
ChatBlock.sendMessage(player, lang("joined.clan.chat", player));
|
||||
} else if (command.equals(lang("leave",player))) {
|
||||
} else if (command.equals(lang("leave", player))) {
|
||||
cp.setChannel(ClanPlayer.Channel.NONE);
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
ChatBlock.sendMessage(player, lang("left.clan.chat", player));
|
||||
} else if (command.equals(lang("mute",player))) {
|
||||
} else if (command.equals(lang("mute", player))) {
|
||||
if (!cp.isMuted()) {
|
||||
cp.setMuted(true);
|
||||
ChatBlock.sendMessage(player, lang("muted.clan.chat", player));
|
||||
@@ -1262,7 +1226,6 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Processes a ally chat command
|
||||
*
|
||||
*/
|
||||
public void processAllyChat(Player player, final String msg) {
|
||||
final ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
@@ -1303,9 +1266,9 @@ public final class ClanManager {
|
||||
if (ally.isMutedAlly()) {
|
||||
continue;
|
||||
}
|
||||
if (player.getUniqueId().equals(ally.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
if (player.getUniqueId().equals(ally.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
receivers.add(ally);
|
||||
}
|
||||
|
||||
@@ -1335,8 +1298,8 @@ public final class ClanManager {
|
||||
|
||||
/**
|
||||
* Processes a global chat command
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean processGlobalChat(Player player, String msg) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player.getUniqueId());
|
||||
|
||||
@@ -1352,11 +1315,11 @@ public final class ClanManager {
|
||||
|
||||
String command = split[0];
|
||||
|
||||
if (command.equals(lang("on",player))) {
|
||||
if (command.equals(lang("on", player))) {
|
||||
cp.setGlobalChat(true);
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + "You have enabled global chat");
|
||||
} else if (command.equals(lang("off",player))) {
|
||||
} else if (command.equals(lang("off", player))) {
|
||||
cp.setGlobalChat(false);
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + "You have disabled global chat");
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ public final class PermissionsManager {
|
||||
* Removes permissions for a player (when he gets kicked for example)
|
||||
*
|
||||
*/
|
||||
public void removeClanPlayerPermissions(ClanPlayer cp) {
|
||||
public void removeClanPlayerPermissions(@Nullable ClanPlayer cp) {
|
||||
if (cp != null && cp.getClan() != null && cp.toPlayer() != null) {
|
||||
Player player = cp.toPlayer();
|
||||
if (player != null && permissions.containsKey(cp.getClan().getTag()) && permAttaches.containsKey(player)) {
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.managers;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.War;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.WarEndEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.WarStartEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.Land;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.hooks.protection.ProtectionProvider;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.listeners.LandProtection;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
public class ProtectionManager {
|
||||
|
||||
private final SettingsManager settingsManager;
|
||||
private final ClanManager clanManager;
|
||||
private final Logger logger;
|
||||
private final Map<War, BukkitTask> wars = new HashMap<>();
|
||||
private final List<ProtectionProvider> providers = new ArrayList<>();
|
||||
private LandProtection landProtection;
|
||||
private final SimpleClans plugin;
|
||||
|
||||
public ProtectionManager() {
|
||||
plugin = SimpleClans.getInstance();
|
||||
settingsManager = plugin.getSettingsManager();
|
||||
clanManager = plugin.getClanManager();
|
||||
logger = plugin.getLogger();
|
||||
if (!settingsManager.isWarEnabled() && !settingsManager.isLandSharing()) {
|
||||
return;
|
||||
}
|
||||
//running on next tick, so all plugins are already loaded
|
||||
Bukkit.getScheduler().runTask(plugin, this::registerProviders);
|
||||
clearWars();
|
||||
}
|
||||
|
||||
public void registerListeners() {
|
||||
landProtection = new LandProtection(plugin);
|
||||
if (!settingsManager.isWarEnabled() && !settingsManager.isLandSharing()) {
|
||||
return;
|
||||
}
|
||||
landProtection.registerListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Player's lands at the given Location, if not found, returns all Player's lands in the World
|
||||
*
|
||||
* @param player the Player
|
||||
* @param location the Location
|
||||
* @return the lands
|
||||
*/
|
||||
public Set<Land> getLands(@NotNull Player player, @NotNull Location location) {
|
||||
Set<Land> lands = getLandsAt(location);
|
||||
lands.removeIf(land -> !land.getOwners().contains(player.getUniqueId()));
|
||||
if (lands.isEmpty()) {
|
||||
lands = getLandsOf(player, player.getWorld());
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Land> getLandsAt(@NotNull Location location) {
|
||||
Set<Land> lands = new HashSet<>();
|
||||
for (ProtectionProvider provider : providers) {
|
||||
lands.addAll(provider.getLandsAt(location));
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
public boolean isOwner(@NotNull OfflinePlayer player, @NotNull Location location) {
|
||||
for (Land land : getLandsAt(location)) {
|
||||
if (land.getOwners().contains(player.getUniqueId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Land> getLandsOf(@NotNull OfflinePlayer player, @NotNull World world) {
|
||||
Set<Land> lands = new HashSet<>();
|
||||
for (ProtectionProvider provider : providers) {
|
||||
lands.addAll(provider.getLandsOf(player, world));
|
||||
}
|
||||
return lands;
|
||||
}
|
||||
|
||||
public boolean can(@NotNull Action action, @NotNull Location location, @NotNull Player player) {
|
||||
return can(action, location, player, null);
|
||||
}
|
||||
|
||||
public boolean can(@NotNull Action action, @NotNull Location location, @NotNull Player player, @Nullable Player other) {
|
||||
for (Land land : getLandsAt(location)) {
|
||||
for (UUID owner : land.getOwners()) {
|
||||
if (owner == null) {
|
||||
continue;
|
||||
}
|
||||
Player involved;
|
||||
if (other != null && player.getUniqueId().equals(owner)) {
|
||||
involved = other;
|
||||
} else {
|
||||
involved = player;
|
||||
}
|
||||
if (isWarringAndAllowed(action, owner, involved) ||
|
||||
isSameClanAndAllowed(action, owner, involved, land.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedReturnValue")
|
||||
public boolean addWar(@NotNull ClanPlayer requester, Clan requestClan, Clan targetClan) {
|
||||
War war = new War(requestClan, targetClan);
|
||||
|
||||
if (wars.containsKey(war)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WarStartEvent event = new WarStartEvent(war);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
requestClan.addWarringClan(requester, targetClan);
|
||||
targetClan.addWarringClan(requester, requestClan);
|
||||
|
||||
wars.put(war, scheduleTask(war, settingsManager.getWarNormalExpirationTime()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private BukkitTask scheduleTask(@NotNull War war, int expirationTime) {
|
||||
BukkitTask timeoutTask = null;
|
||||
if (expirationTime > 0) {
|
||||
timeoutTask = Bukkit.getScheduler().runTaskLater(plugin, new WarTimeoutTask(war), expirationTime);
|
||||
}
|
||||
return timeoutTask;
|
||||
}
|
||||
|
||||
public void setWarExpirationTime(@NotNull Clan clan, int expirationTime) {
|
||||
if (expirationTime < 1) {
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<War, BukkitTask> entry : wars.entrySet()) {
|
||||
War war = entry.getKey();
|
||||
if (!war.getClans().contains(clan)) {
|
||||
continue;
|
||||
}
|
||||
BukkitTask task = entry.getValue();
|
||||
if (task != null && !task.isCancelled()) {
|
||||
task.cancel();
|
||||
}
|
||||
entry.setValue(scheduleTask(war, expirationTime));
|
||||
}
|
||||
}
|
||||
|
||||
public void removeWar(@Nullable War war, @NotNull WarEndEvent.Reason reason) {
|
||||
if (war == null) {
|
||||
return;
|
||||
}
|
||||
wars.remove(war);
|
||||
Clan clan1 = war.getClans().get(0);
|
||||
Clan clan2 = war.getClans().get(1);
|
||||
clan1.removeWarringClan(clan2);
|
||||
clan2.removeWarringClan(clan1);
|
||||
|
||||
WarEndEvent event = new WarEndEvent(war, reason);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
public @Nullable War getWar(@Nullable Clan clan1, @Nullable Clan clan2) {
|
||||
if (clan1 == null || clan2 == null) {
|
||||
return null;
|
||||
}
|
||||
for (War war : wars.keySet()) {
|
||||
List<Clan> clans = war.getClans();
|
||||
if (clans.contains(clan1) && clans.contains(clan2)) {
|
||||
return war;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void clearWars() {
|
||||
if (!settingsManager.isWarEnabled()) {
|
||||
return;
|
||||
}
|
||||
for (Clan clan : clanManager.getClans()) {
|
||||
for (Clan warringClan : clan.getWarringClans()) {
|
||||
clan.removeWarringClan(warringClan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSameClanAndAllowed(Action action, UUID owner, Player involved, String landId) {
|
||||
if (!settingsManager.isLandSharing()) {
|
||||
return false;
|
||||
}
|
||||
ClanPlayer cp = clanManager.getCreateClanPlayer(owner);
|
||||
Clan involvedClan = clanManager.getClanByPlayerUniqueId(involved.getUniqueId());
|
||||
if (cp.getClan() == null || !cp.getClan().equals(involvedClan)) {
|
||||
return false;
|
||||
}
|
||||
return cp.isAllowed(action, landId);
|
||||
}
|
||||
|
||||
private boolean isWarringAndAllowed(@NotNull Action action, @NotNull UUID owner, @NotNull Player involved) {
|
||||
if (!settingsManager.isActionAllowedInWar(action) || !settingsManager.isWarEnabled()) {
|
||||
return false;
|
||||
}
|
||||
Clan ownerClan = clanManager.getClanByPlayerUniqueId(owner);
|
||||
Clan involvedClan = clanManager.getClanByPlayerUniqueId(involved.getUniqueId());
|
||||
if (ownerClan == null || involvedClan == null) {
|
||||
return false;
|
||||
}
|
||||
return ownerClan.isWarring(involvedClan);
|
||||
}
|
||||
|
||||
private void registerProviders() {
|
||||
for (String className : settingsManager.getProtectionProviders()) {
|
||||
Object instance = null;
|
||||
try {
|
||||
Class<?> clazz = getProviderClass(className);
|
||||
instance = clazz.getConstructor().newInstance();
|
||||
} catch (ClassNotFoundException ex) {
|
||||
logger.log(Level.WARNING, String.format("Provider %s not found!", className), ex);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException |
|
||||
IllegalAccessException ex) {
|
||||
logger.log(Level.WARNING, String.format("Error instantiating provider %s", className), ex);
|
||||
}
|
||||
if (instance instanceof ProtectionProvider) {
|
||||
registerProvider((ProtectionProvider) instance);
|
||||
} else {
|
||||
logger.warning(String.format("%s is not an instance of ProtectionProvider", className));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void registerProvider(ProtectionProvider provider) {
|
||||
String requiredPlugin = provider.getRequiredPluginName();
|
||||
String providerName = provider.getClass().getSimpleName();
|
||||
if (requiredPlugin != null && Bukkit.getPluginManager().getPlugin(requiredPlugin) == null) {
|
||||
logger.warning(String.format("Required plugin %s for the provider %s was not found!",
|
||||
requiredPlugin, providerName));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
provider.setup();
|
||||
} catch (LinkageError | Exception throwable) {
|
||||
logger.log(Level.WARNING, String.format("Error registering provider %s", providerName));
|
||||
if (settingsManager.isDebugging()) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
providers.add(provider);
|
||||
landProtection.registerCreateLandEvent(provider, provider.getCreateLandEvent());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Class<?> getProviderClass(String className) throws ClassNotFoundException {
|
||||
try {
|
||||
return Class.forName("net.sacredlabyrinth.phaed.simpleclans.hooks.protection.providers." + className);
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
return Class.forName(className);
|
||||
}
|
||||
|
||||
public enum Action {
|
||||
BREAK, INTERACT, INTERACT_ENTITY, PLACE, DAMAGE, CONTAINER
|
||||
}
|
||||
|
||||
private class WarTimeoutTask implements Runnable {
|
||||
|
||||
private final War war;
|
||||
|
||||
private WarTimeoutTask(War war) {
|
||||
this.war = war;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
removeWar(war, WarEndEvent.Reason.EXPIRATION);
|
||||
Clan clan1 = war.getClans().get(0);
|
||||
Clan clan2 = war.getClans().get(1);
|
||||
clan1.addBb(clan1.getColorTag(), lang("war.expired", clan2.getTag()));
|
||||
clan2.addBb(clan2.getColorTag(), lang("war.expired", clan1.getTag()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,18 @@ package net.sacredlabyrinth.phaed.simpleclans.managers;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.RequestEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.RequestFinishedEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.WarEndEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
@@ -30,6 +33,7 @@ public final class RequestManager {
|
||||
askerTask();
|
||||
}
|
||||
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean hasRequest(String tag) {
|
||||
return requests.containsKey(tag);
|
||||
}
|
||||
@@ -105,7 +109,7 @@ public final class RequestManager {
|
||||
if (requests.containsKey(warClan.getTag())) {
|
||||
return;
|
||||
}
|
||||
String msg = MessageFormat.format(lang("proposing.war"), requestingClan.getName(), Helper.stripColors(warClan.getColorTag()));
|
||||
String msg = MessageFormat.format(lang("proposing.war"), requestingClan.getName(), ChatUtils.stripColors(warClan.getColorTag()));
|
||||
|
||||
List<ClanPlayer> acceptors = Helper.stripOffLinePlayers(warClan.getLeaders());
|
||||
acceptors.remove(requester);
|
||||
@@ -119,7 +123,7 @@ public final class RequestManager {
|
||||
if (requests.containsKey(warClan.getTag())) {
|
||||
return;
|
||||
}
|
||||
String msg = MessageFormat.format(lang("proposing.to.end.the.war"), requestingClan.getName(), Helper.stripColors(warClan.getColorTag()));
|
||||
String msg = MessageFormat.format(lang("proposing.to.end.the.war"), requestingClan.getName(), ChatUtils.stripColors(warClan.getColorTag()));
|
||||
|
||||
List<ClanPlayer> acceptors = Helper.stripOffLinePlayers(warClan.getLeaders());
|
||||
acceptors.remove(requester);
|
||||
@@ -133,7 +137,7 @@ public final class RequestManager {
|
||||
if (requests.containsKey(allyClan.getTag())) {
|
||||
return;
|
||||
}
|
||||
String msg = MessageFormat.format(lang("proposing.an.alliance"), requestingClan.getName(), Helper.stripColors(allyClan.getColorTag()));
|
||||
String msg = MessageFormat.format(lang("proposing.an.alliance"), requestingClan.getName(), ChatUtils.stripColors(allyClan.getColorTag()));
|
||||
|
||||
List<ClanPlayer> acceptors = Helper.stripOffLinePlayers(allyClan.getLeaders());
|
||||
acceptors.remove(requester);
|
||||
@@ -147,7 +151,7 @@ public final class RequestManager {
|
||||
if (requests.containsKey(rivalClan.getTag())) {
|
||||
return;
|
||||
}
|
||||
String msg = MessageFormat.format(lang("proposing.to.end.the.rivalry"), requestingClan.getName(), Helper.stripColors(rivalClan.getColorTag()));
|
||||
String msg = MessageFormat.format(lang("proposing.to.end.the.rivalry"), requestingClan.getName(), ChatUtils.stripColors(rivalClan.getColorTag()));
|
||||
|
||||
List<ClanPlayer> acceptors = Helper.stripOffLinePlayers(rivalClan.getLeaders());
|
||||
acceptors.remove(requester);
|
||||
@@ -209,13 +213,15 @@ public final class RequestManager {
|
||||
}
|
||||
|
||||
public void processResults(Request req) {
|
||||
Clan requesterClan = req.getClan();
|
||||
ClanPlayer requesterCp = req.getRequester();
|
||||
Clan requestClan = req.getClan();
|
||||
ClanPlayer requester = req.getRequester();
|
||||
|
||||
String target = req.getTarget();
|
||||
//may be null
|
||||
|
||||
@Nullable
|
||||
Clan targetClan = plugin.getClanManager().getClan(target);
|
||||
//may be null
|
||||
|
||||
@Nullable
|
||||
UUID targetPlayer = UUIDMigration.getForcedPlayerUUID(target);
|
||||
|
||||
List<String> accepts = req.getAccepts();
|
||||
@@ -223,35 +229,35 @@ public final class RequestManager {
|
||||
|
||||
switch (req.getType()) {
|
||||
case START_WAR:
|
||||
processStartWar(requesterClan, requesterCp, targetClan, accepts, denies);
|
||||
processStartWar(requester, requestClan, targetClan, accepts, denies);
|
||||
break;
|
||||
case END_WAR:
|
||||
processEndWar(requesterClan, requesterCp, targetClan, accepts, denies);
|
||||
processEndWar(requester, requestClan, targetClan, accepts, denies);
|
||||
break;
|
||||
case CREATE_ALLY:
|
||||
processCreateAlly(requesterClan, requesterCp, targetClan, accepts, denies);
|
||||
processCreateAlly(requester, requestClan, targetClan, accepts, denies);
|
||||
break;
|
||||
case BREAK_RIVALRY:
|
||||
processBreakRivalry(requesterClan, requesterCp, targetClan, accepts, denies);
|
||||
processBreakRivalry(requester, requestClan, targetClan, accepts, denies);
|
||||
break;
|
||||
case DEMOTE: case PROMOTE:
|
||||
if (!req.votingFinished() || targetPlayer == null) {
|
||||
return;
|
||||
}
|
||||
target = requesterClan.getTag();
|
||||
target = requestClan.getTag();
|
||||
|
||||
if (req.getType() == ClanRequest.DEMOTE) {
|
||||
processDemote(req, requesterClan, targetPlayer, denies);
|
||||
processDemote(req, requestClan, targetPlayer, denies);
|
||||
}
|
||||
if (req.getType() == ClanRequest.PROMOTE) {
|
||||
processPromote(req, requesterClan, targetPlayer, denies);
|
||||
processPromote(req, requestClan, targetPlayer, denies);
|
||||
}
|
||||
break;
|
||||
case DISBAND:
|
||||
if (!req.votingFinished()) {
|
||||
return;
|
||||
}
|
||||
processDisband(requesterClan, denies);
|
||||
processDisband(requestClan, denies);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -262,98 +268,97 @@ public final class RequestManager {
|
||||
req.cleanVotes();
|
||||
}
|
||||
|
||||
private void processDisband(Clan requesterClan, List<String> denies) {
|
||||
private void processDisband(Clan requestClan, List<String> denies) {
|
||||
if (denies.isEmpty()) {
|
||||
requesterClan.addBb(lang("leaders"), ChatColor.AQUA + lang("has.been.disbanded", requesterClan.getName()));
|
||||
requesterClan.disband();
|
||||
requestClan.disband();
|
||||
} else {
|
||||
String deniers = Helper.toMessage(Helper.toArray(denies), ", ");
|
||||
requesterClan.leaderAnnounce(ChatColor.RED + lang("clan.deletion", deniers));
|
||||
requestClan.leaderAnnounce(ChatColor.RED + lang("clan.deletion", deniers));
|
||||
}
|
||||
}
|
||||
|
||||
private void processPromote(Request req, Clan requesterClan, UUID targetPlayer, List<String> denies) {
|
||||
private void processPromote(Request req, Clan requestClan, UUID targetPlayer, List<String> denies) {
|
||||
String promotedName = req.getTarget();
|
||||
if (denies.isEmpty()) {
|
||||
requesterClan.addBb(lang("leaders"), ChatColor.AQUA + lang("promoted.to.leader", promotedName));
|
||||
requesterClan.promote(targetPlayer);
|
||||
requestClan.addBb(lang("leaders"), ChatColor.AQUA + lang("promoted.to.leader", promotedName));
|
||||
requestClan.promote(targetPlayer);
|
||||
} else {
|
||||
String deniers = Helper.toMessage(Helper.toArray(denies), ", ");
|
||||
requesterClan.leaderAnnounce(ChatColor.RED + lang("denied.the.promotion", deniers, promotedName));
|
||||
requestClan.leaderAnnounce(ChatColor.RED + lang("denied.the.promotion", deniers, promotedName));
|
||||
}
|
||||
}
|
||||
|
||||
private void processDemote(Request req, Clan requesterClan, UUID targetPlayer, List<String> denies) {
|
||||
private void processDemote(Request req, Clan requestClan, UUID targetPlayer, List<String> denies) {
|
||||
String demotedName = req.getTarget();
|
||||
|
||||
if (denies.isEmpty()) {
|
||||
requesterClan.addBb(lang("leaders"), ChatColor.AQUA
|
||||
requestClan.addBb(lang("leaders"), ChatColor.AQUA
|
||||
+ lang("demoted.back.to.member", demotedName));
|
||||
requesterClan.demote(targetPlayer);
|
||||
requestClan.demote(targetPlayer);
|
||||
} else {
|
||||
String deniers = Helper.toMessage(Helper.toArray(denies), ", ");
|
||||
requesterClan.leaderAnnounce(
|
||||
requestClan.leaderAnnounce(
|
||||
ChatColor.RED + lang("denied.demotion", deniers, demotedName));
|
||||
}
|
||||
}
|
||||
|
||||
private void processBreakRivalry(Clan requesterClan, ClanPlayer requesterCp, Clan targetClan, List<String> accepts,
|
||||
private void processBreakRivalry(ClanPlayer requester, Clan requestClan, Clan targetClan, List<String> accepts,
|
||||
List<String> denies) {
|
||||
if (targetClan != null && requesterClan != null) {
|
||||
if (targetClan != null && requestClan != null) {
|
||||
if (!accepts.isEmpty()) {
|
||||
requesterClan.removeRival(targetClan);
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("broken.the.rivalry", accepts.get(0), requesterClan.getName()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("broken.the.rivalry.with", requesterCp.getName(), targetClan.getName()));
|
||||
requestClan.removeRival(targetClan);
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("broken.the.rivalry", accepts.get(0), requestClan.getName()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("broken.the.rivalry.with", requester.getName(), targetClan.getName()));
|
||||
} else {
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("denied.to.make.peace", denies.get(0), requesterClan.getName()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("peace.agreement.denied", targetClan.getName()));
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("denied.to.make.peace", denies.get(0), requestClan.getName()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("peace.agreement.denied", targetClan.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void processCreateAlly(Clan requesterClan, ClanPlayer requesterCp, Clan targetClan, List<String> accepts,
|
||||
private void processCreateAlly(ClanPlayer requester, Clan requestClan, Clan targetClan, List<String> accepts,
|
||||
List<String> denies) {
|
||||
if (targetClan != null && requesterClan != null) {
|
||||
if (targetClan != null && requestClan != null) {
|
||||
if (!accepts.isEmpty()) {
|
||||
requesterClan.addAlly(targetClan);
|
||||
requestClan.addAlly(targetClan);
|
||||
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("accepted.an.alliance", accepts.get(0), requesterClan.getName()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("created.an.alliance", requesterCp.getName(), targetClan.getName()));
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("accepted.an.alliance", accepts.get(0), requestClan.getName()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("created.an.alliance", requester.getName(), targetClan.getName()));
|
||||
} else {
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("denied.an.alliance", denies.get(0), requesterClan.getName()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("the.alliance.was.denied", targetClan.getName()));
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("denied.an.alliance", denies.get(0), requestClan.getName()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("the.alliance.was.denied", targetClan.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void processEndWar(Clan requesterClan, ClanPlayer requesterCp, Clan targetClan, List<String> accepts,
|
||||
List<String> denies) {
|
||||
if (requesterClan != null && targetClan != null) {
|
||||
private void processEndWar(ClanPlayer requester, Clan requestClan, Clan targetClan, List<String> accepts,
|
||||
List<String> denies) {
|
||||
if (requestClan != null && targetClan != null) {
|
||||
if (!accepts.isEmpty()) {
|
||||
requesterClan.removeWarringClan(targetClan);
|
||||
targetClan.removeWarringClan(requesterClan);
|
||||
War war = plugin.getProtectionManager().getWar(requestClan, requestClan);
|
||||
plugin.getProtectionManager().removeWar(war, WarEndEvent.Reason.REQUEST);
|
||||
requestClan.removeWarringClan(targetClan);
|
||||
targetClan.removeWarringClan(requestClan);
|
||||
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("you.are.no.longer.at.war", accepts.get(0), requesterClan.getColorTag()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("you.are.no.longer.at.war", requesterClan.getName(), targetClan.getColorTag()));
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("you.are.no.longer.at.war", accepts.get(0), requestClan.getColorTag()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("you.are.no.longer.at.war", requestClan.getName(), targetClan.getColorTag()));
|
||||
} else {
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("denied.war.end", denies.get(0), requesterClan.getName()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("end.war.denied", targetClan.getName()));
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("denied.war.end", denies.get(0), requestClan.getName()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("end.war.denied", targetClan.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void processStartWar(Clan requesterClan, ClanPlayer requesterCp, Clan targetClan, List<String> accepts,
|
||||
private void processStartWar(ClanPlayer requester, Clan requestClan, Clan targetClan, List<String> accepts,
|
||||
List<String> denies) {
|
||||
if (requesterClan != null && targetClan != null) {
|
||||
if (requestClan != null && targetClan != null) {
|
||||
if (!accepts.isEmpty()) {
|
||||
requesterClan.addWarringClan(targetClan);
|
||||
targetClan.addWarringClan(requesterClan);
|
||||
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("you.are.at.war", targetClan.getName(), requesterClan.getColorTag()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("you.are.at.war", requesterClan.getName(), targetClan.getColorTag()));
|
||||
plugin.getProtectionManager().addWar(requester, requestClan, targetClan);
|
||||
} else {
|
||||
targetClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("denied.war.req", denies.get(0), requesterClan.getName()));
|
||||
requesterClan.addBb(requesterCp.getName(), ChatColor.AQUA + lang("end.war.denied", targetClan.getName()));
|
||||
targetClan.addBb(requester.getName(), ChatColor.AQUA + lang("denied.war.req", denies.get(0),
|
||||
requestClan.getName()));
|
||||
requestClan.addBb(requester.getName(), ChatColor.AQUA + lang("end.war.denied",
|
||||
targetClan.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,6 +381,19 @@ public final class RequestManager {
|
||||
|
||||
}
|
||||
|
||||
public void removeRequest(@NotNull String keyOrTarget) {
|
||||
Iterator<Map.Entry<String, Request>> iterator = requests.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, Request> entry = iterator.next();
|
||||
final String requester = entry.getKey();
|
||||
final String target = entry.getValue().getTarget();
|
||||
if (keyOrTarget.equals(requester) || keyOrTarget.equals(target)) {
|
||||
entry.getValue().cleanVotes();
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the task that asks for the votes of all requests
|
||||
*/
|
||||
|
||||
+276
-201
@@ -1,28 +1,28 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.managers;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.RankingNumberResolver.RankingType;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.RankingNumberResolver.RankingType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public final class SettingsManager {
|
||||
private boolean enableGUI;
|
||||
private boolean enableGUI;
|
||||
private boolean disableMessages;
|
||||
private String clanChatRankColor;
|
||||
private boolean tagBasedClanChat;
|
||||
@@ -190,13 +190,19 @@ public final class SettingsManager {
|
||||
private int maxKillsPerVictim;
|
||||
private boolean delayBetweenKillsEnabled;
|
||||
private int delayBetweenKills;
|
||||
private String language;
|
||||
private boolean languagePerPlayer;
|
||||
private boolean savePeriodically;
|
||||
private boolean cachePlayerHeads;
|
||||
private int saveInterval;
|
||||
private String rankingType;
|
||||
private int loreLength;
|
||||
private String language;
|
||||
private boolean languagePerPlayer;
|
||||
private boolean savePeriodically;
|
||||
private boolean cachePlayerHeads;
|
||||
private int saveInterval;
|
||||
private String rankingType;
|
||||
private int loreLength;
|
||||
private boolean warEnabled;
|
||||
private boolean landSharing;
|
||||
private List<String> protectionProviders;
|
||||
private boolean onlyLeadersCanCreateLands;
|
||||
private boolean onlyOneLandPerClan;
|
||||
private boolean setBaseOnlyInLand;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -233,14 +239,14 @@ public final class SettingsManager {
|
||||
teleportOnSpawn = getConfig().getBoolean("settings.teleport-home-on-spawn");
|
||||
dropOnHome = getConfig().getBoolean("settings.drop-items-on-clan-home");
|
||||
keepOnHome = getConfig().getBoolean("settings.keep-items-on-clan-home");
|
||||
for (String material : getConfig().getStringList("settings.item-list")) {
|
||||
for (String material : getConfig().getStringList("settings.item-list")) {
|
||||
Optional<XMaterial> x = XMaterial.matchXMaterial(material);
|
||||
if (x.isPresent()) {
|
||||
itemsList.add(x.get().parseMaterial());
|
||||
} else {
|
||||
plugin.getLogger().warning("Error with Material: " + material);
|
||||
}
|
||||
}
|
||||
}
|
||||
debugging = getConfig().getBoolean("settings.show-debug-info");
|
||||
mChatIntegration = getConfig().getBoolean("settings.mchat-integration");
|
||||
pvpOnlywhileInWar = getConfig().getBoolean("settings.pvp-only-while-at-war");
|
||||
@@ -407,7 +413,13 @@ public final class SettingsManager {
|
||||
maxKillsPerVictimEnabled = getConfig().getBoolean("kdr-grinding-prevention.enable-max-kills");
|
||||
delayBetweenKills = getConfig().getInt("kdr-grinding-prevention.delay-between-kills");
|
||||
delayBetweenKillsEnabled = getConfig().getBoolean("kdr-grinding-prevention.enable-kill-delay");
|
||||
|
||||
warEnabled = getConfig().getBoolean("war-and-protection.war-enabled", false);
|
||||
landSharing = getConfig().getBoolean("war-and-protection.land-sharing", true);
|
||||
protectionProviders = getConfig().getStringList("war-and-protection.protection-providers");
|
||||
onlyLeadersCanCreateLands = getConfig().getBoolean("war-and-protection.land-creation.only-leaders", false);
|
||||
onlyOneLandPerClan = getConfig().getBoolean("war-and-protection.land-creation.only-one-per-clan", false);
|
||||
setBaseOnlyInLand = getConfig().getBoolean("war-and-protection.set-base-only-in-land", false);
|
||||
|
||||
// migrate from old way of adding ports
|
||||
if (database.contains(":")) {
|
||||
String[] strings = database.split(":");
|
||||
@@ -436,6 +448,60 @@ public final class SettingsManager {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isWarRequestEnabled() {
|
||||
return getConfig().getBoolean("war-and-protection.war-start.request-enabled", true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean isWarEnabled() {
|
||||
return warEnabled;
|
||||
}
|
||||
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean isLandSharing() {
|
||||
return landSharing;
|
||||
}
|
||||
|
||||
public boolean isEditAllLands() {
|
||||
return getConfig().getBoolean("war-and-protection.edit-all-lands", false);
|
||||
}
|
||||
|
||||
public int getWarNormalExpirationTime() {
|
||||
return getConfig().getInt("war-and-protection.war-normal-expiration-time", 60) * 60 * 20;
|
||||
}
|
||||
|
||||
public int getWarDisconnectExpirationTime() {
|
||||
return getConfig().getInt("war-and-protection.war-disconnect-expiration-time", 10) * 60 * 20;
|
||||
}
|
||||
|
||||
public List<String> getProtectionProviders() {
|
||||
return protectionProviders;
|
||||
}
|
||||
|
||||
public EventPriority getWarListenerPriority() {
|
||||
return EventPriority.valueOf(getConfig().getString("war-and-protection.listeners.priority", "HIGHEST"));
|
||||
}
|
||||
|
||||
public List<String> getIgnoredList(ProtectionManager.Action action) {
|
||||
return getConfig().getStringList("war-and-protection.listeners.ignored-list." + action.name());
|
||||
}
|
||||
|
||||
public boolean isActionAllowedInWar(@NotNull ProtectionManager.Action action) {
|
||||
return getConfig().getBoolean("war-and-protection.war-actions." + action.name(), false);
|
||||
}
|
||||
|
||||
public boolean isOnlyLeadersCanCreateLands() {
|
||||
return onlyLeadersCanCreateLands;
|
||||
}
|
||||
|
||||
public boolean isOnlyOneLandPerClan() {
|
||||
return onlyOneLandPerClan;
|
||||
}
|
||||
|
||||
public boolean isSetBaseOnlyInLand() {
|
||||
return setBaseOnlyInLand;
|
||||
}
|
||||
|
||||
public int getLoreLength() {
|
||||
return loreLength;
|
||||
}
|
||||
@@ -443,33 +509,32 @@ public final class SettingsManager {
|
||||
public boolean isCachePlayerHeads() {
|
||||
return cachePlayerHeads;
|
||||
}
|
||||
|
||||
|
||||
public boolean isEnableGUI() {
|
||||
return enableGUI;
|
||||
}
|
||||
|
||||
return enableGUI;
|
||||
}
|
||||
|
||||
public void setEnableGUI(boolean enableGUI) {
|
||||
this.enableGUI = enableGUI;
|
||||
this.enableGUI = enableGUI;
|
||||
getConfig().set("settings.enable-gui", enableGUI);
|
||||
save();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return if the tag can contain letters from other alphabets
|
||||
*/
|
||||
public boolean isAcceptOtherAlphabetsLettersOnTag() {
|
||||
return acceptOtherAlphabetsLettersOnTag;
|
||||
}
|
||||
|
||||
public Locale getLanguage() {
|
||||
String[] split = language.split("_");
|
||||
|
||||
if (split.length == 2) {
|
||||
return new Locale(split[0], split[1]);
|
||||
}
|
||||
|
||||
return new Locale(language);
|
||||
public Locale getLanguage() {
|
||||
String[] split = language.split("_");
|
||||
|
||||
if (split.length == 2) {
|
||||
return new Locale(split[0], split[1]);
|
||||
}
|
||||
|
||||
return new Locale(language);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -482,95 +547,95 @@ public final class SettingsManager {
|
||||
}
|
||||
|
||||
public boolean isLanguagePerPlayer() {
|
||||
return languagePerPlayer;
|
||||
return languagePerPlayer;
|
||||
}
|
||||
|
||||
|
||||
public int getTasksCollectUpkeepHour() {
|
||||
return tasksCollectUpkeepHour;
|
||||
}
|
||||
return tasksCollectUpkeepHour;
|
||||
}
|
||||
|
||||
public void setTasksCollectUpkeepHour(int tasksCollectUpkeepHour) {
|
||||
this.tasksCollectUpkeepHour = tasksCollectUpkeepHour;
|
||||
}
|
||||
public void setTasksCollectUpkeepHour(int tasksCollectUpkeepHour) {
|
||||
this.tasksCollectUpkeepHour = tasksCollectUpkeepHour;
|
||||
}
|
||||
|
||||
public int getTasksCollectUpkeepMinute() {
|
||||
return tasksCollectUpkeepMinute;
|
||||
}
|
||||
public int getTasksCollectUpkeepMinute() {
|
||||
return tasksCollectUpkeepMinute;
|
||||
}
|
||||
|
||||
public void setTasksCollectUpkeepMinute(int tasksCollectUpkeepMinute) {
|
||||
this.tasksCollectUpkeepMinute = tasksCollectUpkeepMinute;
|
||||
}
|
||||
public void setTasksCollectUpkeepMinute(int tasksCollectUpkeepMinute) {
|
||||
this.tasksCollectUpkeepMinute = tasksCollectUpkeepMinute;
|
||||
}
|
||||
|
||||
public int getTasksCollectUpkeepWarningHour() {
|
||||
return tasksCollectUpkeepWarningHour;
|
||||
}
|
||||
public int getTasksCollectUpkeepWarningHour() {
|
||||
return tasksCollectUpkeepWarningHour;
|
||||
}
|
||||
|
||||
public void setTasksCollectUpkeepWarningHour(int tasksCollectUpkeepWarningHour) {
|
||||
this.tasksCollectUpkeepWarningHour = tasksCollectUpkeepWarningHour;
|
||||
}
|
||||
public void setTasksCollectUpkeepWarningHour(int tasksCollectUpkeepWarningHour) {
|
||||
this.tasksCollectUpkeepWarningHour = tasksCollectUpkeepWarningHour;
|
||||
}
|
||||
|
||||
public int getTasksCollectUpkeepWarningMinute() {
|
||||
return tasksCollectUpkeepWarningMinute;
|
||||
}
|
||||
public int getTasksCollectUpkeepWarningMinute() {
|
||||
return tasksCollectUpkeepWarningMinute;
|
||||
}
|
||||
|
||||
public void setTasksCollectUpkeepWarningMinute(int tasksCollectUpkeepWarningMinute) {
|
||||
this.tasksCollectUpkeepWarningMinute = tasksCollectUpkeepWarningMinute;
|
||||
}
|
||||
public void setTasksCollectUpkeepWarningMinute(int tasksCollectUpkeepWarningMinute) {
|
||||
this.tasksCollectUpkeepWarningMinute = tasksCollectUpkeepWarningMinute;
|
||||
}
|
||||
|
||||
public int getTasksCollectFeeHour() {
|
||||
return tasksCollectFeeHour;
|
||||
}
|
||||
public int getTasksCollectFeeHour() {
|
||||
return tasksCollectFeeHour;
|
||||
}
|
||||
|
||||
public void setTasksCollectFeeHour(int tasksCollectFeeHour) {
|
||||
this.tasksCollectFeeHour = tasksCollectFeeHour;
|
||||
}
|
||||
public void setTasksCollectFeeHour(int tasksCollectFeeHour) {
|
||||
this.tasksCollectFeeHour = tasksCollectFeeHour;
|
||||
}
|
||||
|
||||
public int getTasksCollectFeeMinute() {
|
||||
return tasksCollectFeeMinute;
|
||||
}
|
||||
public int getTasksCollectFeeMinute() {
|
||||
return tasksCollectFeeMinute;
|
||||
}
|
||||
|
||||
public void setTasksCollectFeeMinute(int tasksCollectFeeMinute) {
|
||||
this.tasksCollectFeeMinute = tasksCollectFeeMinute;
|
||||
}
|
||||
public void setTasksCollectFeeMinute(int tasksCollectFeeMinute) {
|
||||
this.tasksCollectFeeMinute = tasksCollectFeeMinute;
|
||||
}
|
||||
|
||||
public int getMinToVerify() {
|
||||
public int getMinToVerify() {
|
||||
return minToVerify;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the delay between kills
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getDelayBetweenKills() {
|
||||
return delayBetweenKills;
|
||||
return delayBetweenKills;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the delay between kills is enabled
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDelayBetweenKills() {
|
||||
return delayBetweenKillsEnabled;
|
||||
return delayBetweenKillsEnabled;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the max number of kills per victim
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getMaxKillsPerVictim() {
|
||||
return maxKillsPerVictim;
|
||||
return maxKillsPerVictim;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if there is a max number of kills per victim
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isMaxKillsPerVictim() {
|
||||
return maxKillsPerVictimEnabled;
|
||||
return maxKillsPerVictimEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -585,7 +650,7 @@ public final class SettingsManager {
|
||||
|
||||
/**
|
||||
* Gets the command set as the clan chat command
|
||||
*
|
||||
*
|
||||
* @return the clan chat command
|
||||
*/
|
||||
public String getCommandClanChat() {
|
||||
@@ -632,38 +697,38 @@ public final class SettingsManager {
|
||||
return word.equalsIgnoreCase("clan") || word.equalsIgnoreCase(commandMore) || word.equalsIgnoreCase(commandDeny) || word.equalsIgnoreCase(commandAccept);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the upkeep is to be charged only from clans with the member fee enabled
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isChargeUpkeepOnlyIfMemberFeeEnabled() {
|
||||
return eChargeUpkeepOnlyIfMemberFeeEnabled;
|
||||
return eChargeUpkeepOnlyIfMemberFeeEnabled;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the upkeep should be multiplied by the clan size
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isMultiplyUpkeepBySize() {
|
||||
return eMultiplyUpkeepBySize;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the upkeep is enabled
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isClanUpkeep() {
|
||||
return eClanUpkeepEnabled;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the upkeep
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getClanUpkeep() {
|
||||
if (eClanUpkeep < 0) {
|
||||
@@ -671,19 +736,21 @@ public final class SettingsManager {
|
||||
}
|
||||
return eClanUpkeep;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the max member fee allowed
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getMaxMemberFee() {
|
||||
return eMaxMemberFee;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the member fee is enabled
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isMemberFee() {
|
||||
return eMemberFee;
|
||||
@@ -696,10 +763,10 @@ public final class SettingsManager {
|
||||
public boolean isePurchaseResetKdr() {
|
||||
return ePurchaseResetKdr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the price to pay for setting the member fee
|
||||
*
|
||||
*
|
||||
* @return the price
|
||||
*/
|
||||
public double geteMemberFeeSetPrice() {
|
||||
@@ -712,6 +779,7 @@ public final class SettingsManager {
|
||||
|
||||
/**
|
||||
* Do leaders need to pay for setting the member fee?
|
||||
*
|
||||
* @return true if so
|
||||
*/
|
||||
public boolean isePurchaseMemberFeeSet() {
|
||||
@@ -720,12 +788,13 @@ public final class SettingsManager {
|
||||
|
||||
/**
|
||||
* Gets the price to reset the KDR
|
||||
*
|
||||
* @return the price
|
||||
*/
|
||||
public double geteResetKdr() {
|
||||
return eResetKdr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check whether a string has a disallowed color
|
||||
*
|
||||
@@ -801,7 +870,7 @@ public final class SettingsManager {
|
||||
if (!bannedPlayers.contains(playerUniqueId.toString())) {
|
||||
bannedPlayers.add(playerUniqueId.toString());
|
||||
}
|
||||
|
||||
|
||||
getConfig().set("settings.banned-players", bannedPlayers);
|
||||
save();
|
||||
}
|
||||
@@ -818,7 +887,7 @@ public final class SettingsManager {
|
||||
*/
|
||||
public void removeBanned(UUID playerUniqueId) {
|
||||
bannedPlayers.remove(playerUniqueId.toString());
|
||||
|
||||
|
||||
getConfig().set("settings.banned-players", bannedPlayers);
|
||||
save();
|
||||
}
|
||||
@@ -841,61 +910,61 @@ public final class SettingsManager {
|
||||
public boolean isRequireVerification() {
|
||||
return requireVerification;
|
||||
}
|
||||
|
||||
|
||||
public boolean isRejoinCooldown() {
|
||||
return rejoinCooldownEnabled;
|
||||
return rejoinCooldownEnabled;
|
||||
}
|
||||
|
||||
|
||||
public int getRejoinCooldown() {
|
||||
return rejoinCooldown;
|
||||
return rejoinCooldown;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getListDefaultOrderBy() {
|
||||
return listDefaultOrderBy;
|
||||
}
|
||||
return listDefaultOrderBy;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListDefault() {
|
||||
@Deprecated
|
||||
public String getListDefault() {
|
||||
return getListDefaultOrderBy();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListSize() {
|
||||
return "size";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListKdr() {
|
||||
return "kdr";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListName() {
|
||||
return "name";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListFounded() {
|
||||
return "founded";
|
||||
}
|
||||
@Deprecated
|
||||
public String getListSize() {
|
||||
return "size";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListActive() {
|
||||
return "active";
|
||||
}
|
||||
public String getListKdr() {
|
||||
return "kdr";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListAsc() {
|
||||
return "asc";
|
||||
}
|
||||
@Deprecated
|
||||
public String getListName() {
|
||||
return "name";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListDesc() {
|
||||
return "desc";
|
||||
}
|
||||
@Deprecated
|
||||
public String getListFounded() {
|
||||
return "founded";
|
||||
}
|
||||
|
||||
/**
|
||||
@Deprecated
|
||||
public String getListActive() {
|
||||
return "active";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListAsc() {
|
||||
return "asc";
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getListDesc() {
|
||||
return "desc";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bannedPlayers
|
||||
*/
|
||||
public List<String> getBannedPlayers() {
|
||||
@@ -1076,32 +1145,32 @@ public final class SettingsManager {
|
||||
public int getClanMinSizeToRival() {
|
||||
return clanMinSizeToRival;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the max length of the clan description
|
||||
*
|
||||
*
|
||||
* @return the max length
|
||||
*/
|
||||
public int getClanMaxDescriptionLength() {
|
||||
if (clanMaxDescriptionLength > 255 || clanMaxDescriptionLength < 0) {
|
||||
clanMaxDescriptionLength = 255;
|
||||
}
|
||||
return clanMaxDescriptionLength;
|
||||
}
|
||||
if (clanMaxDescriptionLength > 255 || clanMaxDescriptionLength < 0) {
|
||||
clanMaxDescriptionLength = 255;
|
||||
}
|
||||
return clanMaxDescriptionLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the min length of the clan description
|
||||
*
|
||||
*
|
||||
* @return the min length
|
||||
*/
|
||||
public int getClanMinDescriptionLength() {
|
||||
if (clanMinDescriptionLength < 0 || clanMinDescriptionLength > getClanMaxDescriptionLength()) {
|
||||
clanMinDescriptionLength = 0;
|
||||
}
|
||||
return clanMinDescriptionLength;
|
||||
}
|
||||
public int getClanMinDescriptionLength() {
|
||||
if (clanMinDescriptionLength < 0 || clanMinDescriptionLength > getClanMaxDescriptionLength()) {
|
||||
clanMinDescriptionLength = 0;
|
||||
}
|
||||
return clanMinDescriptionLength;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @return the clanMinLength
|
||||
*/
|
||||
public int getClanMinLength() {
|
||||
@@ -1109,7 +1178,6 @@ public final class SettingsManager {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the max number of alliances a clan can have
|
||||
*/
|
||||
public int getClanMaxAlliances() {
|
||||
@@ -1172,23 +1240,23 @@ public final class SettingsManager {
|
||||
public String getTagSeparatorColor() {
|
||||
return Helper.toColor(tagSeparatorColor);
|
||||
}
|
||||
|
||||
|
||||
public String getClanChatFormat() {
|
||||
return clanChatFormat;
|
||||
}
|
||||
|
||||
|
||||
public String getClanChatRank() {
|
||||
return clanChatRank;
|
||||
}
|
||||
|
||||
|
||||
public String getClanChatLeaderColor() {
|
||||
return Helper.toColor(clanChatLeaderColor);
|
||||
}
|
||||
|
||||
|
||||
public String getClanChatTrustedColor() {
|
||||
return Helper.toColor(clanChatTrustedColor);
|
||||
}
|
||||
|
||||
return Helper.toColor(clanChatTrustedColor);
|
||||
}
|
||||
|
||||
public String getClanChatMemberColor() {
|
||||
return Helper.toColor(clanChatMemberColor);
|
||||
}
|
||||
@@ -1215,7 +1283,7 @@ public final class SettingsManager {
|
||||
public String getClanChatNameColor() {
|
||||
return clanChatNameColor;
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* @return the clanChatTagBracketLeft
|
||||
@@ -1256,6 +1324,10 @@ public final class SettingsManager {
|
||||
return clanChatPlayerBracketRight;
|
||||
}
|
||||
|
||||
public double getKwAlly() {
|
||||
return getConfig().getDouble("kill-weights.ally");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the kwRival
|
||||
*/
|
||||
@@ -1446,10 +1518,10 @@ public final class SettingsManager {
|
||||
public boolean isConfirmationForDemote() {
|
||||
return confirmationForDemote;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the min percentage of leaders online required to demote someone
|
||||
*
|
||||
*
|
||||
* @return the percentage
|
||||
*/
|
||||
public double getPercentageOnlineToDemote() {
|
||||
@@ -1479,23 +1551,23 @@ public final class SettingsManager {
|
||||
public String getAllyChatMessageColor() {
|
||||
return allyChatMessageColor;
|
||||
}
|
||||
|
||||
|
||||
public String getAllyChatFormat() {
|
||||
return allyChatFormat;
|
||||
}
|
||||
|
||||
|
||||
public String getAllyChatRank() {
|
||||
return allyChatRank;
|
||||
}
|
||||
|
||||
|
||||
public String getAllyChatLeaderColor() {
|
||||
return Helper.toColor(allyChatLeaderColor);
|
||||
}
|
||||
|
||||
|
||||
public String getAllyChatTrustedColor() {
|
||||
return Helper.toColor(allyChatTrustedColor);
|
||||
}
|
||||
|
||||
return Helper.toColor(allyChatTrustedColor);
|
||||
}
|
||||
|
||||
public String getAllyChatMemberColor() {
|
||||
return Helper.toColor(allyChatMemberColor);
|
||||
}
|
||||
@@ -1529,7 +1601,7 @@ public final class SettingsManager {
|
||||
public String getAllyChatPlayerBracketRight() {
|
||||
return allyChatPlayerBracketRight;
|
||||
}
|
||||
|
||||
|
||||
public String getCommandGlobal() {
|
||||
return commandGlobal;
|
||||
}
|
||||
@@ -1609,7 +1681,7 @@ public final class SettingsManager {
|
||||
public boolean isePurchaseHomeTeleport() {
|
||||
return ePurchaseHomeTeleport;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the eUniqueTaxOnRegroup
|
||||
*/
|
||||
@@ -1618,13 +1690,12 @@ public final class SettingsManager {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the eIssuerPaysRegroup
|
||||
*/
|
||||
public boolean iseIssuerPaysRegroup() {
|
||||
return eIssuerPaysRegroup;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the ePurchaseHomeRegroup
|
||||
*/
|
||||
@@ -1638,12 +1709,12 @@ public final class SettingsManager {
|
||||
public double getHomeTeleportPrice() {
|
||||
return eHomeTeleportPrice;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the HomeRegroupPrice
|
||||
*/
|
||||
public double getHomeRegroupPrice() {
|
||||
return eHomeRegroupPrice;
|
||||
return Math.abs(eHomeRegroupPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1761,24 +1832,28 @@ public final class SettingsManager {
|
||||
this.forceCommandPriority = forceCommandPriority;
|
||||
}
|
||||
|
||||
public int getMembersOnlineMaxDifference() {
|
||||
return getConfig().getInt("war-and-protection.war-start.members-online-max-difference", 5);
|
||||
}
|
||||
|
||||
public int getMaxMembers() {
|
||||
return this.maxMembers;
|
||||
}
|
||||
|
||||
public boolean isSavePeriodically() {
|
||||
return savePeriodically;
|
||||
}
|
||||
public boolean isSavePeriodically() {
|
||||
return savePeriodically;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the interval to save the data
|
||||
*
|
||||
* @return the interval in seconds
|
||||
*/
|
||||
public int getSaveInterval() {
|
||||
if (saveInterval < 1) {
|
||||
saveInterval = 5;
|
||||
}
|
||||
|
||||
return saveInterval * 60;
|
||||
}
|
||||
/**
|
||||
* Gets the interval to save the data
|
||||
*
|
||||
* @return the interval in seconds
|
||||
*/
|
||||
public int getSaveInterval() {
|
||||
if (saveInterval < 1) {
|
||||
saveInterval = 5;
|
||||
}
|
||||
|
||||
return saveInterval * 60;
|
||||
}
|
||||
}
|
||||
+137
-144
@@ -1,9 +1,8 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.managers;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ClanBalanceUpdateEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.storage.DBCore;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.storage.MySQLCore;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.storage.SQLiteCore;
|
||||
@@ -11,22 +10,23 @@ import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.YAMLSerializer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDFetcher;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.*;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
@@ -51,8 +51,8 @@ public final class StorageManager {
|
||||
/**
|
||||
* Retrieve a player's pending chat lines
|
||||
*
|
||||
* @param player
|
||||
* @return
|
||||
* @param player the Player
|
||||
* @return the ChatBlock
|
||||
*/
|
||||
public ChatBlock getChatBlock(Player player) {
|
||||
return chatBlocks.get(player.getUniqueId().toString());
|
||||
@@ -61,8 +61,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Store pending chat lines for a player
|
||||
*
|
||||
* @param player
|
||||
* @param cb
|
||||
*/
|
||||
public void addChatBlock(CommandSender player, ChatBlock cb) {
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(player.getName());
|
||||
@@ -124,6 +122,7 @@ public final class StorageManager {
|
||||
+ " `neutral_kills` int(11) default NULL,"
|
||||
+ " `rival_kills` int(11) default NULL,"
|
||||
+ " `civilian_kills` int(11) default NULL,"
|
||||
+ " `ally_kills` int(11) default NULL,"
|
||||
+ " `deaths` int(11) default NULL,"
|
||||
+ " `last_seen` bigint NOT NULL,"
|
||||
+ " `join_date` bigint NOT NULL,"
|
||||
@@ -200,6 +199,7 @@ public final class StorageManager {
|
||||
+ " `neutral_kills` int(11) default NULL,"
|
||||
+ " `rival_kills` int(11) default NULL,"
|
||||
+ " `civilian_kills` int(11) default NULL,"
|
||||
+ " `ally_kills` int(11) default NULL,"
|
||||
+ " `deaths` int(11) default NULL,"
|
||||
+ " `last_seen` bigint NOT NULL,"
|
||||
+ " `join_date` bigint NOT NULL,"
|
||||
@@ -281,7 +281,6 @@ public final class StorageManager {
|
||||
* Import one ClanPlayer data from database to memory
|
||||
* Used for BungeeCord Reload ClanPlayer and your Clan
|
||||
*
|
||||
* @param player
|
||||
*/
|
||||
public void importFromDatabaseOnePlayer(Player player) {
|
||||
plugin.getClanManager().deleteClanPlayerFromMemory(player.getUniqueId());
|
||||
@@ -304,6 +303,9 @@ public final class StorageManager {
|
||||
List<Clan> purge = new ArrayList<>();
|
||||
|
||||
for (Clan clan : clans) {
|
||||
if (clan.isPermanent()) {
|
||||
continue;
|
||||
}
|
||||
if (clan.isVerified()) {
|
||||
int purgeClan = plugin.getSettingsManager().getPurgeClan();
|
||||
if (clan.getInactiveDays() > purgeClan && purgeClan > 0) {
|
||||
@@ -347,12 +349,11 @@ public final class StorageManager {
|
||||
/**
|
||||
* Retrieves all simple clans from the database
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Clan> retrieveClans() {
|
||||
List<Clan> out = new ArrayList<>();
|
||||
|
||||
String query = "SELECT * FROM `sc_clans`;";
|
||||
String query = "SELECT * FROM `sc_clans`;";
|
||||
ResultSet res = core.select(query);
|
||||
|
||||
if (res != null) {
|
||||
@@ -368,7 +369,6 @@ public final class StorageManager {
|
||||
String packed_allies = res.getString("packed_allies");
|
||||
String packed_rivals = res.getString("packed_rivals");
|
||||
String packed_bb = res.getString("packed_bb");
|
||||
String cape_url = res.getString("cape_url");
|
||||
String flags = res.getString("flags");
|
||||
JSONObject ranks = Helper.parseJson(res.getString("ranks"));
|
||||
long founded = res.getLong("founded");
|
||||
@@ -397,10 +397,9 @@ public final class StorageManager {
|
||||
clan.setPackedAllies(packed_allies);
|
||||
clan.setPackedRivals(packed_rivals);
|
||||
clan.setPackedBb(packed_bb);
|
||||
clan.setCapeUrl(cape_url);
|
||||
clan.setFounded(founded);
|
||||
clan.setLastUsed(last_used);
|
||||
clan.setBalance(balance);
|
||||
clan.setBalance(null, ClanBalanceUpdateEvent.Cause.LOADING, balance);
|
||||
clan.setMemberFee(feeValue);
|
||||
clan.setMemberFeeEnabled(feeEnabled);
|
||||
clan.setRanks(Helper.ranksFromJson(ranks));
|
||||
@@ -409,9 +408,7 @@ public final class StorageManager {
|
||||
|
||||
out.add(clan);
|
||||
} catch (Exception ex) {
|
||||
for (StackTraceElement el : ex.getStackTrace()) {
|
||||
System.out.print(el.toString());
|
||||
}
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
@@ -426,11 +423,8 @@ public final class StorageManager {
|
||||
/**
|
||||
* Retrieves one Clan from the database
|
||||
* Used for BungeeCord Reload ClanPlayer and your Clan
|
||||
*
|
||||
* @param tagClan
|
||||
* @return
|
||||
*/
|
||||
public Clan retrieveOneClan(String tagClan) {
|
||||
public @Nullable Clan retrieveOneClan(String tagClan) {
|
||||
Clan out = null;
|
||||
|
||||
String query = "SELECT * FROM `sc_clans` WHERE `tag` = '" + tagClan + "';";
|
||||
@@ -449,7 +443,6 @@ public final class StorageManager {
|
||||
String packed_allies = res.getString("packed_allies");
|
||||
String packed_rivals = res.getString("packed_rivals");
|
||||
String packed_bb = res.getString("packed_bb");
|
||||
String cape_url = res.getString("cape_url");
|
||||
String flags = res.getString("flags");
|
||||
JSONObject ranks = Helper.parseJson(res.getString("ranks"));
|
||||
long founded = res.getLong("founded");
|
||||
@@ -478,10 +471,9 @@ public final class StorageManager {
|
||||
clan.setPackedAllies(packed_allies);
|
||||
clan.setPackedRivals(packed_rivals);
|
||||
clan.setPackedBb(packed_bb);
|
||||
clan.setCapeUrl(cape_url);
|
||||
clan.setFounded(founded);
|
||||
clan.setLastUsed(last_used);
|
||||
clan.setBalance(balance);
|
||||
clan.setBalance(null, ClanBalanceUpdateEvent.Cause.LOADING, balance);
|
||||
clan.setMemberFee(feeValue);
|
||||
clan.setMemberFeeEnabled(feeEnabled);
|
||||
clan.setRanks(Helper.ranksFromJson(ranks));
|
||||
@@ -490,9 +482,7 @@ public final class StorageManager {
|
||||
|
||||
out = clan;
|
||||
} catch (Exception ex) {
|
||||
for (StackTraceElement el : ex.getStackTrace()) {
|
||||
System.out.print(el.toString());
|
||||
}
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
@@ -507,7 +497,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Retrieves all clan players from the database
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<ClanPlayer> retrieveClanPlayers() {
|
||||
List<ClanPlayer> out = new ArrayList<>();
|
||||
@@ -528,6 +517,7 @@ public final class StorageManager {
|
||||
int neutral_kills = res.getInt("neutral_kills");
|
||||
int rival_kills = res.getInt("rival_kills");
|
||||
int civilian_kills = res.getInt("civilian_kills");
|
||||
int ally_kills = res.getInt("ally_kills");
|
||||
int deaths = res.getInt("deaths");
|
||||
long last_seen = res.getLong("last_seen");
|
||||
long join_date = res.getLong("join_date");
|
||||
@@ -555,6 +545,7 @@ public final class StorageManager {
|
||||
cp.setNeutralKills(neutral_kills);
|
||||
cp.setRivalKills(rival_kills);
|
||||
cp.setCivilianKills(civilian_kills);
|
||||
cp.setAllyKills(ally_kills);
|
||||
cp.setDeaths(deaths);
|
||||
cp.setLastSeen(last_seen);
|
||||
cp.setJoinDate(join_date);
|
||||
@@ -573,9 +564,7 @@ public final class StorageManager {
|
||||
|
||||
out.add(cp);
|
||||
} catch (Exception ex) {
|
||||
for (StackTraceElement el : ex.getStackTrace()) {
|
||||
System.out.print(el.toString());
|
||||
}
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
@@ -590,11 +579,8 @@ public final class StorageManager {
|
||||
/**
|
||||
* Retrieves one clan player from the database
|
||||
* Used for BungeeCord Reload ClanPlayer and your Clan
|
||||
*
|
||||
* @param playerUniqueId
|
||||
* @return
|
||||
*/
|
||||
public ClanPlayer retrieveOneClanPlayer(UUID playerUniqueId) {
|
||||
public @Nullable ClanPlayer retrieveOneClanPlayer(UUID playerUniqueId) {
|
||||
ClanPlayer out = null;
|
||||
|
||||
String query = "SELECT * FROM `sc_players` WHERE `uuid` = '" + playerUniqueId.toString() + "';";
|
||||
@@ -613,11 +599,12 @@ public final class StorageManager {
|
||||
int neutral_kills = res.getInt("neutral_kills");
|
||||
int rival_kills = res.getInt("rival_kills");
|
||||
int civilian_kills = res.getInt("civilian_kills");
|
||||
int ally_kills = res.getInt("ally_kills");
|
||||
int deaths = res.getInt("deaths");
|
||||
long last_seen = res.getLong("last_seen");
|
||||
long join_date = res.getLong("join_date");
|
||||
String flags = res.getString("flags");
|
||||
String packed_past_clans = Helper.parseColors(res.getString("packed_past_clans"));
|
||||
String packed_past_clans = ChatUtils.parseColors(res.getString("packed_past_clans"));
|
||||
String resign_times = res.getString("resign_times");
|
||||
Locale locale = Helper.forLanguageTag(res.getString("locale"));
|
||||
|
||||
@@ -640,6 +627,7 @@ public final class StorageManager {
|
||||
cp.setNeutralKills(neutral_kills);
|
||||
cp.setRivalKills(rival_kills);
|
||||
cp.setCivilianKills(civilian_kills);
|
||||
cp.setAllyKills(ally_kills);
|
||||
cp.setDeaths(deaths);
|
||||
cp.setLastSeen(last_seen);
|
||||
cp.setJoinDate(join_date);
|
||||
@@ -652,7 +640,7 @@ public final class StorageManager {
|
||||
Clan clanDB = retrieveOneClan(tag);
|
||||
Clan clan = SimpleClans.getInstance().getClanManager().getClan(tag);
|
||||
|
||||
if (clan != null) {
|
||||
if (clan != null && clanDB != null) {
|
||||
Clan clanReSync = SimpleClans.getInstance().getClanManager().getClan(tag);
|
||||
clanReSync.setFlags(clanDB.getFlags());
|
||||
clanReSync.setVerified(clanDB.isVerified());
|
||||
@@ -663,10 +651,9 @@ public final class StorageManager {
|
||||
clanReSync.setPackedAllies(clanDB.getPackedAllies());
|
||||
clanReSync.setPackedRivals(clanDB.getPackedRivals());
|
||||
clanReSync.setPackedBb(clanDB.getPackedBb());
|
||||
clanReSync.setCapeUrl(clanDB.getCapeUrl());
|
||||
clanReSync.setFounded(clanDB.getFounded());
|
||||
clanReSync.setLastUsed(clanDB.getLastUsed());
|
||||
clanReSync.setBalance(clanDB.getBalance());
|
||||
clanReSync.setBalance(null, ClanBalanceUpdateEvent.Cause.LOADING, clanDB.getBalance());
|
||||
cp.setClan(clanReSync);
|
||||
} else {
|
||||
plugin.getClanManager().importClan(clanDB);
|
||||
@@ -678,9 +665,7 @@ public final class StorageManager {
|
||||
|
||||
out = cp;
|
||||
} catch (Exception ex) {
|
||||
for (StackTraceElement el : ex.getStackTrace()) {
|
||||
System.out.print(el.toString());
|
||||
}
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
@@ -695,7 +680,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Insert a clan into the database
|
||||
*
|
||||
* @param clan
|
||||
*/
|
||||
public void insertClan(Clan clan) {
|
||||
String query = "INSERT INTO `sc_clans` (`banner`, `ranks`, `description`, `fee_enabled`, `fee_value`, `verified`, `tag`," +
|
||||
@@ -726,7 +710,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Update a clan to the database asynchronously
|
||||
*
|
||||
* @param clan
|
||||
*/
|
||||
@Deprecated
|
||||
public void updateClanAsync(final Clan clan) {
|
||||
@@ -765,7 +748,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Update a clan to the database
|
||||
*
|
||||
* @param clan
|
||||
*/
|
||||
public void updateClan(Clan clan) {
|
||||
updateClan(clan, true);
|
||||
@@ -782,42 +764,48 @@ public final class StorageManager {
|
||||
if (updateLastUsed) {
|
||||
clan.updateLastUsed();
|
||||
}
|
||||
if (plugin.getSettingsManager().isSavePeriodically()) {
|
||||
modifiedClans.add(clan);
|
||||
return;
|
||||
}
|
||||
core.update(getUpdateClanQuery(clan));
|
||||
if (plugin.getSettingsManager().isSavePeriodically()) {
|
||||
modifiedClans.add(clan);
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement st = prepareUpdateClanStatement(core.getConnection())) {
|
||||
setValues(st, clan);
|
||||
st.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, String.format("Error updating Clan %s", clan.getTag()), ex);
|
||||
}
|
||||
}
|
||||
|
||||
private String getUpdateClanQuery(Clan clan) {
|
||||
String query = "UPDATE `sc_clans`" +
|
||||
" SET ranks = '"+ Helper.escapeQuotes(Helper.ranksToJson(clan.getRanks(), clan.getDefaultRank())) +"'," +
|
||||
" banner = '" + Helper.escapeQuotes(YAMLSerializer.serialize(clan.getBanner())) + "'," +
|
||||
" description = '" + Helper.escapeQuotes(clan.getDescription())+ "'," +
|
||||
" fee_enabled = "+ (clan.isMemberFeeEnabled() ? 1 : 0) +"," +
|
||||
" fee_value = '" + clan.getMemberFee() + "'," +
|
||||
" verified = " + (clan.isVerified() ? 1 : 0) + "," +
|
||||
" tag = '" + Helper.escapeQuotes(clan.getTag()) + "'," +
|
||||
" color_tag = '" + Helper.escapeQuotes(clan.getColorTag()) + "'," +
|
||||
" name = '" + Helper.escapeQuotes(clan.getName()) + "'," +
|
||||
" friendly_fire = " + (clan.isFriendlyFire() ? 1 : 0) + "," +
|
||||
" founded = '" + clan.getFounded() + "'," +
|
||||
" last_used = '" + clan.getLastUsed() + "'," +
|
||||
" packed_allies = '" + Helper.escapeQuotes(clan.getPackedAllies()) + "'," +
|
||||
" packed_rivals = '" + Helper.escapeQuotes(clan.getPackedRivals()) + "'," +
|
||||
" packed_bb = '" + Helper.escapeQuotes(clan.getPackedBb()) + "'," +
|
||||
" cape_url = '" + Helper.escapeQuotes(clan.getCapeUrl()) + "'," +
|
||||
" cape_url = '" + Helper.escapeQuotes(String.valueOf(clan.getCapeUrl())) + "'," +
|
||||
" balance = '" + clan.getBalance() + "'," +
|
||||
" flags = '" + Helper.escapeQuotes(clan.getFlags())
|
||||
+ "' WHERE tag = '" + Helper.escapeQuotes(clan.getTag()) + "';";
|
||||
return query;
|
||||
|
||||
private PreparedStatement prepareUpdateClanStatement(Connection connection) throws SQLException {
|
||||
String sql = "UPDATE `sc_clans` SET ranks = ?, banner = ?, description = ?, fee_enabled = ?, fee_value = ?, " +
|
||||
"verified = ?, tag = ?, color_tag = ?, `name` = ?, friendly_fire = ?, founded = ?, last_used = ?, " +
|
||||
"packed_allies = ?, packed_rivals = ?, packed_bb = ?, balance = ?, flags = ? WHERE tag = ?;";
|
||||
return connection.prepareStatement(sql);
|
||||
}
|
||||
|
||||
private void setValues(PreparedStatement statement, Clan clan) throws SQLException {
|
||||
statement.setString(1, Helper.ranksToJson(clan.getRanks(), clan.getDefaultRank()));
|
||||
statement.setString(2, YAMLSerializer.serialize(clan.getBanner()));
|
||||
statement.setString(3, clan.getDescription());
|
||||
statement.setInt(4, clan.isMemberFeeEnabled() ? 1 : 0);
|
||||
statement.setDouble(5, clan.getMemberFee());
|
||||
statement.setInt(6, clan.isVerified() ? 1 : 0);
|
||||
statement.setString(7, clan.getTag());
|
||||
statement.setString(8, clan.getColorTag());
|
||||
statement.setString(9, clan.getName());
|
||||
statement.setInt(10, clan.isFriendlyFire() ? 1 : 0);
|
||||
statement.setLong(11, clan.getFounded());
|
||||
statement.setLong(12, clan.getLastUsed());
|
||||
statement.setString(13, clan.getPackedAllies());
|
||||
statement.setString(14, clan.getPackedRivals());
|
||||
statement.setString(15, clan.getPackedBb());
|
||||
statement.setDouble(16, clan.getBalance());
|
||||
statement.setString(17, clan.getFlags());
|
||||
statement.setString(18, clan.getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a clan from the database
|
||||
*
|
||||
* @param clan
|
||||
*/
|
||||
public void deleteClan(Clan clan) {
|
||||
String query = "DELETE FROM `sc_clans` WHERE tag = '" + clan.getTag() + "';";
|
||||
@@ -827,7 +815,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Insert a clan player into the database
|
||||
*
|
||||
* @param cp
|
||||
*/
|
||||
public void insertClanPlayer(ClanPlayer cp) {
|
||||
String query = "INSERT INTO `sc_players` (`locale`, `resign_times`, `uuid`, `name`, `leader`, `tag`, `friendly_fire`, `neutral_kills`, `rival_kills`, `civilian_kills`, `deaths`, `last_seen`, `join_date`, `packed_past_clans`, `flags`) ";
|
||||
@@ -838,7 +825,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Update a clan player to the database asynchronously
|
||||
*
|
||||
* @param cp
|
||||
*/
|
||||
@Deprecated
|
||||
public void updateClanPlayerAsync(final ClanPlayer cp) {
|
||||
@@ -853,34 +839,49 @@ public final class StorageManager {
|
||||
/**
|
||||
* Update a clan player to the database
|
||||
*
|
||||
* @param cp
|
||||
*/
|
||||
public void updateClanPlayer(ClanPlayer cp) {
|
||||
cp.updateLastSeen();
|
||||
if (plugin.getSettingsManager().isSavePeriodically()) {
|
||||
modifiedClanPlayers.add(cp);
|
||||
return;
|
||||
modifiedClanPlayers.add(cp);
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement st = prepareUpdateClanPlayerStatement(core.getConnection())) {
|
||||
setValues(st, cp);
|
||||
st.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, String.format("Error updating ClanPlayer %s", cp.getName()), ex);
|
||||
}
|
||||
core.update(getUpdateClanPlayerQuery(cp));
|
||||
}
|
||||
|
||||
private String getUpdateClanPlayerQuery(ClanPlayer cp) {
|
||||
return "UPDATE `sc_players` SET" +
|
||||
" locale = '" + cp.getLocale().toLanguageTag() + "'," +
|
||||
" resign_times = '"+ Helper.escapeQuotes(Helper.resignTimesToJson(cp.getResignTimes())) +"'," +
|
||||
" leader = " + (cp.isLeader() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(cp.getTag()) + "'," +
|
||||
" friendly_fire = " + (cp.isFriendlyFire() ? 1 : 0) + ", neutral_kills = " + cp.getNeutralKills() + "," +
|
||||
" rival_kills = " + cp.getRivalKills() + ", civilian_kills = " + cp.getCivilianKills() + "," +
|
||||
" deaths = " + cp.getDeaths() + ", last_seen = '" + cp.getLastSeen() + "'," +
|
||||
" packed_past_clans = '" + Helper.escapeQuotes(cp.getPackedPastClans()) + "'," +
|
||||
" trusted = " + (cp.isTrusted() ? 1 : 0) + ", flags = '" + Helper.escapeQuotes(cp.getFlags()) + "'," +
|
||||
" name = '" + cp.getName() + "' WHERE `uuid` = '" + cp.getUniqueId().toString() + "';";
|
||||
|
||||
private PreparedStatement prepareUpdateClanPlayerStatement(Connection connection) throws SQLException {
|
||||
String sql = "UPDATE `sc_players` SET locale = ?, resign_times = ?, leader = ?, tag = ?, friendly_fire = ?," +
|
||||
" neutral_kills = ?, ally_kills = ?, rival_kills = ?, civilian_kills = ?, deaths = ?, last_seen = ?," +
|
||||
" packed_past_clans = ?, trusted = ?, flags = ?, `name` = ? WHERE `uuid` = ?;";
|
||||
return connection.prepareStatement(sql);
|
||||
}
|
||||
|
||||
private void setValues(PreparedStatement statement, ClanPlayer cp) throws SQLException {
|
||||
statement.setString(1, cp.getLocale().toLanguageTag());
|
||||
statement.setString(2, Helper.resignTimesToJson(cp.getResignTimes()));
|
||||
statement.setInt(3, cp.isLeader() ? 1 : 0);
|
||||
statement.setString(4, cp.getTag());
|
||||
statement.setInt(5, cp.isFriendlyFire() ? 1 : 0);
|
||||
statement.setInt(6, cp.getNeutralKills());
|
||||
statement.setInt(7, cp.getAllyKills());
|
||||
statement.setInt(8, cp.getRivalKills());
|
||||
statement.setInt(9, cp.getCivilianKills());
|
||||
statement.setInt(10, cp.getDeaths());
|
||||
statement.setLong(11, cp.getLastSeen());
|
||||
statement.setString(12, cp.getPackedPastClans());
|
||||
statement.setInt(13, cp.isTrusted() ? 1 : 0);
|
||||
statement.setString(14, cp.getFlags());
|
||||
statement.setString(15, cp.getName());
|
||||
statement.setString(16, cp.getUniqueId().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a clan player from the database
|
||||
*
|
||||
* @param cp
|
||||
*/
|
||||
public void deleteClanPlayer(ClanPlayer cp) {
|
||||
final Clan clan = cp.getClan();
|
||||
@@ -888,19 +889,14 @@ public final class StorageManager {
|
||||
clan.addBbWithoutSaving(ChatColor.AQUA + MessageFormat.format(lang("has.been.purged"), cp.getName()));
|
||||
updateClan(clan, false);
|
||||
}
|
||||
String query = "DELETE FROM `sc_players` WHERE uuid = '" + cp.getUniqueId() + "';";
|
||||
core.delete(query);
|
||||
deleteKills(cp.getUniqueId());
|
||||
String query = "DELETE FROM `sc_players` WHERE uuid = '" + cp.getUniqueId() + "';";
|
||||
core.delete(query);
|
||||
deleteKills(cp.getUniqueId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert a kill into the database
|
||||
*
|
||||
* @param attacker
|
||||
* @param attackerTag
|
||||
* @param victim
|
||||
* @param victimTag
|
||||
* @param type
|
||||
*/
|
||||
@Deprecated
|
||||
public void insertKill(Player attacker, String attackerTag, Player victim, String victimTag, String type) {
|
||||
@@ -927,7 +923,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Delete a player's kill record form the database
|
||||
*
|
||||
* @param playerName
|
||||
*/
|
||||
@Deprecated
|
||||
public void deleteKills(String playerName) {
|
||||
@@ -938,7 +933,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Delete a player's kill record form the database
|
||||
*
|
||||
* @param playerUniqueId
|
||||
*/
|
||||
public void deleteKills(UUID playerUniqueId) {
|
||||
String query = "DELETE FROM `sc_kills` WHERE `attacker_uuid` = '" + playerUniqueId + "'";
|
||||
@@ -948,8 +942,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Returns a map of victim->count of all kills that specific player did
|
||||
*
|
||||
* @param playerName
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Integer> getKillsPerPlayer(String playerName) {
|
||||
HashMap<String, Integer> out = new HashMap<>();
|
||||
@@ -982,7 +974,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Returns a map of tag->count of all kills
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Integer> getMostKilled() {
|
||||
HashMap<String, Integer> out = new HashMap<>();
|
||||
@@ -1016,7 +1007,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Gets, asynchronously, a map of tag->count of all kills and notifies via callback when it's ready
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getMostKilled(DataCallback<Map<String, Integer>> callback) {
|
||||
new BukkitRunnable() {
|
||||
@@ -1030,9 +1020,7 @@ public final class StorageManager {
|
||||
|
||||
/**
|
||||
* Gets, asynchronously, a map of victim->count of all kills that specific player did and notifies via callback when it's ready
|
||||
*
|
||||
* @param playerName
|
||||
* @param callback
|
||||
*
|
||||
*/
|
||||
public void getKillsPerPlayer(final String playerName, final DataCallback<Map<String, Integer>> callback) {
|
||||
new BukkitRunnable() {
|
||||
@@ -1053,7 +1041,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Notifies when the result is ready
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
void onResultReady(T data);
|
||||
}
|
||||
@@ -1061,10 +1048,9 @@ public final class StorageManager {
|
||||
/**
|
||||
* Updates the database to the latest version
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
private void updateDatabase() {
|
||||
String query = null;
|
||||
String query;
|
||||
|
||||
/*
|
||||
* From 2.2.6.3 to 2.3
|
||||
@@ -1119,6 +1105,11 @@ public final class StorageManager {
|
||||
core.execute("ALTER TABLE sc_clans ADD COLUMN `banner` text;");
|
||||
}
|
||||
|
||||
// From 2.15.1 to 2.15.2
|
||||
if (!core.existsColumn("sc_players", "ally_kills")) {
|
||||
core.execute("ALTER TABLE sc_players ADD COLUMN `ally_kills` int(11) DEFAULT NULL;");
|
||||
}
|
||||
|
||||
if (plugin.getSettingsManager().isUseMysql()) {
|
||||
core.execute("ALTER TABLE sc_clans MODIFY color_tag VARCHAR(255);");
|
||||
}
|
||||
@@ -1163,7 +1154,6 @@ public final class StorageManager {
|
||||
/**
|
||||
* Updates the database to the latest version
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
|
||||
private void updatePlayersToUUID() {
|
||||
@@ -1216,28 +1206,31 @@ public final class StorageManager {
|
||||
* @since 2.10.2
|
||||
*/
|
||||
public void saveModified() {
|
||||
try (Statement statement = core.getConnection().createStatement()) {
|
||||
List<Clan> allClans = plugin.getClanManager().getClans();
|
||||
for (Clan clan : modifiedClans) {
|
||||
if (!allClans.contains(clan)) {
|
||||
continue;
|
||||
}
|
||||
statement.addBatch(getUpdateClanQuery(clan));
|
||||
}
|
||||
List<ClanPlayer> allClanPlayers = plugin.getClanManager().getAllClanPlayers();
|
||||
for (ClanPlayer cp : modifiedClanPlayers) {
|
||||
if (!allClanPlayers.contains(cp)) {
|
||||
continue;
|
||||
}
|
||||
statement.addBatch(getUpdateClanPlayerQuery(cp));
|
||||
}
|
||||
statement.executeBatch();
|
||||
|
||||
modifiedClans.clear();
|
||||
modifiedClanPlayers.clear();
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().severe("Error saving modified Clans and ClanPlayers:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try (PreparedStatement pst = prepareUpdateClanPlayerStatement(core.getConnection())) {
|
||||
//removing purged players
|
||||
modifiedClanPlayers.retainAll(plugin.getClanManager().getAllClanPlayers());
|
||||
for (ClanPlayer cp : modifiedClanPlayers) {
|
||||
setValues(pst, cp);
|
||||
pst.addBatch();
|
||||
}
|
||||
pst.executeBatch();
|
||||
|
||||
modifiedClanPlayers.clear();
|
||||
} catch (SQLException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Error saving modified ClanPlayers:", ex);
|
||||
}
|
||||
try (PreparedStatement pst = prepareUpdateClanStatement(core.getConnection())) {
|
||||
//removing disbanded clans
|
||||
modifiedClans.retainAll(plugin.getClanManager().getClans());
|
||||
for (Clan clan : modifiedClans) {
|
||||
setValues(pst, clan);
|
||||
pst.addBatch();
|
||||
}
|
||||
pst.executeBatch();
|
||||
|
||||
modifiedClans.clear();
|
||||
} catch (SQLException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Error saving modified Clans:", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class MySQLCore implements DBCore {
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
try {
|
||||
if (connection == null || connection.isClosed()) {
|
||||
if (connection == null || connection.isClosed() || !connection.isValid(0)) {
|
||||
initialize();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.sacredlabyrinth.phaed.simpleclans.tasks;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ClanBalanceUpdateEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@@ -57,7 +58,7 @@ public class CollectFeeTask extends BukkitRunnable {
|
||||
if (success) {
|
||||
ChatBlock.sendMessage(cp.toPlayer(), ChatColor.AQUA +
|
||||
MessageFormat.format(lang("fee.collected",cp.toPlayer()), memberFee));
|
||||
clan.setBalance(clan.getBalance() + memberFee);
|
||||
clan.deposit(cp.toPlayer(), ClanBalanceUpdateEvent.Cause.MEMBER_FEE, memberFee);
|
||||
plugin.getStorageManager().updateClan(clan);
|
||||
} else {
|
||||
clan.removePlayerFromClan(cp.getUniqueId());
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.tasks;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.EconomyResponse;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ClanBalanceUpdateEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
@@ -48,12 +52,13 @@ public class CollectUpkeepTask extends BukkitRunnable {
|
||||
if (settingsManager.isMultiplyUpkeepBySize()) {
|
||||
upkeep = upkeep * clan.getSize();
|
||||
}
|
||||
final double balance = clan.getBalance();
|
||||
if (balance >= upkeep) {
|
||||
clan.setBalance(balance - upkeep);
|
||||
|
||||
EconomyResponse response = clan.withdraw(null, ClanBalanceUpdateEvent.Cause.UPKEEP, upkeep);
|
||||
if (response == EconomyResponse.NOT_ENOUGH_BALANCE) {
|
||||
clan.disband(null, true, false);
|
||||
}
|
||||
if (response == EconomyResponse.SUCCESS) {
|
||||
clan.addBb(ChatColor.AQUA + MessageFormat.format(lang("upkeep.collected"), upkeep), false);
|
||||
} else {
|
||||
clan.disband();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,10 +3,8 @@ package net.sacredlabyrinth.phaed.simpleclans.ui;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.RankPermission;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import java.util.*;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ComponentClickEvent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.frames.ConfirmationFrame;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.frames.WarningFrame;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -23,6 +21,8 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
/**
|
||||
@@ -134,11 +134,11 @@ public class InventoryController implements Listener {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
PermissionsManager pm = plugin.getPermissionsManager();
|
||||
if (permission instanceof String) {
|
||||
String permS = (String) permission;
|
||||
boolean leaderPerm = permS.contains("simpleclans.leader") && !permS.equalsIgnoreCase("simpleclans.leader.create");
|
||||
String perms = (String) permission;
|
||||
boolean leaderPerm = perms.contains("simpleclans.leader") && !perms.equalsIgnoreCase("simpleclans.leader.create");
|
||||
ClanPlayer cp = plugin.getClanManager().getAnyClanPlayer(player.getUniqueId());
|
||||
|
||||
return pm.has(player, permS) && (!leaderPerm || (cp != null && cp.isLeader()));
|
||||
return pm.has(player, perms) && (!leaderPerm || (cp != null && cp.isLeader()));
|
||||
}
|
||||
return pm.has(player, (RankPermission) permission, false);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class AddAllyFrame extends SCFrame {
|
||||
notAllies = plugin.getClanManager().getClans().stream()
|
||||
.filter(c -> !c.equals(subject) && !c.isRival(subject.getTag()) && !c.isAlly(subject.getTag()))
|
||||
.collect(Collectors.toList());
|
||||
paginator = new Paginator(getSize() - 9, notAllies.size());
|
||||
paginator = new Paginator(getSize() - 9, notAllies);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ClanListFrame extends SCFrame {
|
||||
|
||||
public ClanListFrame(SCFrame parent, Player viewer) {
|
||||
super(parent, viewer);
|
||||
paginator = new Paginator(getSize() - 9, clans.size());
|
||||
paginator = new Paginator(getSize() - 9, clans);
|
||||
plugin.getClanManager().sortClansByKDR(clans);
|
||||
|
||||
rankingResolver = new RankingNumberResolver<>(clans, c -> KDRFormat.toBigDecimal(c.getTotalKDR()), false,
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.sacredlabyrinth.phaed.simpleclans.ui.frames;
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
@@ -27,10 +28,10 @@ import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
public class Components {
|
||||
|
||||
private Components() {
|
||||
}
|
||||
private Components() {
|
||||
}
|
||||
|
||||
public static SCComponent getPlayerComponent(SCFrame frame, Player viewer, OfflinePlayer subject, int slot,
|
||||
public static SCComponent getPlayerComponent(SCFrame frame, Player viewer, OfflinePlayer subject, int slot,
|
||||
boolean openDetails) {
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getCreateClanPlayer(subject.getUniqueId());
|
||||
|
||||
@@ -40,17 +41,16 @@ public class Components {
|
||||
public static SCComponent getPlayerComponent(SCFrame frame, Player viewer, ClanPlayer cp, int slot,
|
||||
boolean openDetails) {
|
||||
SimpleClans pl = SimpleClans.getInstance();
|
||||
|
||||
String status = getPlayerStatus(viewer, cp);
|
||||
SCComponent c = new SCComponentImpl(lang("gui.playerdetails.player.title",viewer, cp.getName()),
|
||||
SCComponent c = new SCComponentImpl(lang("gui.playerdetails.player.title", viewer, cp.getName()),
|
||||
Arrays.asList(
|
||||
cp.getClan() == null ? lang("gui.playerdetails.player.lore.noclan",viewer)
|
||||
: lang("gui.playerdetails.player.lore.clan",viewer, cp.getClan().getColorTag(),
|
||||
cp.getClan() == null ? lang("gui.playerdetails.player.lore.noclan", viewer)
|
||||
: lang("gui.playerdetails.player.lore.clan", viewer, cp.getClan().getColorTag(),
|
||||
cp.getClan().getName()),
|
||||
lang("gui.playerdetails.player.lore.rank",viewer,
|
||||
lang("gui.playerdetails.player.lore.rank", viewer,
|
||||
ChatUtils.parseColors(cp.getRankDisplayName())),
|
||||
lang("gui.playerdetails.player.lore.status",viewer, status),
|
||||
lang("gui.playerdetails.player.lore.kdr",viewer,
|
||||
lang("gui.playerdetails.player.lore.status", viewer, status),
|
||||
lang("gui.playerdetails.player.lore.kdr", viewer,
|
||||
new DecimalFormat("#.#").format(cp.getKDR())),
|
||||
lang("gui.playerdetails.player.lore.kill.totals", viewer, cp.getRivalKills(),
|
||||
cp.getNeutralKills(), cp.getCivilianKills()),
|
||||
@@ -78,17 +78,17 @@ public class Components {
|
||||
|
||||
@NotNull
|
||||
private static String getPlayerStatus(Player viewer, ClanPlayer cp) {
|
||||
if (cp.getClan() == null) {
|
||||
return lang("free.agent", viewer);
|
||||
if (cp.getClan() == null) {
|
||||
return lang("free.agent", viewer);
|
||||
}
|
||||
if (cp.isLeader()) {
|
||||
return lang("leader", viewer);
|
||||
if (cp.isLeader()) {
|
||||
return lang("leader", viewer);
|
||||
}
|
||||
if (cp.isTrusted()) {
|
||||
return lang("trusted", viewer);
|
||||
if (cp.isTrusted()) {
|
||||
return lang("trusted", viewer);
|
||||
}
|
||||
if (cp.getRankId() != null && !cp.getRankId().isEmpty()) {
|
||||
return lang("in.rank", viewer);
|
||||
if (cp.getRankId() != null && !cp.getRankId().isEmpty()) {
|
||||
return lang("in.rank", viewer);
|
||||
}
|
||||
return lang("untrusted", viewer);
|
||||
}
|
||||
@@ -99,26 +99,24 @@ public class Components {
|
||||
String name;
|
||||
List<String> lore;
|
||||
if (clan != null) {
|
||||
name = lang("gui.clandetails.clan.title",viewer, clan.getColorTag(), clan.getName());
|
||||
name = lang("gui.clandetails.clan.title", viewer, clan.getColorTag(), clan.getName());
|
||||
lore = Arrays.asList(
|
||||
lang("gui.clandetails.clan.lore.description",viewer,
|
||||
clan.getDescription() != null && !clan.getDescription().isEmpty() ? clan.getDescription() : lang("no.description",viewer)),
|
||||
lang("gui.clandetails.clan.lore.status",viewer, clan.isVerified() ? lang("verified",viewer) : lang("unverified",viewer)),
|
||||
lang("gui.clandetails.clan.lore.leaders",viewer, clan.getLeadersString("", ", ")),
|
||||
lang("gui.clandetails.clan.lore.online.members",viewer, VanishUtils.getNonVanished(viewer, clan).size(), clan.getMembers().size()),
|
||||
lang("gui.clandetails.clan.lore.kdr",viewer, KDRFormat.format(clan.getTotalKDR())),
|
||||
lang("gui.clandetails.clan.lore.kill.totals",viewer, clan.getTotalRival(), clan.getTotalNeutral(), clan.getTotalCivilian()),
|
||||
lang("gui.clandetails.clan.lore.deaths",viewer, clan.getTotalDeaths()),
|
||||
lang("gui.clandetails.clan.lore.fee",viewer, clan.isMemberFeeEnabled()
|
||||
? lang("fee.enabled",viewer) : lang("fee.disabled",viewer), clan.getMemberFee()),
|
||||
lang("gui.clandetails.clan.lore.allies",viewer, clan.getAllies().isEmpty() ? lang("none",viewer) : clan.getAllyString(lang("gui.clandetails.clan.lore.allies.separator",viewer))),
|
||||
lang("gui.clandetails.clan.lore.rivals",viewer, clan.getRivals().isEmpty() ? lang("none",viewer) : clan.getRivalString(lang("gui.clandetails.clan.lore.rivals.separator",viewer))),
|
||||
lang("gui.clandetails.clan.lore.founded",viewer, clan.getFoundedString()),
|
||||
lang("gui.clandetails.clan.lore.inactive",viewer, clan.getInactiveDays(), (clan.isVerified() ?
|
||||
pl.getSettingsManager().getPurgeClan() : pl.getSettingsManager().getPurgeUnverified())
|
||||
));
|
||||
lang("gui.clandetails.clan.lore.description", viewer,
|
||||
clan.getDescription() != null && !clan.getDescription().isEmpty() ? clan.getDescription() : lang("no.description", viewer)),
|
||||
lang("gui.clandetails.clan.lore.status", viewer, Helper.getFormattedClanStatus(clan, viewer)),
|
||||
lang("gui.clandetails.clan.lore.leaders", viewer, clan.getLeadersString("", ", ")),
|
||||
lang("gui.clandetails.clan.lore.online.members", viewer, VanishUtils.getNonVanished(viewer, clan).size(), clan.getMembers().size()),
|
||||
lang("gui.clandetails.clan.lore.kdr", viewer, KDRFormat.format(clan.getTotalKDR())),
|
||||
lang("gui.clandetails.clan.lore.kill.totals", viewer, clan.getTotalRival(), clan.getTotalNeutral(), clan.getTotalCivilian()),
|
||||
lang("gui.clandetails.clan.lore.deaths", viewer, clan.getTotalDeaths()),
|
||||
lang("gui.clandetails.clan.lore.fee", viewer, clan.isMemberFeeEnabled()
|
||||
? lang("fee.enabled", viewer) : lang("fee.disabled", viewer), clan.getMemberFee()),
|
||||
lang("gui.clandetails.clan.lore.allies", viewer, clan.getAllies().isEmpty() ? lang("none", viewer) : clan.getAllyString(lang("gui.clandetails.clan.lore.allies.separator", viewer))),
|
||||
lang("gui.clandetails.clan.lore.rivals", viewer, clan.getRivals().isEmpty() ? lang("none", viewer) : clan.getRivalString(lang("gui.clandetails.clan.lore.rivals.separator", viewer))),
|
||||
lang("gui.clandetails.clan.lore.founded", viewer, clan.getFoundedString()),
|
||||
lang("gui.clandetails.clan.lore.inactive", viewer, clan.getInactiveDays(), Helper.formatMaxInactiveDays(clan.getMaxInactiveDays())));
|
||||
} else {
|
||||
name = lang("gui.clandetails.free.agent.title",viewer);
|
||||
name = lang("gui.clandetails.free.agent.title", viewer);
|
||||
double price = pl.getSettingsManager().isePurchaseCreation() ? pl.getSettingsManager().getCreationPrice() : 0;
|
||||
lore = new ArrayList<>();
|
||||
if (price != 0) {
|
||||
@@ -163,8 +161,8 @@ public class Components {
|
||||
}
|
||||
|
||||
public static @NotNull SCComponent getPreviousPageComponent(int slot, @Nullable Runnable listener, @NotNull Paginator paginator, @NotNull Player viewer) {
|
||||
if (!paginator.hasPreviousPage()) {
|
||||
return getPanelComponent(slot);
|
||||
if (!paginator.hasPreviousPage()) {
|
||||
return getPanelComponent(slot);
|
||||
}
|
||||
SCComponent c = new SCComponentImpl(lang("gui.previous.page.title", viewer), null,
|
||||
XMaterial.STONE_BUTTON, slot);
|
||||
|
||||
@@ -25,22 +25,19 @@ import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
public class CoordsFrame extends SCFrame {
|
||||
|
||||
private final Clan subject;
|
||||
private Paginator paginator;
|
||||
private final List<ClanPlayer> allMembers;
|
||||
private final Paginator paginator;
|
||||
|
||||
public CoordsFrame(Player viewer, SCFrame parent, Clan subject) {
|
||||
super(parent, viewer);
|
||||
allMembers = VanishUtils.getNonVanished(getViewer(), subject);
|
||||
allMembers.sort((cp1, cp2) -> Boolean.compare(cp1.isLeader(), cp2.isLeader()));
|
||||
|
||||
this.subject = subject;
|
||||
paginator = new Paginator(getSize() - 9, allMembers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createComponents() {
|
||||
List<ClanPlayer> allMembers = VanishUtils.getNonVanished(getViewer(), subject);
|
||||
allMembers.sort((cp1, cp2) -> Boolean.compare(cp1.isLeader(), cp2.isLeader()));
|
||||
|
||||
paginator = new Paginator(getSize() - 9, allMembers.size());
|
||||
|
||||
for (int slot = 0; slot < 9; slot++) {
|
||||
if (slot == 2 || slot == 6 || slot == 7)
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class LanguageSelectorFrame extends SCFrame {
|
||||
plugin = SimpleClans.getInstance();
|
||||
clanPlayer = plugin.getClanManager().getCreateClanPlayer(viewer.getUniqueId());
|
||||
languages = LanguageResource.getAvailableLocales();
|
||||
paginator = new Paginator(getSize() - 9, languages.size());
|
||||
paginator = new Paginator(getSize() - 9, languages);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ public class LeaderboardFrame extends SCFrame {
|
||||
|
||||
rankingResolver = new RankingNumberResolver<>(clanPlayers, c -> KDRFormat.toBigDecimal(c.getKDR()), false,
|
||||
plugin.getSettingsManager().getRankingType());
|
||||
paginator = new Paginator(getSize() - 9, this.clanPlayers.size());
|
||||
paginator = new Paginator(getSize() - 9, this.clanPlayers);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RanksFrame extends SCFrame {
|
||||
super(parent, viewer);
|
||||
this.toEdit = toEdit;
|
||||
ranks = subject != null ? subject.getRanks() : new ArrayList<>();
|
||||
paginator = new Paginator(getSize() - 9, ranks.size());
|
||||
paginator = new Paginator(getSize() - 9, ranks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ public class RivalsFrame extends SCFrame {
|
||||
super(parent, viewer);
|
||||
this.subject = subject;
|
||||
rivals = subject.getRivals();
|
||||
paginator = new Paginator(getSize() - 9, rivals.size());
|
||||
paginator = new Paginator(getSize() - 9, rivals);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,13 +3,13 @@ package net.sacredlabyrinth.phaed.simpleclans.ui.frames;
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.RankPermission;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.InventoryDrawer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.SCComponent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.SCComponentImpl;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.SCFrame;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ui.frames.staff.PlayerDetailsFrame;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.utils.Paginator;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -97,7 +97,7 @@ public class RosterFrame extends SCFrame {
|
||||
|
||||
@Override
|
||||
public @NotNull String getTitle() {
|
||||
return lang("gui.roster.title", getViewer(), Helper.stripColors(subject.getColorTag()));
|
||||
return lang("gui.roster.title", getViewer(), ChatUtils.stripColors(subject.getColorTag()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+92
-84
@@ -21,103 +21,111 @@ import java.util.List;
|
||||
import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
|
||||
|
||||
public class ClanDetailsFrame extends SCFrame {
|
||||
private final Clan clan;
|
||||
private final Clan clan;
|
||||
|
||||
public ClanDetailsFrame(@Nullable SCFrame parent, @NotNull Player viewer, @NotNull Clan clan) {
|
||||
super(parent, viewer);
|
||||
this.clan = clan;
|
||||
}
|
||||
public ClanDetailsFrame(@Nullable SCFrame parent, @NotNull Player viewer, @NotNull Clan clan) {
|
||||
super(parent, viewer);
|
||||
this.clan = clan;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createComponents() {
|
||||
for (int slot = 0; slot < 9; slot++) {
|
||||
if (slot == 4)
|
||||
continue;
|
||||
add(Components.getPanelComponent(slot));
|
||||
}
|
||||
@Override
|
||||
public void createComponents() {
|
||||
for (int slot = 0; slot < 9; slot++) {
|
||||
if (slot == 4)
|
||||
continue;
|
||||
add(Components.getPanelComponent(slot));
|
||||
}
|
||||
|
||||
add(Components.getBackComponent(getParent(), 4, getViewer()));
|
||||
add(Components.getClanComponent(this, getViewer(), clan, 13, false));
|
||||
add(Components.getBackComponent(getParent(), 4, getViewer()));
|
||||
add(Components.getClanComponent(this, getViewer(), clan, 13, false));
|
||||
|
||||
addRoster();
|
||||
addHome();
|
||||
addVerify();
|
||||
addDisband();
|
||||
}
|
||||
addRoster();
|
||||
addHome();
|
||||
addBank();
|
||||
addVerify();
|
||||
addDisband();
|
||||
}
|
||||
|
||||
private void addDisband() {
|
||||
SCComponent disband = new SCComponentImpl(lang("gui.clandetails.disband.title", getViewer()),
|
||||
Collections.singletonList(lang("gui.staffclandetails.disband.lore", getViewer())),
|
||||
XMaterial.BARRIER, 34);
|
||||
disband.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod disband", false, clan.getTag()));
|
||||
disband.setConfirmationRequired(ClickType.LEFT);
|
||||
disband.setPermission(ClickType.LEFT, "simpleclans.mod.disband");
|
||||
add(disband);
|
||||
}
|
||||
private void addDisband() {
|
||||
SCComponent disband = new SCComponentImpl(lang("gui.clandetails.disband.title", getViewer()),
|
||||
Collections.singletonList(lang("gui.staffclandetails.disband.lore", getViewer())),
|
||||
XMaterial.BARRIER, 34);
|
||||
disband.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod disband", false, clan.getTag()));
|
||||
disband.setConfirmationRequired(ClickType.LEFT);
|
||||
disband.setPermission(ClickType.LEFT, "simpleclans.mod.disband");
|
||||
add(disband);
|
||||
}
|
||||
|
||||
private void addVerify() {
|
||||
boolean verified = clan.isVerified();
|
||||
private void addVerify() {
|
||||
boolean verified = clan.isVerified();
|
||||
|
||||
XMaterial material = verified ? XMaterial.REDSTONE_TORCH : XMaterial.LEVER;
|
||||
String title = verified ? lang("gui.clandetails.verified.title", getViewer())
|
||||
: lang("gui.clandetails.not.verified.title", getViewer());
|
||||
List<String> lore = verified ? null : new ArrayList<>();
|
||||
if (!verified) {
|
||||
lore.add(lang("gui.staffclandetails.not.verified.lore", getViewer()));
|
||||
}
|
||||
SCComponent verify = new SCComponentImpl(title, lore, material, 32);
|
||||
if (!verified) {
|
||||
verify.setPermission(ClickType.LEFT, "simpleclans.mod.verify");
|
||||
verify.setConfirmationRequired(ClickType.LEFT);
|
||||
verify.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod verify", false, clan.getTag()));
|
||||
}
|
||||
add(verify);
|
||||
}
|
||||
XMaterial material = verified ? XMaterial.REDSTONE_TORCH : XMaterial.LEVER;
|
||||
String title = verified ? lang("gui.clandetails.verified.title", getViewer())
|
||||
: lang("gui.clandetails.not.verified.title", getViewer());
|
||||
List<String> lore = verified ? null : new ArrayList<>();
|
||||
if (!verified) {
|
||||
lore.add(lang("gui.staffclandetails.not.verified.lore", getViewer()));
|
||||
}
|
||||
SCComponent verify = new SCComponentImpl(title, lore, material, 32);
|
||||
if (!verified) {
|
||||
verify.setPermission(ClickType.LEFT, "simpleclans.mod.verify");
|
||||
verify.setConfirmationRequired(ClickType.LEFT);
|
||||
verify.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod verify", false, clan.getTag()));
|
||||
}
|
||||
add(verify);
|
||||
}
|
||||
|
||||
private void addHome() {
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add(lang("gui.staffclandetails.home.lore.teleport", getViewer()));
|
||||
lore.add(lang("gui.staffclandetails.home.lore.set", getViewer()));
|
||||
private void addHome() {
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add(lang("gui.staffclandetails.home.lore.teleport", getViewer()));
|
||||
lore.add(lang("gui.staffclandetails.home.lore.set", getViewer()));
|
||||
|
||||
SCComponent home = new SCComponentImpl(lang("gui.clandetails.home.title", getViewer()), lore,
|
||||
XMaterial.MAGENTA_BED, 30);
|
||||
home.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod home tp", false, clan.getTag()));
|
||||
home.setPermission(ClickType.LEFT, "simpleclans.mod.hometp");
|
||||
home.setListener(ClickType.RIGHT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod home set", false, clan.getTag()));
|
||||
home.setPermission(ClickType.RIGHT, "simpleclans.mod.home");
|
||||
home.setConfirmationRequired(ClickType.RIGHT);
|
||||
add(home);
|
||||
}
|
||||
SCComponent home = new SCComponentImpl(lang("gui.clandetails.home.title", getViewer()), lore,
|
||||
XMaterial.MAGENTA_BED, 30);
|
||||
home.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod home tp", false, clan.getTag()));
|
||||
home.setPermission(ClickType.LEFT, "simpleclans.mod.hometp");
|
||||
home.setListener(ClickType.RIGHT, () -> InventoryController.runSubcommand(getViewer(),
|
||||
"mod home set", false, clan.getTag()));
|
||||
home.setPermission(ClickType.RIGHT, "simpleclans.mod.home");
|
||||
home.setConfirmationRequired(ClickType.RIGHT);
|
||||
add(home);
|
||||
}
|
||||
|
||||
private void addRoster() {
|
||||
SCComponent roster = new SCComponentImpl(lang("gui.clandetails.roster.title", getViewer()),
|
||||
Collections.singletonList(lang("gui.staffclandetails.roster.lore", getViewer())),
|
||||
XMaterial.PLAYER_HEAD, 28);
|
||||
private void addRoster() {
|
||||
SCComponent roster = new SCComponentImpl(lang("gui.clandetails.roster.title", getViewer()),
|
||||
Collections.singletonList(lang("gui.staffclandetails.roster.lore", getViewer())),
|
||||
XMaterial.PLAYER_HEAD, 28);
|
||||
|
||||
List<ClanPlayer> members = clan.getMembers();
|
||||
if (members.size() != 0) {
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(
|
||||
members.get((int) (Math.random() * members.size())).getUniqueId());
|
||||
Components.setOwningPlayer(roster.getItem(), offlinePlayer);
|
||||
}
|
||||
List<ClanPlayer> members = clan.getMembers();
|
||||
if (members.size() != 0) {
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(
|
||||
members.get((int) (Math.random() * members.size())).getUniqueId());
|
||||
Components.setOwningPlayer(roster.getItem(), offlinePlayer);
|
||||
}
|
||||
|
||||
roster.setListener(ClickType.LEFT, () -> InventoryDrawer.open(new RosterFrame(getViewer(), this, clan, true)));
|
||||
add(roster);
|
||||
}
|
||||
roster.setListener(ClickType.LEFT, () -> InventoryDrawer.open(new RosterFrame(getViewer(), this, clan, true)));
|
||||
add(roster);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getTitle() {
|
||||
return lang("gui.clandetails.title", getViewer(), ChatUtils.stripColors(clan.getColorTag()),
|
||||
clan.getName());
|
||||
}
|
||||
private void addBank() {
|
||||
List<String> lore = Collections.singletonList(lang("gui.clandetails.bank.balance.lore", getViewer(), clan.getBalance()));
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return 5 * 9;
|
||||
}
|
||||
SCComponent bank = new SCComponentImpl(lang("gui.clandetails.bank.title", getViewer()), lore, XMaterial.GOLD_INGOT, 40);
|
||||
add(bank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getTitle() {
|
||||
return lang("gui.clandetails.title", getViewer(), ChatUtils.stripColors(clan.getColorTag()),
|
||||
clan.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return 5 * 9;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class ClanListFrame extends SCFrame {
|
||||
if (type == Type.UNVERIFIED) {
|
||||
clans = clans.stream().filter(c -> !c.isVerified()).collect(Collectors.toList());
|
||||
}
|
||||
paginator = new Paginator(getSize() - 9, clans.size());
|
||||
paginator = new Paginator(getSize() - 9, clans);
|
||||
plugin.getClanManager().sortClansByName(clans, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,9 +61,9 @@ public class ChatUtils {
|
||||
}
|
||||
|
||||
private static String oldStripColors(String text) {
|
||||
return text.replaceAll("[&][0-9A-Za-z]", "")
|
||||
return text.replaceAll("[&][0-9A-Fa-fk-orx]", "")
|
||||
.replaceAll(String.valueOf((char) 194), "") //don't know why
|
||||
.replaceAll("[\u00a7][0-9A-Za-z]", "");
|
||||
.replaceAll("[\u00a7][0-9A-Fa-fk-orx]", "");
|
||||
}
|
||||
|
||||
public static BaseComponent[] toBaseComponents(@Nullable CommandSender receiver, @NotNull String text) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.text.ParseException;
|
||||
* @author RoinujNosde
|
||||
*/
|
||||
public class KDRFormat {
|
||||
private static final DecimalFormat FORMATTER = new DecimalFormat("#.#");
|
||||
private static final DecimalFormat FORMATTER = new DecimalFormat("#.##");
|
||||
|
||||
static {
|
||||
FORMATTER.setParseBigDecimal(true);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.utils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RoinujNosde
|
||||
@@ -9,8 +13,9 @@ public class Paginator {
|
||||
|
||||
private int currentPage;
|
||||
private final int sizePerPage;
|
||||
private final int totalElements;
|
||||
|
||||
private int totalElements;
|
||||
private Collection<?> collection;
|
||||
|
||||
public Paginator(int sizePerPage, int totalElements) {
|
||||
if (sizePerPage < 1) {
|
||||
throw new IllegalArgumentException("sizePerPage cannot be less than 1");
|
||||
@@ -21,6 +26,14 @@ public class Paginator {
|
||||
this.sizePerPage = sizePerPage;
|
||||
this.totalElements = totalElements;
|
||||
}
|
||||
|
||||
public Paginator(int sizePerPage, @NotNull Collection<?> collection) {
|
||||
if (sizePerPage < 1) {
|
||||
throw new IllegalArgumentException("sizePerPage cannot be less than 1");
|
||||
}
|
||||
this.sizePerPage = sizePerPage;
|
||||
this.collection = collection;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,6 +42,9 @@ public class Paginator {
|
||||
* @author RoinujNosde
|
||||
*/
|
||||
public int getTotalElements() {
|
||||
if (collection != null) {
|
||||
return collection.size();
|
||||
}
|
||||
return totalElements;
|
||||
}
|
||||
|
||||
@@ -88,8 +104,9 @@ public class Paginator {
|
||||
/**
|
||||
* @return if there is a next page
|
||||
*/
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean hasNextPage() {
|
||||
return !((sizePerPage * (currentPage + 1)) > totalElements);
|
||||
return !((sizePerPage * (currentPage + 1)) > getTotalElements());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,6 +52,37 @@ settings:
|
||||
ranking-type: "DENSE"
|
||||
list-default-order-by: kdr
|
||||
lore-length: 36
|
||||
war-and-protection:
|
||||
war-enabled: false
|
||||
land-sharing: true
|
||||
protection-providers:
|
||||
- WorldGuardProvider
|
||||
- WorldGuard6Provider
|
||||
- PlotSquared5Provider
|
||||
- PlotSquared3Provider
|
||||
- GriefPreventionProvider
|
||||
listeners:
|
||||
priority: HIGHEST
|
||||
ignored-list:
|
||||
PLACE:
|
||||
- "PLAYER_HEAD"
|
||||
set-base-only-in-land: false
|
||||
war-normal-expiration-time: 0
|
||||
war-disconnect-expiration-time: 0
|
||||
edit-all-lands: false
|
||||
land-creation:
|
||||
only-leaders: false
|
||||
only-one-per-clan: false
|
||||
war-actions:
|
||||
CONTAINER: true
|
||||
INTERACT: true
|
||||
BREAK: true
|
||||
PLACE: true
|
||||
DAMAGE: true
|
||||
INTERACT_ENTITY: true
|
||||
war-start:
|
||||
request-enabled: true
|
||||
members-online-max-difference: 5
|
||||
kdr-grinding-prevention:
|
||||
enable-max-kills: false
|
||||
max-kills-per-victim: 10
|
||||
@@ -98,6 +129,7 @@ kill-weights:
|
||||
rival: 2.0
|
||||
civilian: 0.0
|
||||
neutral: 1.0
|
||||
ally: -1.0
|
||||
deny-same-ip-kills: false
|
||||
clan:
|
||||
homebase-teleport-wait-secs: 10
|
||||
|
||||
@@ -44,6 +44,8 @@ withdraw.command=withdraw
|
||||
invite.command=invite
|
||||
kick.command=kick
|
||||
bank.command=bank
|
||||
give.command=give
|
||||
take.command=take
|
||||
status.command=status
|
||||
fee.command=fee
|
||||
set.command=set
|
||||
@@ -93,6 +95,20 @@ acf-core.parameter.clan=clan
|
||||
acf-core.parameter.type=type
|
||||
acf-core.parameter.order=order
|
||||
acf-core.parameter.help=page or keywords
|
||||
command.description.land.allow.all=Allows all actions in your land
|
||||
command.description.land.allow.interact_entity=Allows clan members to interact with entities in your land
|
||||
command.description.land.allow.interact=Allows clan members to interact with your land
|
||||
command.description.land.allow.container=Allows clan members to open containers in your land
|
||||
command.description.land.allow.place=Allows clan members to place blocks in your land
|
||||
command.description.land.allow.break=Allows clan members to break blocks in your land
|
||||
command.description.land.allow.damage=Allows clan members to cause damage in your land
|
||||
command.description.land.block.all=Blocks all actions in your land
|
||||
command.description.land.block.interact_entity=Blocks clan members from interacting with entities in your land
|
||||
command.description.land.block.interact=Blocks clan members to interacting with your land
|
||||
command.description.land.block.container=Blocks clan members from opening containers in your land
|
||||
command.description.land.block.place=Blocks clan members from placing blocks in your land
|
||||
command.description.land.block.break=Blocks clan members from breaking blocks in your land
|
||||
command.description.land.block.damage=Blocks clan members from causing damage in your land
|
||||
command.description.stats=Shows your clan''s members stats
|
||||
command.description.rivalries=Shows all clan rivalries
|
||||
command.description.mostkilled=Shows server-wide most killed counts
|
||||
@@ -146,19 +162,23 @@ command.description.clan=Opens the GUI
|
||||
command.description.disband=Disbands your clan
|
||||
command.description.mod.disband=Disbands a clan
|
||||
command.description.mod.kick=Kicks a player from a clan
|
||||
command.description.modtag=Modifies your clan's tag
|
||||
command.description.purge=Purges some player's data
|
||||
command.description.setbanner=Sets your clan's banner
|
||||
command.description.modtag=Modifies your clan''s tag
|
||||
command.description.purge=Purges some player''s data
|
||||
command.description.setbanner=Sets your clan''s banner
|
||||
command.description.verify=Verifies your clan
|
||||
command.description.mod.verify=Verifies a clan
|
||||
command.description.invite=Invites a player to your clan
|
||||
command.description.fee.check=Checks the value of your clan's fee and if it's enabled
|
||||
command.description.fee.set=Sets your clan's fee
|
||||
command.description.bank.status=Checks your clan's bank balance
|
||||
command.description.fee.check=Checks the value of your clan''s fee and if it''s enabled
|
||||
command.description.fee.set=Sets your clan''s fee
|
||||
command.description.bank.status=Checks your clan''s bank balance
|
||||
command.description.bank.admin.status=Checks a clan''s bank balance
|
||||
command.description.bank.withdraw.all=Withdraws all from your clan's bank
|
||||
command.description.bank.withdraw.amount=Withdraws an amount from your clan's bank
|
||||
command.description.bank.withdraw.amount=Withdraws an amount from your clan''s bank
|
||||
command.description.bank.admin.take=Takes an amount of money from a clan''s bank
|
||||
command.description.bank.deposit.all=Deposits all of your money into your clan's bank
|
||||
command.description.bank.deposit.amount=Deposits an amount of your money into your clan's bank
|
||||
command.description.bank.deposit.amount=Deposits an amount of your money into your clan''s bank
|
||||
command.description.bank.admin.give=Gives an amount of money to a clan''s bank
|
||||
command.description.bank.admin.set=Sets an amount of money to a clan''s bank
|
||||
command.description.war.start=Starts a war
|
||||
command.description.war.end=Ends a war
|
||||
command.description.resetkdr.everyone=Resets everyone''s KDR
|
||||
@@ -168,6 +188,7 @@ command.description.admin.demote=Demotes any leader from any clan
|
||||
command.description.demote=Demotes a leader
|
||||
command.description.admin.promote=Promotes any member from any clan
|
||||
command.description.promote=Promotes a member to leader
|
||||
command.description.admin.permanent=Toggles the permanent status of any clan
|
||||
command.description.toggle.bb=Toggles whether the bulletin board should be displayed when you login
|
||||
command.description.toggle.tag=Toggles whether your clan''s tag should be displayed next to your name
|
||||
command.description.toggle.deposit=Toggles whether deposits are allowed on your clan
|
||||
@@ -204,6 +225,7 @@ clans.lower=clans
|
||||
rival=Rival
|
||||
civilian=Civilian
|
||||
neutral=Neutral
|
||||
ally=Ally
|
||||
free.agent=Free Agent
|
||||
days=days
|
||||
rivals=Rivals
|
||||
@@ -226,6 +248,7 @@ food=Food
|
||||
vitals=vitals
|
||||
verified=Verified
|
||||
unverified=Unverified
|
||||
permanent=Permanent
|
||||
profile=profile
|
||||
civilian.abbreviation=Civ
|
||||
rank=Rank
|
||||
@@ -372,7 +395,7 @@ the.player.does.not.have.the.permissions.to.lead.a.clan=The player does not have
|
||||
you.cannot.promote.yourself=You cannot promote yourself
|
||||
the.player.is.already.a.leader=The player is already a leader
|
||||
configuration.reloaded=Configuration reloaded
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=Last leader cannot resign.You must appoint another leader or disband the clan
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=Last leader cannot resign. You must appoint another leader or disband the clan
|
||||
0.has.resigned={0} has resigned
|
||||
you.cannot.trust.yourself=You cannot trust yourself
|
||||
leaders.are.already.trusted=Leaders are already trusted
|
||||
@@ -459,18 +482,29 @@ your.clans.are.already.rivals=Your clans are already rivals
|
||||
player.got.money=You got {0} for killing {1} based on you KDR: {2}
|
||||
cleared.bb=Cleared the bulletin board
|
||||
clan.balance=Clan-Balance: {0}
|
||||
clan.admin.balance={0}''s balance: {1} $
|
||||
bb.fee.player.kicked={0} was kicked for not paying the fee
|
||||
bb.fee.set={0} $ is the fee
|
||||
bb.clan.deposit={0} $ were deposited
|
||||
player.clan.deposit=You deposited {0}
|
||||
bb.clan.withdraw={0} $ were withdrawn
|
||||
bb.clan.take={0} $ were taken
|
||||
bb.clan.give={0} $ were given
|
||||
bb.clan.set={0} $ were set
|
||||
player.clan.withdraw=You withdraw {0}
|
||||
clan.admin.take=You took {0} $ from {1}''s bank
|
||||
clan.admin.give=You gave {0} $ to {1}''s bank
|
||||
clan.admin.set=You set {0}''s bank balance to {1}
|
||||
clan.admin.bank.not.enough.money={0}''s bank has not enough money!
|
||||
clan.bank.not.enough.money=Your clans bank has not enough money
|
||||
your.clans.are.not.rivals=Your clans are not rivals
|
||||
the.clan.members.reached.limit=Your clan members reached limit
|
||||
you.have.reseted.your.kdr=You have reseted your KDR
|
||||
you.have.reseted.0.kdr=You have reseted {0}''s KDR
|
||||
you.have.reseted.kdr.of.all.players=You have reseted the KDR of all players
|
||||
you.have.toggled.permanent.status=You have toggled permanent status for {0}
|
||||
permanent.status.enabled=Your clan''s permanent status has been enabled by {0}
|
||||
permanent.status.disabled=Your clan''s permanent status has been disabled by {0}
|
||||
resign.yes=Yes
|
||||
resign.no=No
|
||||
resign.confirmation=Are you sure you want to resign? {0}
|
||||
@@ -479,12 +513,12 @@ you.cannot.demote.the.last.leader=You cannot demote the last leader
|
||||
you.cannot.move.the.last.leader=You cannot move the last leader
|
||||
player.successfully.demoted=The player was successfully demoted
|
||||
player.successfully.promoted=The player was successfully promoted
|
||||
bb.ago= ago
|
||||
bb.moments=moments
|
||||
bb.seconds= seconds
|
||||
bb.minutes= minutes
|
||||
bb.ago= \ ago
|
||||
bb.moments=\ moments
|
||||
bb.seconds= \ seconds
|
||||
bb.minutes= \ minutes
|
||||
bb.one.minute=1 minute
|
||||
bb.hours= hours
|
||||
bb.hours= \ hours
|
||||
bb.one.hour=1 hour
|
||||
bb.days= days
|
||||
bb.one.day=1 day
|
||||
@@ -755,37 +789,11 @@ you.must.hold.a.banner=&cYou must have a banner in your hand!
|
||||
you.changed.clan.banner=&bYou changed your clan''s banner!
|
||||
your.clan.already.verified=&cYour clan is already verified!
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
clan.profile=\
|
||||
\n&b%clan_name%&7 profile &8-------------------------------------------\n \n \
|
||||
&7Name: &e[&8%clan_color_tag%&e] &b%clan_name%\n \
|
||||
&7Description: &f%clan_description%\n \
|
||||
&7Status: &f%clan_verified%\n \
|
||||
&7Leaders: %clan_leaders%\n \
|
||||
&7Members Online: &f%clan_online_count%&7/&f%clan_size%\n \
|
||||
&7KDR: &e%clan_kdr%\n \
|
||||
&7Kill Totals: &8[Rival:&f%clan_rival_kills% &8Neutral:&f%clan_neutral_kills% &8Civilian:&f%clan_civilian_kills%&8]\n \
|
||||
&7Deaths: &f%clan_deaths%\n \
|
||||
&7Fee: &f%clan_fee_enabled%&7, &f%clan_fee_value% $\n \
|
||||
&7Allies: &f%clan_allies%\n \
|
||||
&7Rivals: &f%clan_rivals%\n \
|
||||
&7Founded: &f%clan_founded%\n \
|
||||
&7Inactive: &f%clan_inactive_days%&7/&f%clan_max_inactive_days% days\n
|
||||
clan.profile=\n&b%clan_name%&7 profile &8-------------------------------------------\n \n &7Name: &e[&8%clan_color_tag%&e] &b%clan_name%\n &7Description: &f%clan_description%\n &7Status: &f%clan_status%\n &7Leaders: %clan_leaders%\n &7Members Online: &f%clan_online_count%&7/&f%clan_size%\n &7KDR: &e%clan_kdr%\n &7Kill Totals: &8[Rival:&f%clan_rival_kills% &8Neutral:&f%clan_neutral_kills% &8Civilian:&f%clan_civilian_kills%&8]\n &7Deaths: &f%clan_deaths%\n &7Fee: &f%clan_fee_enabled%&7, &f%clan_fee_value% $\n &7Allies: &f%clan_allies%\n &7Rivals: &f%clan_rivals%\n &7Founded: &f%clan_founded%\n &7Inactive: &f%clan_inactive_days%&7/&f%clan_max_inactive_days% days\n
|
||||
player.lookup.clanname=&e[&8%clan_color_tag%&e] &b%clan_name%
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
player.lookup.killtype=&7Kill Type: %player_kill_type%\n
|
||||
player.lookup=\
|
||||
\n&b%player_name%&7''s player info &8-------------------------------------------\n \n \
|
||||
&7Clan: &f%clan_name%\n \
|
||||
&7Rank: &f%player_rank%\n \
|
||||
&7Status: &f%player_status%\n \
|
||||
&7KDR: &e%player_kdr%\n \
|
||||
&7Kill Totals: &8[Rival:&f%player_rival_kills% &8Neutral:&f%player_neutral_kills% &8Civilian:&f%player_civilian_kills%&8]\n \
|
||||
&7Deaths: &f%player_deaths%\n \
|
||||
&7Join Date: &f%player_join_date%\n \
|
||||
&7Last Seen: &f%player_last_seen%\n \
|
||||
&7Past Clans: &f%player_past_clans%\n \
|
||||
&7Inactive: &f%player_inactive_days%&7/&f%player_max_inactive_days% days\n \
|
||||
%kill_type_line%
|
||||
player.lookup=\n&b%player_name%&7''s player info &8-------------------------------------------\n \n &7Clan: &f%clan_name%\n &7Rank: &f%player_rank%\n &7Status: &f%player_status%\n &7KDR: &e%player_kdr%\n &7Kill Totals: &8[Rival:&f%player_rival_kills% &8Neutral:&f%player_neutral_kills% &8Civilian:&f%player_civilian_kills%&8]\n &7Deaths: &f%player_deaths%\n &7Join Date: &f%player_join_date%\n &7Last Seen: &f%player_last_seen%\n &7Past Clans: &f%player_past_clans%\n &7Inactive: &f%player_inactive_days%&7/&f%player_max_inactive_days% days\n %kill_type_line%
|
||||
economy.disabled=&cEconomy disabled!
|
||||
has.been.purged={0}''s data has been purged
|
||||
accepted.invitation=&bYou have accepted {0}''s invitation
|
||||
@@ -799,4 +807,25 @@ cannot.attack.ally=&cYou cannot attack an ally!
|
||||
cannot.change.member.fee.now=&cYou cannot change the member fee close to its collection time.
|
||||
cannot.change.member.fee.hours=&cTry again in {0} hours...
|
||||
cannot.change.member.fee.minutes=&cTry again in {0} minute(s)...
|
||||
cannot.kick.last.leader=&cYou cannot kick the last leader!
|
||||
cannot.kick.last.leader=&cYou cannot kick the last leader!
|
||||
cannot.disband.permanent=&cYou cannot disband this clan. It has permanent status.
|
||||
you.can.only.set.base.in.your.land=&cYou can only set home in your land!
|
||||
only.leaders.can.create.lands=&cOnly leaders can create lands!
|
||||
only.one.land.per.clan=&cYour clan already has a land!
|
||||
only.clan.members.can.create.lands=&cOnly clan members can create lands!
|
||||
land.allowed.all.actions=&bAll actions are now allowed!
|
||||
land.blocked.all.actions=&bAll actions are now blocked!
|
||||
land.allowed.action=&bAllowed action!
|
||||
land.blocked.action=&bBlocked action!
|
||||
you.do.not.own.lands=&cYou do not own a land!
|
||||
land.sharing.disabled=&cLand sharing is disabled!
|
||||
war.expired=The war with {0} has expired!
|
||||
you.cant.start.war.online.members.difference=You can''t start the war. One clan has more members online than the other.
|
||||
|
||||
land.command=land
|
||||
break.command=break
|
||||
interact.command=interact
|
||||
place_block.command=place_block
|
||||
damage.command=damage
|
||||
interact_entity.command=interact_entity
|
||||
container.command=container
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -14,9 +14,32 @@ list.type.founded=nalezen
|
||||
list.type.active=aktivní
|
||||
profile.command=profil
|
||||
roster.command=roster
|
||||
leaderboard.command=žebříček
|
||||
ally.command=spojenec
|
||||
add.command=přidat
|
||||
remove.command=odstranit
|
||||
allow.command=povolit
|
||||
assign.command=přiřadit
|
||||
rival.command=soupeř
|
||||
war.command=válka
|
||||
acf-core.parameter.member=člen
|
||||
acf-core.parameter.rank=hodnost
|
||||
acf-core.parameter.leader=vůdce
|
||||
acf-core.parameter.name=jmeno
|
||||
acf-core.parameter.description=popis
|
||||
command.description.create=Vytvoří klan
|
||||
leader=vůdce
|
||||
roster=roster
|
||||
profile=profil
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
add=přidat
|
||||
remove=odstranit
|
||||
allow=povolit
|
||||
war=válka
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
description.command=beschreibung
|
||||
description.command=Deschreibung
|
||||
create.command=erstellen
|
||||
delete.command=löschen
|
||||
rank.command=rang
|
||||
permissions.command=berechtigung
|
||||
list.command=liste
|
||||
list.type.name=name
|
||||
rank.command=Rang
|
||||
setdisplayname.command=setdisplayname
|
||||
setdefault.command=setdefault
|
||||
removedefault.command=removedefault
|
||||
permissions.command=Berechtigungen
|
||||
list.command=Liste
|
||||
list.order.asc=aufsteigend
|
||||
list.order.desc=absteigend
|
||||
list.type.name=Name
|
||||
list.type.kdr=kdr
|
||||
list.type.size=groesse
|
||||
list.type.founded=gegründet
|
||||
list.type.active=aktiv
|
||||
profile.command=profil
|
||||
roster.command=mitglieder
|
||||
@@ -21,7 +28,7 @@ add.command=anlegen
|
||||
remove.command=entfernen
|
||||
allow.command=zulassen
|
||||
block.command=blockieren
|
||||
auto.command=auto
|
||||
auto.command=automatisch
|
||||
check.command=prüfen
|
||||
assign.command=zuweisen
|
||||
unassign.command=aufheben
|
||||
@@ -44,6 +51,7 @@ purge.command=bereinigen
|
||||
trust.command=vertrauen
|
||||
untrust.command=vertrauen entziehen
|
||||
admin.command=admin
|
||||
mod.command=mod
|
||||
promote.command=befördern
|
||||
demote.command=herunterstufen
|
||||
clanff.command=clanff
|
||||
@@ -56,17 +64,19 @@ unban.command=unban
|
||||
reload.command=reload
|
||||
globalff.command=globalff
|
||||
kills.command=kills
|
||||
mostkilled.command=mostkilled
|
||||
mostkilled.command=am meisten getötet
|
||||
war.command=krieg
|
||||
start.command=start
|
||||
end.command=ende
|
||||
home.command=home
|
||||
home.command=Basis
|
||||
regroup.command=regroup
|
||||
me.command=ich
|
||||
tp.command=tp
|
||||
setrank.command=setrank
|
||||
place.command=platzieren
|
||||
resetkdr.command=zurücksetzen kdr
|
||||
everyone.command=jeder
|
||||
setbanner.command=setbanner
|
||||
help.command=hilfe
|
||||
acf-core.parameter.member=mitglieder
|
||||
acf-core.parameter.rank=rang
|
||||
@@ -74,6 +84,8 @@ acf-core.parameter.leader=anfuehrer
|
||||
acf-core.parameter.displayname=anzeigename
|
||||
acf-core.parameter.permission=berechtigung
|
||||
acf-core.parameter.message=nachricht
|
||||
acf-core.parameter.tag=markieren
|
||||
acf-core.parameter.name=Name
|
||||
acf-core.parameter.fee=gebühr
|
||||
acf-core.parameter.description=beschreibung
|
||||
acf-core.parameter.player=spieler
|
||||
@@ -81,9 +93,114 @@ acf-core.parameter.clan=clan
|
||||
acf-core.parameter.type=typ
|
||||
acf-core.parameter.order=bestellung
|
||||
acf-core.parameter.help=seite oder schlüsselwörter
|
||||
command.description.land.allow.all=Erlaubt alle Aktionen in deinem Land
|
||||
command.description.land.allow.interact_entity=Ermöglicht Gildenmitgliedern die Interaktion mit Entitäten in deinem Land
|
||||
command.description.land.allow.interact=Ermöglicht Clan-Mitgliedern mit deinem Land zu interagieren
|
||||
command.description.land.allow.container=Erlaubt es Clan-Mitgliedern, Container in deinem Land zu öffnen
|
||||
command.description.land.allow.place=Ermöglicht Clan Mitgliedern Blöcke in deinem Land zu platzieren
|
||||
command.description.land.allow.break=Ermöglicht Clan Mitgliedern Blöcke in deinem Land zu zerstören
|
||||
command.description.land.allow.damage=Ermöglicht Clan-Mitgliedern, Schaden in Ihrem Land zu verursachen
|
||||
command.description.land.block.all=Blockiert alle Aktionen in deinem Land
|
||||
command.description.land.block.interact_entity=Blockiert Clan-Mitgliedern die Interaktion mit Entitäten in deinem Land
|
||||
command.description.land.block.interact=Blockiert Clan-Mitgliedern mit deinem Land zu interagieren
|
||||
command.description.land.block.container=Blockiert es Clan-Mitgliedern, Container in deinem Land zu öffnen
|
||||
command.description.land.block.place=Blockiert Clan Mitgliedern Blöcke in deinem Land zu platzieren
|
||||
command.description.land.block.break=Blockiert Clan Mitgliedern Blöcke in deinem Land zu zerstören
|
||||
command.description.land.block.damage=Ermöglicht Clan-Mitgliedern, Schaden in Ihrem Land zu verursachen
|
||||
command.description.stats=Zeigt die Mitgliederstatistik deines Clans an
|
||||
command.description.rivalries=Zeigt alle Clan-Rivalitäten
|
||||
command.description.mostkilled=Am meisten getötete Spieler (Server-weit)
|
||||
command.description.kills=Anzahl deiner Kills oder eines anderen Spielers
|
||||
command.description.lookup=Zeigt deine Informationen an
|
||||
command.description.lookup.other=Zeigt die Informationen eines anderen Spielers an
|
||||
command.description.leaderboard=Zeigt die Bestenliste
|
||||
command.description.roster.other=Listet Mitglieder eines anderen Clans auf
|
||||
command.description.roster=Listet Mitglieder deines Clans auf
|
||||
command.description.profile.other=Zeigt das Profil eines anderen Clans
|
||||
command.description.profile=Zeigt das Profil deines Clans
|
||||
command.description.vitals=Zeigt die Vitalwerte deines Clans und deiner Verbündeten an
|
||||
command.description.list=Listet alle Clans
|
||||
command.description.chat=Schreibe im Clan Chat
|
||||
command.description.ally=Schreibe im Allianz Chat
|
||||
command.description.deny=Lehnt eine Anfrage ab
|
||||
command.description.accept=Anfrage akzeptieren
|
||||
command.description.more=Mehr Informationen anzeigen
|
||||
command.description.create=Erstellt einen Clan
|
||||
command.description.ff.allow=Setzt dein persönliches Freundliches Feuer auf erlaubt
|
||||
command.description.ff.auto=Setzt dein persönliches Freundliches Feuer auf automatisch
|
||||
command.description.globalff.allow=Setzt das globale Freundliche Feuer auf erlaubt
|
||||
command.description.globalff.auto=Setzt das globale Freundliche Feuer auf auto
|
||||
command.description.clanff.allow=Setzt das Freundliche Feuer des Clans auf erlaubt
|
||||
command.description.clanff.block=Setzt das Freundliche Feuer des Clans auf auto
|
||||
command.description.description=Clanbeschreibung festlegen
|
||||
command.description.ban=Bannt einen Spieler von Clan-Befehlen
|
||||
command.description.unban=Entbannt einen Spieler von Clan-Befehlen
|
||||
command.description.regroup.me=Gruppiert deine Gildenmitglieder an deinen Standort
|
||||
command.description.regroup.home=Gruppiert deine Gildenmitglieder bei deiner Basis
|
||||
command.description.home.tp=Teleportiert dich zu deiner Clan Basis
|
||||
command.description.home.clear=Löscht die Basis deines Clans
|
||||
command.description.home.set=Legt die Basis deines Clans fest
|
||||
command.description.mod.home.set=Setzt die Basis eines Clans
|
||||
command.description.mod.home.tp=Teleportiert dich zu einer Clan Basis
|
||||
command.description.rival.remove=Entfernt einen Rivalen
|
||||
command.description.rival.add=Fügt Rivalen hinzu
|
||||
command.description.ally.remove=Entfernt einen Verbündeten
|
||||
command.description.kick=Wirf ein Mitglied aus deinem Clan
|
||||
command.description.bb.display=Zeige das schwarze Brett deines Clans
|
||||
command.description.bb.clear=Lösche das schwarze Brett deines Clans
|
||||
command.description.bb.post=Schreibe eine Nachricht auf das schwarze Brett deines Clans
|
||||
command.description.place=Fügt einen Spieler dem Clan hinzu
|
||||
command.description.reload=Lädt das Plugin und die Konfiguration neu
|
||||
command.description.trust=Vertraue einem Clan-Mitglied
|
||||
command.description.untrust=Vertrauen eines Clan-Mitglied zurückziehen
|
||||
command.description.resign=Verlasse deinen Clan
|
||||
command.description.help=Zeige die Hilfe an oder suche in ihr
|
||||
command.description.ally.add=Eine Allianz hinzufügen
|
||||
command.description.clan=Öffnet die GUI
|
||||
command.description.disband=Löse deinen Clan auf
|
||||
command.description.mod.disband=Löst einen Clan auf
|
||||
command.description.mod.kick=Verbanne ein Mitglied aus deinem Clan
|
||||
command.description.modtag=Ändere deinen Clan-Tag
|
||||
command.description.purge=Löscht die Daten von Spieler
|
||||
command.description.setbanner=Setze den Banner deines Clans
|
||||
command.description.verify=Lasse deinen Clan verifizieren
|
||||
command.description.mod.verify=Verifiziere einen Clan
|
||||
command.description.invite=Lade einen Spieler zu deinem Clan ein
|
||||
command.description.fee.check=Überprüft ob eine Clangebühr aktiviert ist und wie hoch diese eingestellt ist
|
||||
command.description.fee.set=Bestimme die Clangebühr
|
||||
command.description.bank.status=Überprüfe den Kontostand von deinem Clan
|
||||
command.description.bank.withdraw.all=Hebe den kompletten Kontostand von deinem Clankonto ab
|
||||
command.description.bank.withdraw.amount=Hebe einen bestimmten Betrag von deinem Clankonto ab
|
||||
command.description.bank.deposit.all=Überweise dein komplettes Geld auf das Konto deines Clans
|
||||
command.description.bank.deposit.amount=Überweise einen bestimmten Betrag auf das Konto deines Clans
|
||||
command.description.war.start=Startet einen Krieg mit einem anderen Clan
|
||||
command.description.war.end=Beende einen Clankrieg
|
||||
command.description.resetkdr.everyone=Alle KDR zurücksetzen
|
||||
command.description.resetkdr.player=KDR eines Spielers zurücksetzen
|
||||
command.description.resetkdr=KDR zurücksetzen
|
||||
command.description.admin.demote=Degradiert jeden Anführer von jedem Clan
|
||||
command.description.demote=Degradiere einen Calnführer
|
||||
command.description.admin.promote=Befördere jedes Mitglied von jedem Clan
|
||||
command.description.promote=Befördere ein Mitglied zum Anführer
|
||||
command.description.toggle.bb=Schaltet an, ob das Bulletinboard angezeigt werden soll, wenn du dich anmeldest
|
||||
command.description.toggle.tag=Schaltet an, ob der Tag deines Clans neben deinem Namen angezeigt werden soll
|
||||
command.description.toggle.deposit=Schalte um, ob Einzahlungen auf deinen Clan erlaubt sind
|
||||
command.description.toggle.withdraw=Schaltet um, ob Auszahlungen für deinen Clan erlaubt sind
|
||||
command.description.toggle.fee=Schaltet um, ob die Clan-Gebühr aktiviert ist
|
||||
command.description.alliances=Listet alle Gildenallianzen auf
|
||||
command.description.coords=Zeigt die Koordinaten der Mitglieder deines Clans an
|
||||
command.description.rank.assign=Einem Mitglied einen Rang zuweisen
|
||||
command.description.rank.unassign=Ein Mitglied aus einem Rang entfernen
|
||||
command.description.rank.create=Erstellt einen Rang
|
||||
command.description.rank.delete=Löscht einen Rang
|
||||
command.description.rank.list=Listet die Ränge deines Clans auf
|
||||
command.description.rank.setdisplayname=Legt den Anzeigenamen eines Rangs fest
|
||||
command.description.rank.setdefault=Legt den Standardrang fest
|
||||
command.description.rank.removedefault=Entfernt den Standardrang
|
||||
command.description.rank.permissions.available=Listet die verfügbaren Rangberechtigungen
|
||||
command.description.rank.permissions.rank=Listet die Berechtigungen eines Rangs auf
|
||||
command.description.rank.permissions.add=Fügt eine Berechtigung zu einem Rang hinzu
|
||||
command.description.rank.permissions.remove=Entfernt eine Berechtigung aus einem Rang
|
||||
home-menu=/{0} Home{1} - Teleportiert dich in die Clan Basis
|
||||
home-set-menu=/{0} Home set{1} - Setzt die Clan Basis
|
||||
home-clear-menu=/{0} Home clear{1} - Entfernt die Clan Basis
|
||||
@@ -110,8 +227,9 @@ player=Spieler
|
||||
seen=Gesehen
|
||||
leader=Anführer
|
||||
roster=Dienstplan
|
||||
trusted=Vertrauenswürdiger
|
||||
untrusted=Unvertrauenswürdiger
|
||||
trusted=Vertrauenswürdig
|
||||
untrusted=Nicht Vertrauenswürdig
|
||||
in.rank=im Rang
|
||||
deaths=Tode
|
||||
weights=Gewichte
|
||||
stats=Statistiken
|
||||
@@ -119,6 +237,7 @@ health=Gesundheit
|
||||
armor=Rüstung
|
||||
weapons=Waffen
|
||||
food=Nahrung
|
||||
vitals=vitale
|
||||
verified=Verifiziert
|
||||
unverified=Nicht verifiziert
|
||||
profile=profil
|
||||
@@ -157,7 +276,13 @@ proposing.an.alliance={0} schlägt vor ein Allianz mit {1} einzugehen
|
||||
inviting.you.to.join={0} lädt dich zum Beitritt ein {1}
|
||||
asking.for.the.deletion={0} fragt nach einer Löschung des Clans
|
||||
asking.for.the.promotion={0} fragt nach einer Beförderung für {1}
|
||||
asking.for.the.demotion={0} möchte, dass {1} degradiert wird
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
request.message= \n &8[&8{0}&8] &b{1}\n %accept% &bor %deny%\n
|
||||
clickable.accept=&a&l[AKZEPTIEREN]
|
||||
clickable.deny=&c&l[ABLEHNEN]
|
||||
hover.click.to.accept=&aKlicken Sie hier, um zu akzeptieren
|
||||
hover.click.to.deny=&cKlicken Sie hier, um abzulehnen
|
||||
not.sufficient.money=Du hast nicht genügend Geld auf deinem Konto
|
||||
account.has.been.debited=Ihr Konto wurde belastet {0}
|
||||
mysql.connection.successful=Verbindung hergestellt
|
||||
@@ -170,6 +295,7 @@ clan.players=Clan Spieler\: {0}
|
||||
clans=Clans\: {0}
|
||||
banned=Dir wurde verboten Clan-Commands zu benutzen
|
||||
nothing.more.to.see=Nichts mehr zu sehen
|
||||
nothing.to.vote=&cNichts zum Akzeptieren oder Ablehnen
|
||||
no.leader.permissions=Du hast keine Anführer Berechtigungen
|
||||
you.have.already.voted=Du hast bereits abgestimmt
|
||||
has.voted.to.deny={0} hat fürs verweigern gestimmt
|
||||
@@ -183,8 +309,11 @@ clan.disbanded=Clan aufgelöst
|
||||
many.color.days={0}{1} Tage
|
||||
insufficient.permissions=Unzureichende Berechtigungen
|
||||
clan.is.not.verified=Clan ist nicht verifiziert
|
||||
player.not.a.member.of.any.clan=&cDer Spieler ist kein Mitglied eines Clans
|
||||
not.a.member.of.any.clan=Du bist kein Mitglied in einem Clan
|
||||
minimum.to.make.alliance=Dein Clan muss mindestens {0} Spieler haben um Allianzen zu bilden
|
||||
cannot.be.same.clan=&cDu musst einen anderen Clan als deinen einfügen\!
|
||||
other.clan.not.verified=&cDer andere Clan wurde nicht verifiziert\!
|
||||
your.clans.are.not.allies=Deine Clans sind keine Verbündeten
|
||||
has.broken.the.alliance={0} hat die Allianz mit {1} aufgelöst
|
||||
at.least.one.leader.accept.the.alliance=Mindestens ein Anführer des Clans muss online sein um die Allianz zu akzeptieren
|
||||
@@ -244,17 +373,62 @@ rank.0=Rang\: {0}
|
||||
kdr.0=KDR\: {0}
|
||||
inactive.0=Inaktiv\: {0}
|
||||
clan.commands=clan Befehle
|
||||
you.can.only.modify.the.color.and.case.of.the.tag=Du kannst nur die Farbe und die Gros- / Kleinschreibung dieses Tags ändern
|
||||
tag.changed.to.0=Tag geändert zu {0}
|
||||
0.tag.changed.to.1=&bErfolgreich den Tag von {0} zu {1} geändert
|
||||
name.0=Name\: {0}
|
||||
description.0=Beschreibung\: {0}
|
||||
leaders.0=Anführer\:{0}
|
||||
allies.0=Allianz\: {0}
|
||||
rivals.0=Rivalen\: {0}
|
||||
other.player.must.be.online=&cDer Spieler muss online sein\!
|
||||
the.player.does.not.have.the.permissions.to.lead.a.clan=Der Spieler hat nicht die Berechtigung einen Clan zu führen
|
||||
you.cannot.promote.yourself=Du kannst dich nicht selbst befördern\!
|
||||
the.player.is.already.a.leader=Der Spieler ist bereits Anführer
|
||||
configuration.reloaded=Konfiguration neugeladen
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=Letzter Anführer kann nicht zurücktreten. Du musst einen anderen Anführer ernennen oder den Clan auflösen
|
||||
0.has.resigned={0} ist zurückgetreten
|
||||
you.cannot.trust.yourself=Du kannst dir selbst nicht vertrauen
|
||||
leaders.are.already.trusted=Anführer sind bereits vertrauenswürdig
|
||||
this.player.is.already.trusted=Diesem Spieler wird schon vertraut
|
||||
has.been.given.trusted.status.by={1} vertraut nun dem Spieler {0}
|
||||
this.player.is.not.banned=Dieser Spieler ist nicht gebannt
|
||||
player.removed.from.the.banned.list=Spieler wurde von der Bannliste entfernt
|
||||
you.have.been.unbanned.from.clan.commands=Du wurdest von den Clan-Befehlen entbannt
|
||||
you.cannot.untrust.yourself=Du kannst dir nicht selbst Misstrauen
|
||||
leaders.cannot.be.untrusted=Anführern kann nicht Misstrauen werden
|
||||
this.player.is.already.untrusted=Diesem Spieler wird schon nicht vertraut
|
||||
has.been.given.untrusted.status.by={1} vertraut nun nicht mehr dem Spieler {0}
|
||||
the.clan.does.not.exist=Der Clan existiert nicht
|
||||
the.clan.is.already.verified=Der Clan ist bereits verifiziert
|
||||
the.clan.has.been.verified=Der Clan wurde verifiziert
|
||||
clan.0.has.been.verified=Gilde {0} wurde verifiziert\!
|
||||
total.clan.players.0=Gesamt Clan-Spieler\: {0}
|
||||
proposing.war={0} schlägt vor, mit dem Clan {1} einen Krieg zu beginnen
|
||||
you.can.only.start.war.with.rivals=Du kannst einen Krieg nur mit einem Rivalen beginnen
|
||||
leaders.have.been.asked.to.accept.the.war.request={0} Anführer wurden angefragt die Kriegsanfrage anzunehmen
|
||||
leaders.asked.to.end.rivalry={0} Anführer wurden gebeten den Clankrieg zu beenden
|
||||
proposing.to.end.the.war={0} möchte den Clankrieg mit {1} beenden
|
||||
clans.already.at.war=Deine Clans sind bereits in einem Krieg
|
||||
clans.not.at.war=Keiner deiner Clans führen aktuell einen Krieg
|
||||
you.are.at.war={0} ist ist aktuell in einem Krieg mit {1}
|
||||
denied.war.req={0} hat die Anfrage zu einem Clankrieg von {1} nicht angenommen
|
||||
you.are.no.longer.at.war={0} ist nicht mehr in einem Krieg mit {1}
|
||||
end.war.denied=Dein Antrag um den Krieg zu beenden wurde von {0} abgelehnt
|
||||
denied.war.end=Der Antrag von {0} um den Krieg zu beenden wurde von {1} abgelehnt
|
||||
has.initiated.a.rivalry={0} hat eine Rivalität mit {1} initiiert
|
||||
start=start
|
||||
end=ende
|
||||
add=anlegen
|
||||
remove=entfernen
|
||||
allow=zulassen
|
||||
block=blockieren
|
||||
auto=automatisch
|
||||
war=krieg
|
||||
0.s.sword.1.2.b.bow.3.4.a.arrow={0}S\=Schwert{1}, {2}B\=Bogen{3}, {4}P\=Pfeile
|
||||
weapon.S=S
|
||||
weapon.B=B
|
||||
weapon.A=P
|
||||
materials=Materialien
|
||||
armor.h=H
|
||||
armor.c=B
|
||||
armor.l=H
|
||||
@@ -269,6 +443,8 @@ hunger=Hunger
|
||||
stone=Stein
|
||||
iron=Eisen
|
||||
the.clan.cannot.be.rivaled=Der Clan kann nicht rivalieren
|
||||
bboff=BB ausgeschaltet
|
||||
bbon=BB angeschaltet
|
||||
tagoff=Kürzel ausgeschaltet
|
||||
tagon=Kürzel eingeschaltet
|
||||
depositon=Einzahlung eingeschaltet
|
||||
@@ -293,9 +469,227 @@ join=beitreten
|
||||
mute=stummschalten
|
||||
player.rank.changed=Rang würde gesetzt
|
||||
your.clans.are.already.rivals=Eure Clans sind bereits Rivalen
|
||||
player.got.money=Du hast für das töten von {1} Spielern basieren auf deiner KDR ({2}) {0} Geld bekommen
|
||||
cleared.bb=Das schwarze Brett wurde gelöscht
|
||||
clan.balance=Clan-Kontostand\: {0}
|
||||
bb.fee.player.kicked={0} wurde aus dem Clan geschmissen, da er/sie die Clangebühr nicht bezahlt hat
|
||||
bb.fee.set=Die Clangebühr beträgt {0} $
|
||||
bb.clan.deposit=Es wurden {0} $ überwiesen
|
||||
player.clan.deposit=Du hast {0} überwiesen
|
||||
bb.clan.withdraw=Es wurden {0} $ abgebucht
|
||||
player.clan.withdraw=Du hast {0} abgebucht
|
||||
clan.bank.not.enough.money=Das Konto von deinem Clan ist nicht ausreichend gedeckt
|
||||
your.clans.are.not.rivals=Eure Clans sind keine Rivalen
|
||||
the.clan.members.reached.limit=Dein Clan hat das Limit an Clanmitglieder erreicht
|
||||
you.have.reseted.your.kdr=Du hast deine KDR zurückgesetzt
|
||||
you.have.reseted.0.kdr=Du hast die KDR von {0} zurückgesetzt
|
||||
you.have.reseted.kdr.of.all.players=Du hast die KDR von allen Spielern zurückgesetzt
|
||||
resign.yes=Ja
|
||||
resign.no=Nein
|
||||
resign.confirmation=Bist du sicher dass du zurücktreten möchtest, {0}?
|
||||
resign.success=Du bist erfolgreich aus deinem Clan ausgetreten
|
||||
you.cannot.demote.the.last.leader=Du kannst den letzten Anführer nicht degradieren
|
||||
you.cannot.move.the.last.leader=Du kannst den letzten Anführer nicht versetzen
|
||||
player.successfully.demoted=Der Spieler wurde erfolgreich degradiert
|
||||
player.successfully.promoted=Der Spieler wurde erfolgreich befördert
|
||||
bb.one.minute=1 Minute
|
||||
bb.one.hour=1 Stunde
|
||||
bb.days= tage
|
||||
bb.one.day=1 Tag
|
||||
the.fee.is.0.and.its.current.value.is.1=Die Clangebühr ist {0} und hat einen aktuellen Betrag von {1} $
|
||||
fee.enabled=aktiviert
|
||||
fee.disabled=deaktiviert
|
||||
fee.set=Die Clangebühr wurde erfolgreich aktualisiert
|
||||
max.fee.allowed.is.0=Max. zulässige Gebühr ist {0}
|
||||
fee.collected=Es wurden dir {0} $ für die Clangebühr abgezogen
|
||||
player.purged=Der Spieler wurde erfolgreich entfernt
|
||||
upkeep.collected=Es wurden {0} $ für den Unterhalt abgezogen
|
||||
balance.is.not.enough.for.upkeep=Das Clankonto ist für den Unterhalt in höhe von {0} $ nicht ausreichend gedeckt. Überweise den Betrag von {0} $ auf dein Clankonto, um zu verhindern aufgelöst zu werden.
|
||||
your.clan.description.must.be.longer.than=Die Clanbeschreibung muss mehr als {0} Zeichen betragen
|
||||
your.clan.description.cannot.be.longer.than=Deine Clanbeschreibung darf nicht länger als {0} Zeichen betragen
|
||||
description.changed=Du hast erfolgreich die Beschreibung deines Clans geändert
|
||||
no.description=Keine Beschreibung
|
||||
the.player.must.wait.0.before.joining.your.clan.again=Dieser Spieler muss {0} Minute(n) warten, bevor er erneut deinem Clan beitreten kann
|
||||
disabled.command=Deaktivierter Befehl
|
||||
rank.displayname.updated=Der Anzeigename des Ranges wurde aktualisiert\!
|
||||
rank.setdefault=Der Standardrang des Clans wurde zu {0} gesetzt
|
||||
rank.removedefault=Der Standardrang des Clans wurde entfernt
|
||||
rank.0.permissions=Rang {0}''s Berechtigungen\:
|
||||
available.rank.permissions=Verfügbare Berechtigungen für Ränge\:
|
||||
rank.already.exists=Rang existiert bereits
|
||||
rank.0.does.not.exist=Rang {0} existiert nicht
|
||||
rank.created=Rang erstellt
|
||||
permission.0.added.to.rank.1=Die Berechtigung {0} wurde dem Rang {1} hinzugefügt
|
||||
permission.0.removed.from.rank.1=Die Berechtigung {0} wurde von dem Rang {1} entfernt
|
||||
rank.0.deleted=Rang {0} gelöscht
|
||||
clans.ranks=Clan Ränge\:
|
||||
ranks.list.item={0}\# {1} ({2})
|
||||
no.ranks=Keine Ränge erstellt
|
||||
rank.no.permissions=Dieser Rang hat bisher keinerlei Berechtigungen
|
||||
player.unassigned.from.rank=Spieler ist dem Rang nicht zugewiesen
|
||||
you.must.be.0.or.have.the.permission.1.to.use.this=Du musst {0} sein, oder dein Anführer muss deinem Rang die die Berechtigung {1} geben, um dies zu benutzen
|
||||
deposit.not.allowed=Überweisung ist nicht erlaubt. Benutze /%clan %toggle %deposit um die Überweisung zu erlauben
|
||||
withdraw.not.allowed=Abbuchen ist nicht erlaubt. Benutze /%clan %toggle %withdraw um das Abbuchen zu erlauben
|
||||
resign.request.cancelled=Rücktrittsanfrage abgebrochen
|
||||
promotion.vote.has.been.requested.from.all.leaders=Das Wählen der Beförderung wurde von allen Anführern angefordert
|
||||
allowed=erlaubt
|
||||
blocked=blockiert
|
||||
chat.joined=beigetreten
|
||||
chat.not.joined=nicht beigetreten
|
||||
gui.loading=&7Wird geladen...
|
||||
gui.back.title=&fZurück
|
||||
gui.previous.page.title=&fVorherige Seite
|
||||
gui.next.page.title=&fNächste Seite
|
||||
gui.lore.no.permission=&cDu hast keine Berechtigung, dies zu sehen\!
|
||||
gui.main.title={0} - Clan-Menü
|
||||
gui.main.languageselector.title=&fWähle deine Sprache
|
||||
gui.main.languageselector.lore.left.click=&7Linksklick, um Ihre Sprache zu wählen
|
||||
gui.main.languageselector.lore.right.click=&7Rechtsklick um beim Übersetzen zu helfen
|
||||
gui.main.other.commands.title=&fAndere Befehle
|
||||
gui.main.other.commands.lore=&7Linksklick, um alle Clanbefehle anzuzeigen
|
||||
gui.main.clan.list.title=&fClan Liste
|
||||
gui.main.clan.list.lore=&7Linksklick, um die Clanliste anzuzeigen
|
||||
gui.main.reset.kdr.title=&f Setze KDR zurück
|
||||
gui.main.reset.kdr.lore.price=&7Preis\: &b{0}
|
||||
gui.main.reset.kdr.lore=&7Linksklick zum Zurücksetzen deiner KDR
|
||||
gui.main.leaderboard.title=&fRangliste
|
||||
gui.main.leaderboard.lore=&7Linksklick, um die Rangliste zu sehen
|
||||
gui.main.staff.title=&fTeam
|
||||
gui.main.staff.lore=&7Linksklick zum Öffnen des Team Menüs
|
||||
gui.staff.title=Team
|
||||
gui.staff.clan.list.lore.left.click=&7Linksklick um alle Clans zu sehen
|
||||
gui.staff.clan.list.lore.right.click=&7Rechtsklick um alle Clans anzeigen zu lassen, welche nicht verifiziert sind
|
||||
gui.player.list.title=Spieler Liste
|
||||
gui.staff.player.list.title=&fSpieler Liste
|
||||
gui.staff.player.list.lore.left.click=&7Linksklick um alle Spieler anzuzeigen
|
||||
gui.staff.player.list.lore.right.click=&7Rechtsklick um alle Spieler anzuzeigen, die gerade online sind
|
||||
gui.staff.global.ff.title=&fGlobales Friendly Fire
|
||||
gui.staff.global.ff.lore.status=&7Status\: &b{0}
|
||||
gui.staff.global.ff.lore.toggle=&7Linksklick um den Friendly Fire Status umzuschalten
|
||||
gui.staff.reload.title=&fneu laden
|
||||
gui.staff.reload.lore=&7Linksklick um das Plugin neu zu laden
|
||||
gui.staff.clanlist.unverified.title=Anzahl nicht verifizierter Clans\: {0}
|
||||
gui.staff.clanlist.toplace.title=Wähle den neuen Clan von {0}
|
||||
gui.warning.title=Warnung
|
||||
gui.warning.no.permission.title=&fkeine Berechtigung
|
||||
gui.warning.no.permission.plugin.lore=&7Du hast nicht die ausreichende Berechtigung um diese Aktion auszuführen\!
|
||||
gui.warning.no.permission.leader.lore=&7Bist du einer der Anführer von dem Clans?
|
||||
gui.warning.no.permission.rank.lore=&/Du musst den Rang {0} besitzen oder dein Anführer muss deinem Rank die Berechtigung {1} geben um das zu benutzen\!
|
||||
gui.warning.not.verified.title=&fNicht verifiziert
|
||||
gui.warning.not.verified.lore=&7Dein Clan muss verifiziert sein\!
|
||||
gui.allies.title=Alliierte
|
||||
gui.allies.clan.lore=&7Rechtsklick um diese Allianz zu entfernen
|
||||
gui.allies.add.title=&fFüge eine Allianz hinzu
|
||||
gui.add.ally.title=Füge eine Allianz hinzu
|
||||
gui.add.ally.clan.lore=&7Linksklick um mit diesem Clan eine Allianz einzugehen
|
||||
gui.rivals.title=Rivalen
|
||||
gui.rivals.clan.lore=&7Rechtsklick um diese Rivalität zu beenden
|
||||
gui.rivals.add.title=&fStarte eine Rivalität
|
||||
gui.add.rival.title=Starte eine Rivalität
|
||||
gui.add.rival.clan.lore=&7Linksklick um mit diesem Clan eine Rivalität zu Starten
|
||||
gui.clanlist.title=Anzahl aller Clans\: {0}
|
||||
gui.clanlist.clan.title=&fClan\: [{0}&f] {1}
|
||||
gui.clanlist.clan.lore.position=&b\#{0}
|
||||
gui.clanlist.clan.lore.kdr=&7KDR\: &b{0}
|
||||
gui.clanlist.clan.lore.members=&Mitglieder\: &b{0}
|
||||
gui.coords.title=Koordinaten
|
||||
gui.coords.player.lore.distance=&7Distanz\: &b{0}
|
||||
gui.coords.player.lore.coords=&7Koordinaten\: &b{0} {1} {2}
|
||||
gui.coords.player.lore.world=&7Welt\: &b{0}
|
||||
gui.invite.title=Lade einen Spieler ein
|
||||
gui.invite.player.title=&f{0}
|
||||
gui.invite.player.price.lore=&7Preis\: &b{0}
|
||||
gui.invite.player.lore=&7Linksklick um einen Spieler einzuladen
|
||||
gui.roster.title=Dienstplan von {0}
|
||||
gui.roster.invite.title=&fEinladung
|
||||
gui.roster.invite.lore=&7Lade einen Spieler zu deinem Clan ein
|
||||
gui.leaderboard.title=Bestenliste - Spieler\: {0}
|
||||
gui.leaderboard.player.title=&f\#{0} {1}
|
||||
gui.ranks.title=Ränge
|
||||
gui.ranks.title.set.rank=Rang Setzten - Aktuell\: {0}
|
||||
gui.ranks.create.title=&fEinen Rang erstellen
|
||||
gui.ranks.create.lore=&7Linksklick um einen Rang zu erstellen
|
||||
gui.ranks.rank.title=&fRang\: {0}
|
||||
gui.ranks.rank.displayname.lore=&7Anzeigename\: &b{0}
|
||||
gui.ranks.rank.remove.lore=&7Rechtsklick um diesen Rang zu entfernen
|
||||
gui.ranks.rank.edit.permissions.lore=&7Linksklick um die Berechtigung des Rangs zu bearbeiten
|
||||
gui.ranks.rank.assign.lore=&7Linksklick um den Rang zu {0} zuzuweisen
|
||||
gui.permissions.title={0}''s Berechtigungen
|
||||
gui.permissions.add.title=&fFüge Berechtigungen hinzu
|
||||
gui.permissions.permission.title=&f{0}
|
||||
gui.permissions.permission.lore=&7Rechtsklick um diese Berechtigung von von dem Rang zu entfernen
|
||||
gui.add.permission.title=Berechtigung hinzufügen
|
||||
gui.add.permission.permission.title=&f{0}
|
||||
gui.add.permission.permission.lore=&7Linksklick um diese Berechtigung dem Rang hinzuzufügen
|
||||
gui.clandetails.title=[{0}] {1}
|
||||
gui.clandetails.free.agent.title=&fFreier Agent
|
||||
gui.clandetails.free.agent.create.clan.price.lore=&7Preis\: &b{0}
|
||||
gui.clandetails.free.agent.create.clan.lore=&7Linksklick, um einen Clan zu erstellen
|
||||
gui.clandetails.clan.title=&f[{0}&f] {1}
|
||||
gui.clandetails.clan.lore.description=&7Beschreibung\: &b{0}
|
||||
gui.clandetails.clan.lore.status=&7Status\: &b{0}
|
||||
gui.clandetails.clan.lore.leaders=&7Anführer\: &b{0}
|
||||
gui.clandetails.clan.lore.online.members=&7Mitglieder Online\: &b{0}/{1}
|
||||
gui.clandetails.clan.lore.kdr=&7KDR\: &b{0}
|
||||
gui.clandetails.clan.lore.kill.totals=&7Anzahl aller Kills\: &b[Rivalen\:{0} Neutral\:{1} Zivillisten\:{2}]
|
||||
gui.clandetails.clan.lore.deaths=&7Tode\: &b{0}
|
||||
gui.clandetails.clan.lore.fee=&7Gebühr\: &b{0}, {1}$
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
gui.clandetails.clan.lore.allies.separator=&b,
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
gui.clandetails.clan.lore.rivals.separator=&b,
|
||||
gui.clandetails.clan.lore.allies=&7Allianz\: &b{0}
|
||||
gui.clandetails.clan.lore.rivals=&7Rivalen\: &b{0}
|
||||
gui.clandetails.clan.lore.founded=&7Gegründet\: &b{0}
|
||||
gui.clandetails.clan.lore.inactive=&7Inaktiv\:{0}/{1} Tage
|
||||
gui.clandetails.allies.title=&fAllianzen
|
||||
gui.clandetails.allies.lore=&7Linksklick um deine Allianzen anzuzeigen oder um neue einzugehen
|
||||
gui.clandetails.rivals.title=&fRivalen
|
||||
gui.clandetails.rivals.lore=&7Linksklick um deine Rivalitäten anzuzeigen oder neue hinzuzufügen
|
||||
gui.clandetails.roster.title=Dienstplan
|
||||
gui.clandetails.roster.lore=&7Linksklick, um die Mitglieder deines Clans zu sehen oder mehr einzuladen
|
||||
gui.staffclandetails.roster.lore=&7Linksklick, um die Mitglieder des Clans zu sehen
|
||||
gui.clandetails.coords.title=&fKoordinaten
|
||||
gui.clandetails.coords.lore=&7Linksklick, um die Koordinaten der Mitglieder deines Clans zu sehen
|
||||
gui.clandetails.home.title=&fHaus
|
||||
gui.clandetails.home.lore.teleport.price=&7Teleport-Preis\: &b{0}
|
||||
gui.clandetails.home.lore.teleport=&7Linksklick um zu deiner Clan Basis zu kommen
|
||||
gui.staffclandetails.home.lore.teleport=&7Linksklick um dich zur Basis deines Clans zu teleportieren
|
||||
gui.clandetails.home.lore.clear=&7Mittel-Klick um das Haus deines Clans zu löschen
|
||||
gui.clandetails.home.lore.set.price=&7Setze Preis\: &b{0}
|
||||
gui.clandetails.home.lore.set=&7Rechtsklick um das Haus deines Clans zu setzen
|
||||
gui.staffclandetails.home.lore.set=&7Rechtsklick um das Haus dieses Clans zu setzen
|
||||
gui.clandetails.regroup.title=&fRegruppieren
|
||||
gui.clandetails.regroup.lore.price=&7Preis\: &b{0}
|
||||
gui.clandetails.regroup.lore.home=&7Linksklick, um die Mitglieder des Clans neu zu gruppieren
|
||||
gui.clandetails.regroup.lore.me=&7Rechtsklick, um die Mitglieder deines Clans an deinem Standort neu zu gruppieren
|
||||
gui.clandetails.ff.title=&fFreundliches Feuer
|
||||
gui.clandetails.ff.personal.lore=&7Personal\: &b{0}
|
||||
gui.clandetails.ff.clan.lore=&7Clan\: &b{0}
|
||||
gui.clandetails.ff.personal.toggle.lore=&7Linksklick, um dein Friendly Fire umzuschalten
|
||||
gui.clandetails.ff.clan.toggle.lore=&7Rechtsklick, um das Friendly Fire deines Clans umzuschalten
|
||||
gui.clandetails.bank.title=&fBank
|
||||
gui.clandetails.bank.balance.lore=&7Kontostand\: &b{0}
|
||||
gui.clandetails.bank.withdraw.status.lore=&7Auszahlung\: &b{0}
|
||||
gui.clandetails.bank.deposit.status.lore=&7Einzahlung\: &b{0}
|
||||
gui.clandetails.bank.withdraw.toggle.lore=&7Mittel-Klick um den Status der Abhebungen umzuschalten
|
||||
gui.clandetails.bank.deposit.toggle.lore=&7Rechtsklick, um den Status der Einzahlung umzuschalten
|
||||
gui.clandetails.fee.title=&fGebühr
|
||||
gui.clandetails.fee.status.lore=&7Status\: &b{0}
|
||||
gui.clandetails.fee.value.lore=&7Wert\: &b{0}
|
||||
gui.clandetails.fee.toggle.lore=&7Linksklick um den Status der Gebühr umzuschalten
|
||||
gui.clandetails.rank.title=&fRang
|
||||
gui.clandetails.rank.lore=&7Linksklick um den Rang von dem Clan zu sehen und um ihn zu bearbeiten
|
||||
gui.clandetails.verified.title=&fVerifiziert
|
||||
gui.clandetails.not.verified.title=&fNicht verifiziert
|
||||
gui.clandetails.verify.price.lore=&7Preis\: &b{0}
|
||||
gui.clandetails.not.verified.lore=&7Linksklick um deinen Clan zu verifizieren
|
||||
gui.staffclandetails.not.verified.lore=&7Linksklick um diesen Clan zu verifizieren
|
||||
gui.clandetails.resign.title=&fZurücktreten
|
||||
gui.clandetails.resign.lore=&7Linksklick um aus deinem Clan zurückzutreten
|
||||
gui.clandetails.disband.title=&fAuflösen
|
||||
gui.clandetails.disband.lore=&7Middle-Klick, um deinen Clan aufzulösen
|
||||
gui.staffclandetails.disband.lore=&7Linksklick um diesen Clan aufzulösen
|
||||
gui.clandetails.chat.title=&fChat
|
||||
gui.clandetails.chat.clan.chat.lore=&7/{0} [message] - &bSendet eine Nachricht an den Clan Chat
|
||||
gui.clandetails.chat.clan.join.leave.lore=&7/{0} {1}/{2} - &bBetritt/verlässt den Clan-Chat
|
||||
@@ -327,9 +721,26 @@ gui.playerdetails.demote.lore.right.click=&7Rechtsklick zum Degradieren
|
||||
gui.playerdetails.assign.unassign.title=&fAssign/Unassign rank
|
||||
gui.playerdetails.assign.lore.left.click=&7Linksklick zum Zuweisen
|
||||
gui.playerdetails.unassign.lore.right.click=&7Rechtsklick zum Aufheben
|
||||
gui.playerdetails.trust.untrust.title=&fVertrauenswürdig/nicht Vertrauenswürdig
|
||||
gui.playerdetails.trust.untrust.title=&fVertrauenswürdig/Nicht Vertrauenswürdig
|
||||
gui.playerdetails.trust.lore.left.click=&7Linksklick zum Vertrauen
|
||||
gui.playerdetails.untrust.lore.right.click=&7Rechtsklick, um das Vertrauen aufzuheben
|
||||
gui.playerdetails.ban.unban.title=&fBannen/Entbannen
|
||||
gui.playerdetails.ban.left.click=&7Linksklick um diesen Spieler von Clans zu bannen
|
||||
gui.playerdetails.unban.right.click=&7Rechtsklick um diesen Spieler zu entbannen
|
||||
gui.playerdetails.resetkdr.lore=&7Linksklick um die KDR von diesem Spieler zurückzusetzen
|
||||
gui.playerdetails.purge.title=&fEntfernen
|
||||
gui.playerdetails.purge.lore=&7Linksklick um die Daten dieses Spielers zu entfernen
|
||||
gui.playerdetails.place.title=&fPlatzieren
|
||||
gui.playerdetails.place.lore=&7Linksklick, um einen Clan für diesen Spieler auszuwählen
|
||||
gui.languageselector.title=Sprachen - Aktuell\: {0}
|
||||
gui.languageselector.language.title=&f{0}
|
||||
gui.languageselector.language.lore.left.click=&7Linksklick, um dies als Ihre Sprache zu setzen
|
||||
gui.languageselector.language.lore.translation.status=&7Übersetzungsstatus\: &b{0}%
|
||||
gui.languageselector.language.lore.right.click=&7Rechtsklick um beim Übersetzen zu helfen
|
||||
gui.confirmation.title=Bestätigung
|
||||
gui.confirmation.confirm=&7Klicke hier, um zu bestätigen
|
||||
gui.confirmation.return=&7Hier klicken um zurückzukehren
|
||||
gui.not.supported=&cWährend dem Öffnen der GUI ist ein Fehler aufgetretren... Deaktivieren der GUI... Hast du die richtige Version heruntergeladen?
|
||||
staff.member.verify.clan=&cEin Admin muss deinen Clan verifizieren\!
|
||||
player.already.has.that.rank=&cDer Spieler hat bereits diesen Rang\!
|
||||
joined.clan.chat=&bDu bist dem Clan-Chat beigetreten
|
||||
@@ -343,5 +754,49 @@ unmuted.ally.chat=&bDu hast den Allianzchat freigeschaltet
|
||||
player.already.in.this.clan=&cDer Spieler ist bereits in diesem Clan
|
||||
your.clan.reached.max.alliances=&cDein Clan hat die maximale Anzahl an Allianzen erreicht
|
||||
other.clan.reached.max.alliances=&cDer andere Clan hat die maximale Anzahl an Allianzen erreicht
|
||||
insert.clan.tag=&bDem Clan einen Tag hinzufügen\:
|
||||
insert.clan.name=&bDem Clan einen Namen geben\:
|
||||
insert.rank.name=&bDen Rangnamen einfügen\:
|
||||
click.to.help.translating=&bKlicke auf diesen Link &r{0} &bum bei der Übersetzung zu helfen
|
||||
your.clan.must.have.members.to.verify=&cDein Clan muss mindestens {0} Mitglieder haben um verifiziert werden zu können\!
|
||||
you.must.hold.a.banner=&cDu musst einen Banner in deiner Hand halten\!
|
||||
you.changed.clan.banner=&bDu hast den Banner deines Clans geändert\!
|
||||
your.clan.already.verified=&cDein Clan ist bereits verifiziert\!
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
player.lookup.clanname=&e[&8%clan_color_tag%&e] &b%clan_name%
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
player.lookup.killtype=&7Kill-Typ\: %player_kill_type%\n
|
||||
player.lookup=\n&b%player_name%&7's Spielerinfo &8-------------------------------------------\n \n &7Clan\: &f%clan_name%\n &7Rang\: &f%player_rank%\n &7Status\: &f%player_status%\n &7KDR\: &e%player_kdr%\n &7Anzahl Kills\: &8[Rivale\:&f%player_rival_kills% &8Neutrale\:&f%player_neutral_kills% &8Zivilisten\:&f%player_civilian_kills%&8]\n &7Tode\: &f%player_deaths%\n &7Beitrittsdatum\: &f%player_join_date%\n &7Zuletzt gesehen\: &f%player_last_seen%\n &7Vergangene Clans\: &f%player_past_clans%\n &7Inaktiv\: &f%player_inactive_days%&7/&f%player_max_inactive_days% Tage\n %kill_type_line%
|
||||
economy.disabled=&cWirtschaft deaktiviert\!
|
||||
has.been.purged=Die Daten von {0} wurden entfernt
|
||||
accepted.invitation=&bDu hast die Einladung von {0} angenommen
|
||||
denied.invitation=&cDu hast die Einladung von {0} abgelehnt
|
||||
must.be.in.clan.to.pvp=&cDu und {0} müsst Mitglieder eines Clans sein um gegeneinander kämpfen zu können\!
|
||||
clans.not.at.war.pvp.denied=&cDein clan ist nicht mit {0} im Krieg\!
|
||||
cannot.attack.civilians=&cDu kannst keine Zivilisten angreifen\!
|
||||
cannot.attack.clan.member=&cDu kannst kein anderes Clanmitglied angreifen\!
|
||||
cannot.attack.ally=&cDu kannst keine Allianz angreifen\!
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
cannot.change.member.fee.now=&cWährend die Clangebühr eingezogen wird, kannst du diese nicht ändern.
|
||||
cannot.change.member.fee.hours=&cVersuche es in {0} Stunden erneut...
|
||||
cannot.change.member.fee.minutes=&cVersuche es in {0} Minute(n)...
|
||||
cannot.kick.last.leader=&cDu kannst den letzten Anführer nicht rauswerfen\!
|
||||
you.can.only.set.base.in.your.land=&cDu kannst dein Zuhause nur auf deinem eigenen Land in Anspruch nehmen\!
|
||||
only.leaders.can.create.lands=&cNur ein Anführer kann ein Land erstellen\!
|
||||
only.one.land.per.clan=&cDein Clan besitzt bereits ein Land\!
|
||||
only.clan.members.can.create.lands=&cNur Clanmitglieder können Land erstellen\!
|
||||
land.allowed.all.actions=&bAlle Aktionen sind nun erlaubt\!
|
||||
land.blocked.all.actions=&bAlle Aktionen sind nicht mehr erlaubt\!
|
||||
land.allowed.action=&bErlaubte Aktion\!
|
||||
land.blocked.action=&bVerbotene Aktion\!
|
||||
you.do.not.own.lands=&cDu besitzt kein Land\!
|
||||
land.sharing.disabled=&cDas Teilen von Land ist deaktiviert\!
|
||||
war.expired=Der Krieg mit {0} ist abgelaufen\!
|
||||
|
||||
land.command=Land
|
||||
break.command=Abbauen
|
||||
interact.command=interagieren
|
||||
place_block.command=place_block
|
||||
damage.command=Schaden
|
||||
interact_entity.command=interact_entity
|
||||
container.command=Behälter
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -3,6 +3,8 @@ create.command=create
|
||||
delete.command=eliminar
|
||||
rank.command=rank
|
||||
setdisplayname.command=setdisplayname
|
||||
setdefault.command=setdefault
|
||||
removedefault.command=removedefault
|
||||
permissions.command=permisos
|
||||
list.command=list
|
||||
list.order.asc=asc
|
||||
@@ -22,10 +24,10 @@ vitals.command=vitals
|
||||
coords.command=coords
|
||||
stats.command=stats
|
||||
ally.command=ally
|
||||
add.command=añadir
|
||||
remove.command=eliminar
|
||||
allow.command=permitir
|
||||
block.command=bloquear
|
||||
add.command=add
|
||||
remove.command=remove
|
||||
allow.command=allow
|
||||
block.command=block
|
||||
auto.command=auto
|
||||
check.command=verificar
|
||||
assign.command=asignar
|
||||
@@ -49,6 +51,7 @@ purge.command=purge
|
||||
trust.command=trust
|
||||
untrust.command=untrust
|
||||
admin.command=admin
|
||||
mod.command=mod
|
||||
promote.command=promote
|
||||
demote.command=demote
|
||||
clanff.command=clanff
|
||||
@@ -63,8 +66,8 @@ globalff.command=globalff
|
||||
kills.command=kills
|
||||
mostkilled.command=mostkilled
|
||||
war.command=war
|
||||
start.command=iniciar
|
||||
end.command=terminar
|
||||
start.command=start
|
||||
end.command=end
|
||||
home.command=home
|
||||
regroup.command=reagrupar
|
||||
me.command=yo
|
||||
@@ -82,6 +85,7 @@ acf-core.parameter.displayname=nombre de pantalla
|
||||
acf-core.parameter.permission=permisos
|
||||
acf-core.parameter.message=mensaje
|
||||
acf-core.parameter.tag=etiqueta
|
||||
acf-core.parameter.name=nombre
|
||||
acf-core.parameter.fee=tarifa
|
||||
acf-core.parameter.description=descripcion
|
||||
acf-core.parameter.player=jugador
|
||||
@@ -89,6 +93,20 @@ acf-core.parameter.clan=clan
|
||||
acf-core.parameter.type=tipo
|
||||
acf-core.parameter.order=orden
|
||||
acf-core.parameter.help=pagina o palabras clave
|
||||
command.description.land.allow.all=Permite todas las acciones en tu tierra
|
||||
command.description.land.allow.interact_entity=Permite a los miembros del clan interactuar con entidades en tu tierra
|
||||
command.description.land.allow.interact=Permite a los miembros del clan interactuar con tu tierra
|
||||
command.description.land.allow.container=Permite a los miembros del clan abrir contenedores en tu tierra
|
||||
command.description.land.allow.place=Permite a los miembros del clan colocar bloques en tu tierra
|
||||
command.description.land.allow.break=Permite a los miembros del clan romper bloques en tu tierra
|
||||
command.description.land.allow.damage=Permite a los miembros del clan causar daño en tu tierra
|
||||
command.description.land.block.all=Bloquea todas las acciones en tu tierra
|
||||
command.description.land.block.interact_entity=Bloquea a los miembros del clan de interactuar con entidades en tu tierra
|
||||
command.description.land.block.interact=Bloquea que los miembros del clan interactúen con tu tierra
|
||||
command.description.land.block.container=Bloquea a los miembros del clan de abrir contenedores en tu tierra
|
||||
command.description.land.block.place=Bloquea a los miembros del clan de colocar bloques en tu tierra
|
||||
command.description.land.block.break=Bloquea a los miembros del clan de romper bloques en tu tierra
|
||||
command.description.land.block.damage=Bloquea a los miembros del clan de causar daño en tu tierra
|
||||
command.description.stats=Muestra las estadisticas de los miembros de tu clan
|
||||
command.description.rivalries=Muestra todas las rivalidades del clan
|
||||
command.description.mostkilled=Muestra el top de asesinatos del server
|
||||
@@ -141,6 +159,7 @@ command.description.ally.add=Añade un aliado
|
||||
command.description.clan=Abre la interfaz grafica
|
||||
command.description.disband=Disuelve tu clan
|
||||
command.description.mod.disband=Disuelve un clan
|
||||
command.description.mod.kick=Expulsa a un jugador del clan
|
||||
command.description.modtag=Modifica la etiqueta de un clan
|
||||
command.description.purge=Purga informacion de un jugador
|
||||
command.description.setbanner=Establece la bandera de tu clan
|
||||
@@ -163,6 +182,7 @@ command.description.admin.demote=Degrada algun lider de algun clan
|
||||
command.description.demote=Degrada un lider
|
||||
command.description.admin.promote=Promueve algun miembro de algun clan
|
||||
command.description.promote=Promueve un miembro a lider
|
||||
command.description.admin.permanent=Cambia el estado permanente de cualquier clan
|
||||
command.description.toggle.bb=Establece si el tablero de anuncios debe mostrarse al entrar al servidor
|
||||
command.description.toggle.tag=Establece si el tag de tu clan deberia mostrarse al lado de tu nombre
|
||||
command.description.toggle.deposit=Establece si los depositos de dinero estan permitidos en tu clan
|
||||
@@ -176,6 +196,8 @@ command.description.rank.create=Crea un rango
|
||||
command.description.rank.delete=Elimina un rango
|
||||
command.description.rank.list=Lista los rangos de tu clan
|
||||
command.description.rank.setdisplayname=Establece el nombre de pantalla de tu rango
|
||||
command.description.rank.setdefault=Establece el rango por defecto
|
||||
command.description.rank.removedefault=Elimina el rango predeterminado
|
||||
command.description.rank.permissions.available=Lista los permisos de rango disponibles
|
||||
command.description.rank.permissions.rank=Lista los permisos de un rango
|
||||
command.description.rank.permissions.add=Añade un permiso a un rango
|
||||
@@ -208,6 +230,7 @@ leader=lider
|
||||
roster=lista
|
||||
trusted=confiado
|
||||
untrusted=no confiado
|
||||
in.rank=en rango
|
||||
deaths=Muertes
|
||||
weights=Cargas
|
||||
stats=estadisticas
|
||||
@@ -218,6 +241,7 @@ food=Comida
|
||||
vitals=vitalidad
|
||||
verified=Verificado
|
||||
unverified=No Verificado
|
||||
permanent=Permanente
|
||||
profile=perfil
|
||||
civilian.abbreviation=Civ
|
||||
rank=Rango
|
||||
@@ -256,6 +280,11 @@ asking.for.the.deletion={0} esta solicitando la eliminacion del clan
|
||||
asking.for.the.promotion={0} esta solicitando promover a {1}
|
||||
asking.for.the.demotion={0} esta solicitando degradar a {1}
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
request.message= \n &8[&8{0}&8] &b{1}\n %accept% &bo %deny%\n
|
||||
clickable.accept=&a&l[ACEPTAR]
|
||||
clickable.deny=&c&l[RECHAZAR]
|
||||
hover.click.to.accept=&aClick aquí para aceptar
|
||||
hover.click.to.deny=&cClick aquí para rechazar
|
||||
not.sufficient.money=No tienes suficiente dinero en tu cuenta
|
||||
account.has.been.debited=Se ha descontado de tu cuenta {0}
|
||||
mysql.connection.successful=MySQL Connection successful
|
||||
@@ -348,6 +377,7 @@ inactive.0=Inactivo\: {0}
|
||||
clan.commands=comandos de clan
|
||||
you.can.only.modify.the.color.and.case.of.the.tag=Solo se puede modificar el color de la etiqueta
|
||||
tag.changed.to.0=Tag cambiado a {0}
|
||||
0.tag.changed.to.1=&bTag correctamente cambiado de {0} a {1}
|
||||
name.0=Nombre\: {0}
|
||||
description.0=Descripcion\: {0}
|
||||
leaders.0=Lideres\: {0}
|
||||
@@ -358,7 +388,7 @@ the.player.does.not.have.the.permissions.to.lead.a.clan=El jugador no tiene perm
|
||||
you.cannot.promote.yourself=No puedes promoverte a ti mismo
|
||||
the.player.is.already.a.leader=El jugador ya es un lider
|
||||
configuration.reloaded=Configuracion reiniciada
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=El ultimo lider no puede abandonar. Debes agregar un nuevo lider o disolver el clan.
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=El ultimo lider no puede abandonar el clan. Debes elegir otro lider o deshacer el clan
|
||||
0.has.resigned={0} ha abandonado
|
||||
you.cannot.trust.yourself=No puedes ponerte como confiable a vos mismo
|
||||
leaders.are.already.trusted=Lideres ya son confiables
|
||||
@@ -405,7 +435,7 @@ materials=Materiales
|
||||
armor.h=H
|
||||
armor.c=C
|
||||
armor.l=L
|
||||
armor.B=B
|
||||
armor.B=A
|
||||
diamond=diamante
|
||||
gold=oro
|
||||
wood=madera
|
||||
@@ -457,18 +487,18 @@ the.clan.members.reached.limit=La cantidad de miembros de tu clan llego al limit
|
||||
you.have.reseted.your.kdr=Has reseteado tu KDR
|
||||
you.have.reseted.0.kdr=Has reseteado el KDR de {0}
|
||||
you.have.reseted.kdr.of.all.players=Has reseteado el KDR de todos los jugadores
|
||||
you.have.toggled.permanent.status=Has cambiado el estado permanente para {0}
|
||||
permanent.status.enabled=El estado permanente de tu clan fue activado por {0}
|
||||
permanent.status.disabled=El estado permanente de tu clan fue desactivado por {0}
|
||||
resign.yes=Yes
|
||||
resign.no=No
|
||||
resign.confirmation=Estas seguro que quieres abandonar el clan? {0}
|
||||
resign.success=Has abandonado el clan exitosamente
|
||||
you.cannot.demote.the.last.leader=No puedes degradar al ultimo lider
|
||||
you.cannot.move.the.last.leader=No puedes mover al último líder
|
||||
player.successfully.demoted=El jugador fue degradado correctamente
|
||||
bb.ago= ago
|
||||
bb.moments=momentos
|
||||
bb.seconds= segundos
|
||||
bb.minutes= minutos
|
||||
player.successfully.promoted=El jugador fue ascendido con éxito
|
||||
bb.one.minute=1 minuto
|
||||
bb.hours= horas
|
||||
bb.one.hour=1 hora
|
||||
bb.days= dias
|
||||
bb.one.day=1 dia
|
||||
@@ -488,6 +518,8 @@ no.description=No hay descripcion
|
||||
the.player.must.wait.0.before.joining.your.clan.again=Este jugador debe esperar {0} minuto(s) antes de volver a entrar a tu clan
|
||||
disabled.command=Comando deshabilitado
|
||||
rank.displayname.updated=El nombre de muestra del clan fue actualizado\!
|
||||
rank.setdefault=El rango predeterminado del clan se ha establecido a {0}
|
||||
rank.removedefault=El rango predeterminado del clan ha sido eliminado
|
||||
rank.0.permissions=Permisos del Rango {0}\:
|
||||
available.rank.permissions=Permisos habilitados para rangos\:
|
||||
rank.already.exists=El rango ya existe
|
||||
@@ -502,7 +534,7 @@ no.ranks=Ningun rango fue creado
|
||||
rank.no.permissions=Este rango no tiene ningun permiso
|
||||
player.unassigned.from.rank=Jugador desasignado del rango
|
||||
you.must.be.0.or.have.the.permission.1.to.use.this=Debes ser {0} o tu lider debe darle a tu rango el permiso {1} para usar esto
|
||||
deposit.not.allowed=Depositos desactivados, usa /%clan %toggle %deposit para activarlo
|
||||
deposit.not.allowed=Deposit is not allowed
|
||||
withdraw.not.allowed=Retiros desactivados, usa /%clan %toggle %withdraw para activarlo
|
||||
resign.request.cancelled=Solicitud para abandonar el clan cancelada.
|
||||
promotion.vote.has.been.requested.from.all.leaders=Votacion para promover ha sido solicitada a todos los lideres
|
||||
@@ -737,7 +769,7 @@ you.must.hold.a.banner=&cDebes tener un estandarte en tu mano\!
|
||||
you.changed.clan.banner=&bHas cambiado el estandarte de tu clan\!
|
||||
your.clan.already.verified=&cTu clan ya esta verificado\!
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
clan.profile=\n&7Perfil de &b%clan_name%&8-------------------------------------------\n \n &7Nombre\: &e[&8%clan_color_tag%&e] &b%clan_name%\n &7Descripcion\: &f%clan_description%\n &7Estatus\: &f%clan_verified%\n &7Lideres\: %clan_leaders%\n &7Miembros en Linea\: &f%clan_online_count%&7/&f%clan_size%\n &7KDR\: &e%clan_kdr%\n &7Asesinatos Totales\: &8[Rivales\:&f%clan_rival_kills% &8Neutrales\:&f%clan_neutral_kills% &8Civiles\:&f%clan_civilian_kills%&8]\n &7Muertes\: &f%clan_deaths%\n &7Tarifa\: &f%clan_fee_enabled%&7, &f%clan_fee_value% $\n &7Aliados\: &f%clan_allies%\n &7Rivales\: &f%clan_rivals%\n &7Fundado\: &f%clan_founded%\n &7Inactivo\: &f%clan_inactive_days%&7/&f%clan_max_inactive_days% dias\n
|
||||
clan.profile=\n&7Perfil de &b%clan_name% &8-------------------------------------------\n \n &7Nombre\: &e[&8%clan_color_tag%&e] &b%clan_name%\n &7Descripcion\: &f%clan_description%\n &7Estatus\: &f%clan_status%\n &7Lideres\: %clan_leaders%\n &7Miembros Conectados\: &f%clan_online_count%&7/&f%clan_size%\n &7KDR\: &e%clan_kdr%\n &7Asesinatos Totales\: &8[Rivales\:&f%clan_rival_kills% &8Neutrales\:&f%clan_neutral_kills% &8Civiles\:&f%clan_civilian_kills%&8]\n &7Muertes\: &f%clan_deaths%\n &7Tarifa\: &f%clan_fee_enabled%&7, &f%clan_fee_value% $\n &7Aliados\: &f%clan_allies%\n &7Rivales\: &f%clan_rivals%\n &7Fundado\: &f%clan_founded%\n &7Inactivo\: &f%clan_inactive_days%&7/&f%clan_max_inactive_days% dias\n
|
||||
player.lookup.clanname=&e[&8%clan_color_tag%&e] &b%clan_name%
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
player.lookup.killtype=&7Tipo de Asesinato\: %player_kill_type%\n
|
||||
@@ -751,6 +783,29 @@ clans.not.at.war.pvp.denied=&cTu clan no esta en guerra con {0}\!
|
||||
cannot.attack.civilians=&cNo puedes atacar civiles\!
|
||||
cannot.attack.clan.member=&cNo puedes atacar miembros de tu clan\!
|
||||
cannot.attack.ally=&cNo puedes atacar a un aliado\!
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
cannot.change.member.fee.now=&cNo puedes cambiar la cuota de miembro cerca de su tiempo de recogida.
|
||||
cannot.change.member.fee.hours=&cInténtalo de nuevo en {0} horas...
|
||||
cannot.change.member.fee.minutes=&cInténtalo de nuevo en {0} minuto(s)...
|
||||
cannot.change.member.fee.minutes=&cInténtalo de nuevo en {0} minuto(s)...
|
||||
cannot.kick.last.leader=&cNo puedes expulsar al último líder\!
|
||||
cannot.disband.permanent=No puedes disolver este clan. Tiene un estatus de permanente.
|
||||
you.can.only.set.base.in.your.land=&cSolo puedes establecer tu casa en tu tierra\!
|
||||
only.leaders.can.create.lands=&cSolo los líderes pueden crear tierras\!
|
||||
only.one.land.per.clan=&cTu clan ya tiene una tierra\!
|
||||
only.clan.members.can.create.lands=&cSolo miembros del clan pueden crear tierras\!
|
||||
land.allowed.all.actions=&bAhora todas las acciones están activadas\!
|
||||
land.blocked.all.actions=&bAhora todas las acciones están bloqueadas\!
|
||||
land.allowed.action=&bAcción permitida\!
|
||||
land.blocked.action=&bAcción bloqueada\!
|
||||
you.do.not.own.lands=&cNo posees una tierra\!
|
||||
land.sharing.disabled=&cCompartir tierras está desactivado\!
|
||||
war.expired=La guerra con {0} ha terminado\!
|
||||
you.cant.start.war.online.members.difference=No puedes iniciar una guerra. Un clan tiene mas miembros conectados que el otro.
|
||||
|
||||
land.command=terreno
|
||||
break.command=romper
|
||||
interact.command=interactuar
|
||||
place_block.command=colocar_bloque
|
||||
damage.command=daño
|
||||
interact_entity.command=interactuar_entidad
|
||||
container.command=contenedor
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -83,12 +83,20 @@ acf-core.parameter.permission=autorisation
|
||||
acf-core.parameter.message=message
|
||||
acf-core.parameter.tag=tag
|
||||
acf-core.parameter.name=nom
|
||||
acf-core.parameter.fee=frais
|
||||
acf-core.parameter.description=description
|
||||
acf-core.parameter.player=joueur
|
||||
acf-core.parameter.clan=clan
|
||||
acf-core.parameter.help=page ou mots-clés
|
||||
command.description.stats=Montre les stats des membres de votre clan
|
||||
command.description.rivalries=Voir tous les rivaux du clan
|
||||
command.description.kills=Voir votre nombre de kills ou celui d'un autre joueur
|
||||
command.description.leaderboard=Voir le classement
|
||||
command.description.roster.other=Liste les membres d'un autre clan
|
||||
command.description.profile.other=Voir le profil d'un autre clan
|
||||
command.description.profile=Voir le profil de votre clan
|
||||
command.description.list=Liste de tous les clans
|
||||
command.description.chat=Parler dans le chat du clan
|
||||
command.description.ally=Parle dans le chat des alliés
|
||||
command.description.deny=Refuser une demande
|
||||
command.description.accept=Accepter une demande
|
||||
@@ -313,7 +321,6 @@ the.player.does.not.have.the.permissions.to.lead.a.clan=Le joueur n'a pas la per
|
||||
you.cannot.promote.yourself=Vous ne pouvez pas vous promouvoir vous-même
|
||||
the.player.is.already.a.leader=Le joueur est déjà un chef
|
||||
configuration.reloaded=Configuration rechargée
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=Le dernier chef ne peut pas démissionner. Vous devez nommer un autre chef ou dissoudre le clan
|
||||
0.has.resigned={0} a démissionné
|
||||
you.cannot.trust.yourself=Vous ne pouvez pas vous faire confiance
|
||||
leaders.are.already.trusted=Les chefs sont déjà de confiance
|
||||
@@ -418,12 +425,7 @@ resign.confirmation=Êtes-vous sûr de vouloir démissionner ? {0}
|
||||
resign.success=Vous avez démissionné de votre clan avec succès
|
||||
you.cannot.demote.the.last.leader=Vous ne pouvez pas rétrograder le dernier chef
|
||||
player.successfully.demoted=Le lecteur a été rétrogradé avec succès
|
||||
bb.ago= il y a
|
||||
bb.moments=moments
|
||||
bb.seconds= secondes
|
||||
bb.minutes= minutes
|
||||
bb.one.minute=1 minute
|
||||
bb.hours= heures
|
||||
bb.one.hour=1 heure
|
||||
bb.days= jours
|
||||
bb.one.day=1 jour
|
||||
@@ -477,6 +479,7 @@ gui.main.reset.kdr.lore.price=&7Prix\: &b{0}
|
||||
gui.main.reset.kdr.lore=&7Clic gauche pour réinitialiser votre KDR
|
||||
gui.main.leaderboard.title=&fClassement
|
||||
gui.main.leaderboard.lore=&fClique gauche pour voir le classement
|
||||
gui.staff.global.ff.lore.status=&fStatus\: {0}
|
||||
gui.warning.title=Avertissement
|
||||
gui.warning.no.permission.title=&fAucune permission
|
||||
gui.warning.no.permission.plugin.lore=Vous n'avez pas la permission pour effectuer cela\!
|
||||
@@ -597,6 +600,7 @@ gui.clandetails.chat.title=&fChat
|
||||
gui.clandetails.chat.clan.chat.lore=&7/{0} [message] - Envoie un message au chat du clan
|
||||
gui.clandetails.chat.clan.join.leave.lore=&7/{0} {1}/{2} - &bRejoindre/quitte le chat du clan
|
||||
gui.clandetails.chat.ally.chat.lore=&7/{0} [message] - Envoie un message au chat d''allié
|
||||
gui.clandetails.chat.clan.status.lore=&fClan\: {0}
|
||||
gui.playerdetails.title={0}
|
||||
gui.playerdetails.player.title=&f{0}
|
||||
gui.playerdetails.player.lore.noclan=&fClan\: Aucun
|
||||
@@ -622,6 +626,7 @@ gui.playerdetails.unassign.lore.right.click=&fClic droit pour dés-assigner
|
||||
gui.playerdetails.trust.untrust.title=&fFaire confiance/Ne pas faire confiance
|
||||
gui.playerdetails.trust.lore.left.click=&fClic gauche pour faire confiance
|
||||
gui.playerdetails.untrust.lore.right.click=&fClic droit pour ne pas faire confiance
|
||||
gui.languageselector.language.title=&f{0}
|
||||
joined.ally.chat=&bVous avez rejoint le chat allié
|
||||
left.ally.chat=&bVous avez quitté le chat allié
|
||||
muted.ally.chat=&bVous avez rendu muet le chat allié
|
||||
@@ -631,4 +636,6 @@ your.clan.reached.max.alliances=&cVotre clan a atteint le nombre maximum d'allia
|
||||
other.clan.reached.max.alliances=&cL'autre clan a atteint le nombre maximum d'alliances
|
||||
you.changed.clan.banner=&bVous avez changé la bannière de votre clan\!
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
description.command=Leírás
|
||||
setdefault.command=simabeallitasa
|
||||
removedefault.command=simatorlese
|
||||
list.type.founded=megalapítva
|
||||
acf-core.parameter.leader=vezető
|
||||
acf-core.parameter.description=Leírás
|
||||
home-menu=/{0} home{1} - Teleportálás a klán hazai bázisához
|
||||
home-set-menu=/{0} home set{1} - Beállítsa a klán hazai bázisát
|
||||
home-clear-menu=/{0} home clear{1} - Törli a klán hazai bázisát
|
||||
@@ -165,7 +170,6 @@ the.player.does.not.have.the.permissions.to.lead.a.clan=A játékosnak nincs jog
|
||||
you.cannot.promote.yourself=Nem reklámozhatod magad
|
||||
the.player.is.already.a.leader=A játékos már vezető szerepet játszik
|
||||
configuration.reloaded=A konfiguráció újratöltve
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan=A legutóbbi vezető nem tud lemondani. Új vezetőt kell kijelölni vagy fel kell oszlatni a klánt
|
||||
0.has.resigned={0} lemondott
|
||||
you.cannot.trust.yourself=Nem bízhatsz magadban
|
||||
leaders.are.already.trusted=A vezetők már megbízhatóak
|
||||
@@ -238,8 +242,13 @@ the.clan.members.reached.limit=A klán tagjai elérik a határt
|
||||
you.have.reseted.your.kdr=Visszaállítottad KDR-t
|
||||
you.have.reseted.0.kdr=Visszaállítottad a(z) {0} KDR-t
|
||||
you.have.reseted.kdr.of.all.players=Visszaállítottad a játékosok KDR-jét
|
||||
bb.days= nap
|
||||
gui.allies.title=Szövetségesek
|
||||
gui.rivals.title=Versenytárs
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
# suppress inspection "TrailingSpacesInProperty"
|
||||
|
||||
Loaded 100 of 149 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user