mirror of
https://github.com/ryderbelserion/SimpleFlags.git
synced 2026-11-06 01:42:32 -05:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91964656c9 | ||
|
|
d858c0139e | ||
|
|
90561317d3 | ||
|
|
899af6ee63 | ||
|
|
5d4f799b22 | ||
|
|
22c77db9ca | ||
|
|
28c1fd6d42 | ||
|
|
cb0311a524 | ||
|
|
fa6798aca7 | ||
|
|
668a0301c3 | ||
|
|
1c22bddb81 | ||
|
|
e592ef6dff | ||
|
|
cf83f64762 | ||
|
|
7ba8b918c0 | ||
|
|
8675ec5d77 | ||
|
|
a0d011e2a3 | ||
|
|
24b711a875 |
No files matched your search
@@ -30,14 +30,11 @@ body:
|
||||
description: Type /version plugin-name in-game
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Server Version
|
||||
description: What server version are you on?
|
||||
options:
|
||||
- "1.21.1"
|
||||
- "1.21.2"
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
name: Debug Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ryderbelserion/ryderbelserion/.github/workflows/debug.yml@main
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ryderbelserion/ryderbelserion/.github/workflows/build.yml@main
|
||||
|
||||
with:
|
||||
platforms: modrinth
|
||||
status: "release"
|
||||
branch: main
|
||||
|
||||
secrets:
|
||||
webhook: ${{ secrets.BUILD_WEBHOOK }}
|
||||
modrinth_token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
hangar_token: ${{ secrets.HANGAR_KEY }}
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Snapshot Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ryderbelserion/ryderbelserion/.github/workflows/build.yml@main
|
||||
|
||||
with:
|
||||
platforms: modrinth
|
||||
status: "beta"
|
||||
branch: main
|
||||
|
||||
secrets:
|
||||
webhook: ${{ secrets.SF_WEBHOOK }}
|
||||
modrinth_token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
hangar_token: ${{ secrets.HANGAR_KEY }}
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Sync Page Description
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
push:
|
||||
paths:
|
||||
- 'README.md' # Triggers for changes to this specific file
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
uses: ryderbelserion/ryderbelserion/.github/workflows/sync.yml@main
|
||||
|
||||
secrets:
|
||||
modrinth_token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
+11
-11
@@ -1,14 +1,14 @@
|
||||
### Intellij
|
||||
.kotlin/
|
||||
.idea/
|
||||
!.idea/icon.png
|
||||
|
||||
### Gradle
|
||||
.gradle
|
||||
.idea
|
||||
jars
|
||||
build
|
||||
build/
|
||||
|
||||
run
|
||||
### Servers
|
||||
run/
|
||||
|
||||
!run/config
|
||||
!run/spigot.yml
|
||||
!run/bukkit.yml
|
||||
!run/eula.txt
|
||||
!run/server.properties
|
||||
!run/plugins
|
||||
!run/ops.json
|
||||
### Output
|
||||
jars/
|
||||
@@ -1,8 +0,0 @@
|
||||
## Changes:
|
||||
- Updated how flags are handled internally to easily add newer flags.
|
||||
- Currently working on another flag I am interested in.
|
||||
|
||||
## Fixed:
|
||||
- Added a null check if the flag is not in the registry.
|
||||
- This only happens if you enable a config option, and do `/simpleflags reload`
|
||||
- WorldGuard flags can only be added on startup, as any time after that... the registry is frozen.
|
||||
@@ -1,339 +1,21 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
MIT License
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Copyright (c) 2024 Ryder Belserion
|
||||
|
||||
Preamble
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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
|
||||
this service 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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE 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.
|
||||
|
||||
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
|
||||
convey 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 2 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, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision 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, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This 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.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+109
-75
@@ -1,107 +1,141 @@
|
||||
import utils.convertList
|
||||
import utils.updateMarkdown
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.runPaper)
|
||||
alias(libs.plugins.minotaur)
|
||||
alias(libs.plugins.shadow)
|
||||
id("modrinth-plugin")
|
||||
|
||||
`java-library`
|
||||
`java-plugin`
|
||||
}
|
||||
|
||||
rootProject.group = "com.ryderbelserion.simpleflags"
|
||||
rootProject.version = "1.0.1"
|
||||
rootProject.description = "A plugin that adds simple worldguard flags."
|
||||
|
||||
repositories {
|
||||
maven("https://repo.papermc.io/repository/maven-public")
|
||||
|
||||
maven("https://repo.crazycrew.us/libraries")
|
||||
|
||||
maven("https://maven.enginehub.org/repo")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.vital.paper)
|
||||
|
||||
compileOnly(libs.worldguard)
|
||||
|
||||
compileOnly(libs.paper)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of("21"))
|
||||
}
|
||||
val git = feather.getBuilder()
|
||||
|
||||
tasks {
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(21)
|
||||
}
|
||||
jar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
javadoc {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
subprojects {
|
||||
dependsOn(project.tasks.build)
|
||||
}
|
||||
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
archiveClassifier = ""
|
||||
|
||||
assemble {
|
||||
dependsOn(shadowJar)
|
||||
val files = subprojects.filter { it.name != "common" && it.name != "api" }.mapNotNull {
|
||||
val file = it.tasks.jar.get().archiveFile
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from(shadowJar.get())
|
||||
into(rootProject.projectDir.resolve("jars"))
|
||||
if (file.isPresent) {
|
||||
zipTree(file.get().asFile)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
from(files) {
|
||||
exclude("META-INF/MANIFEST.MF")
|
||||
}
|
||||
|
||||
doFirst {
|
||||
files.forEach { file ->
|
||||
file.matching { include("META-INF/MANIFEST.MF") }.files.forEach {
|
||||
manifest.from(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
}
|
||||
val releaseType = rootProject.ext.get("release_type").toString()
|
||||
val color = rootProject.property("${releaseType.lowercase()}_color").toString()
|
||||
val isRelease = releaseType.equals("release", true)
|
||||
|
||||
runServer {
|
||||
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
|
||||
feather {
|
||||
workingDirectory = rootProject.rootDir.toPath()
|
||||
|
||||
defaultCharacterEncoding = Charsets.UTF_8.name()
|
||||
val origin = git.getNewestCommit(rootProject.property("repository_owner").toString(),rootProject.name, git.utils.getRemoteCommitHash())
|
||||
|
||||
minecraftVersion(libs.versions.minecraft.get())
|
||||
}
|
||||
discord {
|
||||
webhook {
|
||||
group(rootProject.name.lowercase())
|
||||
task("release-build")
|
||||
|
||||
modrinth {
|
||||
token.set(System.getenv("MODRINTH_TOKEN"))
|
||||
if (System.getenv("BUILD_WEBHOOK") != null) {
|
||||
post(System.getenv("BUILD_WEBHOOK"))
|
||||
}
|
||||
|
||||
projectId.set(rootProject.name)
|
||||
if (isRelease) {
|
||||
val user = origin?.user
|
||||
|
||||
versionType.set("release")
|
||||
username(user?.name ?: "N/A")
|
||||
avatar(user?.getAvatar() ?: "N/A")
|
||||
} else {
|
||||
username(rootProject.property("author_name").toString())
|
||||
|
||||
versionName.set("${rootProject.name} ${rootProject.version}")
|
||||
versionNumber.set(rootProject.version as String)
|
||||
avatar(rootProject.property("author_avatar").toString())
|
||||
}
|
||||
|
||||
changelog.set(rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8))
|
||||
embeds {
|
||||
embed {
|
||||
color(color)
|
||||
|
||||
uploadFile.set(shadowJar.get())
|
||||
title("The next version of ${rootProject.name} is ready!")
|
||||
|
||||
gameVersions.set(listOf(libs.versions.minecraft.get()))
|
||||
if (isRelease) {
|
||||
content("<@&${rootProject.property("discord_role_id").toString()}>")
|
||||
}
|
||||
|
||||
loaders.addAll(listOf("purpur", "paper", "folia"))
|
||||
fields {
|
||||
field(
|
||||
"Version ${rootProject.version}",
|
||||
listOf(
|
||||
"*Click below to download!*",
|
||||
"<:modrinth:1115307870473420800> [Modrinth](https://modrinth.com/plugin/${rootProject.name.lowercase()}/version/${rootProject.version})",
|
||||
"<:hangar:1139326635313733652> [Hangar](https://hangar.papermc.io/${rootProject.property("repository_owner").toString().replace("-", "")}/${rootProject.name.lowercase()}/versions/${rootProject.version})",
|
||||
"",
|
||||
"<:business:1527739792358637598> [Jenkins](https://ci.crazycrew.us/job/${rootProject.name}/)"
|
||||
).convertList()
|
||||
)
|
||||
|
||||
syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8))
|
||||
field(
|
||||
":bug: Report Bugs",
|
||||
"https://github.com/${rootProject.property("repository_owner")}/${rootProject.name}/issues"
|
||||
)
|
||||
|
||||
autoAddDependsOn.set(false)
|
||||
detectLoaders.set(false)
|
||||
}
|
||||
field(
|
||||
":hammer: Changelog",
|
||||
rootProject.ext.get("mc_changelog").toString().updateMarkdown()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
val props = mapOf(
|
||||
"name" to rootProject.name,
|
||||
"version" to rootProject.version,
|
||||
"group" to rootProject.group,
|
||||
"description" to rootProject.description,
|
||||
"apiVersion" to libs.versions.minecraft.get()
|
||||
)
|
||||
webhook {
|
||||
group(rootProject.name.lowercase())
|
||||
task("failed-build")
|
||||
|
||||
filesMatching("paper-plugin.yml") {
|
||||
expand(props)
|
||||
if (System.getenv("BUILD_WEBHOOK") != null) {
|
||||
post(System.getenv("BUILD_WEBHOOK"))
|
||||
}
|
||||
|
||||
username(rootProject.property("mascot_name").toString())
|
||||
|
||||
avatar(rootProject.property("mascot_avatar").toString())
|
||||
|
||||
embeds {
|
||||
embed {
|
||||
color(rootProject.property("failed_color").toString())
|
||||
|
||||
title("Oh no! It failed!")
|
||||
|
||||
thumbnail("https://raw.githubusercontent.com/ryderbelserion/Branding/refs/heads/main/booze.jpg")
|
||||
|
||||
fields {
|
||||
field(
|
||||
"The build versioned ${rootProject.version} for project ${rootProject.name} failed.",
|
||||
"The developer is likely already aware, he is just getting drunk."
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Bundled plugins
|
||||
implementation(libs.bundles.build)
|
||||
|
||||
// Paper plugins
|
||||
implementation(libs.bundles.paper)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
rootProject.name = "buildSrc"
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
plugins {
|
||||
id("com.ryderbelserion.feather.core")
|
||||
|
||||
`java-library`
|
||||
}
|
||||
|
||||
val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
|
||||
|
||||
repositories {
|
||||
maven("https://repo.codemc.io/repository/maven-public/")
|
||||
|
||||
maven("https://repo.opencollab.dev/maven-snapshots/")
|
||||
|
||||
maven("https://repo.triumphteam.dev/snapshots/")
|
||||
|
||||
maven("https://repo.crazycrew.us/snapshots/")
|
||||
maven("https://repo.crazycrew.us/releases/")
|
||||
|
||||
maven("https://jitpack.io/")
|
||||
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
|
||||
}
|
||||
|
||||
tasks {
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(25)
|
||||
}
|
||||
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
|
||||
inputs.properties(
|
||||
// global
|
||||
"artifact" to rootProject.name,
|
||||
"group" to project.group,
|
||||
"version" to rootProject.version,
|
||||
"description" to rootProject.description.toString(),
|
||||
|
||||
// fabric
|
||||
"id" to rootProject.name.lowercase(),
|
||||
"fabricloader" to libs.findVersion("fabric-loader").get(),
|
||||
|
||||
// generic
|
||||
"minecraft" to libs.findVersion("minecraft").get(),
|
||||
|
||||
// website
|
||||
"website" to "https://github.com/${rootProject.property("repository_owner")}/${rootProject.name}",
|
||||
|
||||
"current_commit" to rootProject.ext.get("current_commit").toString(),
|
||||
"previous_commit" to rootProject.ext.get("previous_commit").toString()
|
||||
)
|
||||
|
||||
with(copySpec {
|
||||
include("*paper-plugin.yml", "*fabric.mod.json", "*version.json")
|
||||
|
||||
from("src/main/resources") {
|
||||
expand(inputs.properties)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id("io.papermc.paperweight.userdev")
|
||||
id("xyz.jpenilla.run-paper")
|
||||
|
||||
id("shadow-plugin")
|
||||
}
|
||||
|
||||
val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
|
||||
|
||||
repositories {
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
|
||||
maven("https://repo.extendedclip.com/releases/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
paperweight.paperDevBundle(libs.findVersion("paper").get().toString())
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
|
||||
plugins {
|
||||
id("net.darkhax.curseforgegradle")
|
||||
|
||||
id("shared-plugin")
|
||||
}
|
||||
|
||||
val libs: VersionCatalog = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
|
||||
|
||||
tasks.register("publishCurseForge", net.darkhax.curseforgegradle.TaskPublishCurseForge::class) {
|
||||
apiToken = System.getenv("CURSEFORGE_TOKEN")
|
||||
|
||||
val projectId = rootProject.property("cf_project_id") as String?
|
||||
|
||||
var mainFile = upload(projectId, tasks.named<Jar>("jar").flatMap { it.archiveFile })
|
||||
|
||||
mainFile.addGameVersion(rootProject.property("cf_game_version") as String?)
|
||||
mainFile.releaseType = rootProject.ext.get("release_type").toString().uppercaseFirstChar()
|
||||
mainFile.displayName = "${rootProject.version as String}-${project.name}"
|
||||
mainFile.changelog = rootProject.file("changelog.md").readText()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import io.papermc.hangarpublishplugin.model.Platforms
|
||||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
|
||||
plugins {
|
||||
id("io.papermc.hangar-publish-plugin")
|
||||
|
||||
id("shared-plugin")
|
||||
}
|
||||
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
apiKey.set(System.getenv("HANGAR_KEY"))
|
||||
|
||||
id.set("${rootProject.property("project_id")}")
|
||||
|
||||
version.set("${rootProject.version}")
|
||||
|
||||
changelog.set(rootProject.ext.get("mc_changelog").toString())
|
||||
|
||||
channel.set(rootProject.ext.get("release_type").toString().uppercaseFirstChar())
|
||||
|
||||
platforms {
|
||||
register(Platforms.PAPER) {
|
||||
jar.set(tasks.named<Jar>("jar").flatMap { it.archiveFile })
|
||||
|
||||
platformVersions.set(rootProject.property("project_versions").toString().split(",").map { it.trim() })
|
||||
|
||||
dependencies {
|
||||
hangar("PlaceholderAPI") {
|
||||
required = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
plugins {
|
||||
id("com.modrinth.minotaur")
|
||||
id("shared-plugin")
|
||||
}
|
||||
|
||||
modrinth {
|
||||
token = "mrp_rQCjGHWfpst4KBrJEf022BvqwrVScPeIN3n7w1Vckq4dUnLeFCJvjMGd6xuP"
|
||||
|
||||
projectId = "${rootProject.property("project_id")}"
|
||||
|
||||
versionName = rootProject.ext.get("version_name").toString()
|
||||
versionNumber = "${rootProject.version}"
|
||||
versionType = rootProject.ext.get("release_type").toString()
|
||||
|
||||
changelog = rootProject.ext.get("mc_changelog").toString()
|
||||
|
||||
gameVersions.addAll(rootProject.property("project_versions").toString().split(",").map { it.trim() })
|
||||
|
||||
uploadFile.set(tasks.named<Jar>("jar"))
|
||||
|
||||
loaders.addAll(rootProject.property("project_platforms").toString().split(",").map { it.trim() })
|
||||
|
||||
syncBodyFrom = rootProject.file("README.md").readText(Charsets.UTF_8)
|
||||
|
||||
autoAddDependsOn = false
|
||||
detectLoaders = false
|
||||
|
||||
dependencies {
|
||||
optional.project("PlaceholderAPI")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
plugins {
|
||||
id("com.gradleup.shadow")
|
||||
id("java-plugin")
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
|
||||
exclude("META-INF/**")
|
||||
|
||||
listOf(
|
||||
"com.ryderbelserion.fusion",
|
||||
"org.bstats"
|
||||
).forEach {
|
||||
relocate(it, "libs.$it")
|
||||
}
|
||||
|
||||
minimize {
|
||||
exclude(dependency("com.ryderbelserion.fusion:.*"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import utils.convertList
|
||||
|
||||
plugins {
|
||||
id("com.ryderbelserion.feather.core")
|
||||
|
||||
id("java-plugin") apply false
|
||||
}
|
||||
|
||||
val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
|
||||
|
||||
val git = feather.getBuilder()
|
||||
val utils = git.utils
|
||||
|
||||
val branch = utils.getRemoteBranch()
|
||||
val hash = utils.getRemoteCommitHash()
|
||||
val commit = utils.getRemoteCommitMessage(hash, "%B")
|
||||
|
||||
val status: String = System.getenv().getOrDefault("version_status", "release").lowercase()
|
||||
|
||||
val buildNumber: String = System.getenv("BUILD_NUMBER") ?: "N/A"
|
||||
val isJenkins: Boolean = buildNumber != "N/A"
|
||||
|
||||
val isRelease: Boolean = status == "release"
|
||||
val isAlpha: Boolean = status == "alpha"
|
||||
val isBeta: Boolean = status == "beta"
|
||||
|
||||
val commitHash: String = hash.subSequence(0, 7).toString()
|
||||
val changelog = rootProject.file("changelog.md").readText(Charsets.UTF_8)
|
||||
val content: String = if (isRelease) changelog else if (isBeta || isAlpha || isJenkins) {
|
||||
"[$commitHash](https://github.com/${rootProject.property("repository_owner")}/${rootProject.name}/commit/$commitHash) $commit"
|
||||
} else changelog
|
||||
|
||||
val minecraft = libs.findVersion("minecraft").get()
|
||||
|
||||
rootProject.description = rootProject.property("project_description").toString()
|
||||
rootProject.version = if (isBeta || isJenkins) "$minecraft-$commitHash" else if (isAlpha) "${rootProject.property("plugin_version")}-SNAPSHOT" else rootProject.property("plugin_version").toString()
|
||||
rootProject.group = rootProject.property("project_group").toString()
|
||||
|
||||
rootProject.ext {
|
||||
set("version_name", if (isBeta) "${rootProject.version}" else "${rootProject.name} ${rootProject.version}")
|
||||
set("release_type", status)
|
||||
|
||||
set("current_commit", commitHash)
|
||||
set("previous_commit", System.getenv("GIT_PREVIOUS_SUCCESSFUL_COMMIT") ?: "N/A")
|
||||
set("build_number", buildNumber)
|
||||
|
||||
set("mc_changelog", content.lines().convertList())
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package utils
|
||||
|
||||
fun String.updateMarkdown(): String {
|
||||
val list = split("\n")
|
||||
|
||||
val builder = StringBuilder(list.size)
|
||||
|
||||
list.forEach {
|
||||
if (it.contains("##")) {
|
||||
val text = it.replace("## ", "")
|
||||
|
||||
builder.append("**${text}**").append("\n")
|
||||
} else {
|
||||
builder.append(it).append("\n")
|
||||
}
|
||||
}
|
||||
|
||||
return builder.toString()
|
||||
}
|
||||
|
||||
fun List<String>.convertList(): String {
|
||||
val builder = StringBuilder(size)
|
||||
|
||||
forEach {
|
||||
builder.append(it).append("\n")
|
||||
}
|
||||
|
||||
return builder.toString()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
- Fixed a bug with drowning listener which canceled all forms of damage as the damage type wasn't properly checked.
|
||||
@@ -0,0 +1,23 @@
|
||||
# SimpleFlags
|
||||
Adds extra flags to be used by WorldGuard regions
|
||||
|
||||
## Missing a flag?
|
||||
* [Suggest a new flag!](https://github.com/ryderbelserion/SimpleFlags/issues/new?assignees=&labels=feature&projects=&template=flags.yml)
|
||||
|
||||
## Dependencies
|
||||
* WorldGuard (Required)
|
||||
|
||||
## Available Flags
|
||||
* prevent_natural_spawning - stops mobs from naturally spawning in a region.
|
||||
* prevent_drowning - prevents players from drowning.
|
||||
|
||||
## Permissions
|
||||
* `simpleflags.access`
|
||||
* Default: **OP**
|
||||
* Description: Allows the player to use `/simpleflags`
|
||||
* `simpleflags.help`
|
||||
* Default: **OP**
|
||||
* Description: Allows the player to use `/simpleflags help`
|
||||
* `simpleflags.reload`
|
||||
* Default: **OP**
|
||||
* Description: Allows the player to use `/simpleflags reload`
|
||||
@@ -0,0 +1,36 @@
|
||||
# suppress inspection "SpellCheckingInspection" for whole file
|
||||
org.gradle.jvmargs = -Xmx3G
|
||||
org.gradle.daemon = false
|
||||
org.gradle.parallel = false
|
||||
|
||||
# The GitHub repo/organization
|
||||
repository_owner = ryderbelserion
|
||||
|
||||
# Author details
|
||||
author_name = Ryder Belserion
|
||||
author_avatar = https://github.com/ryderbelserion.png
|
||||
|
||||
# Masocot details
|
||||
mascot_name = Beidou
|
||||
mascot_avatar = https://raw.githubusercontent.com/ryderbelserion/Branding/refs/heads/main/beidou/christmas/emojis/padoru.png
|
||||
|
||||
# The version of the plugin
|
||||
plugin_version = 1.1.1
|
||||
|
||||
# The color for beta builds
|
||||
beta_color = #ffa347
|
||||
# The color for the alpha builds
|
||||
alpha_color = #ff496e
|
||||
# The color for release builds
|
||||
release_color = #1bd96a
|
||||
# The color when a build fails
|
||||
failed_color = #ff000d
|
||||
|
||||
# The role id to ping when publishing releases
|
||||
discord_role_id = 1528286022255775928
|
||||
|
||||
project_description = Adds extra flags to be used by WorldGuard regions
|
||||
project_group = com.ryderbelserion.simpleflags
|
||||
project_platforms = paper,folia,purpur
|
||||
project_versions = 26.1.2,26.2
|
||||
project_id = SimpleFlags
|
||||
+96
-28
@@ -1,38 +1,106 @@
|
||||
[plugins]
|
||||
hangar = { id = "io.papermc.hangar-publish-plugin", version.ref = "hangar" }
|
||||
runPaper = { id = "xyz.jpenilla.run-paper", version.ref = "runPaper" }
|
||||
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }
|
||||
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
|
||||
|
||||
[versions]
|
||||
# Paper API
|
||||
paper = "1.21.1-R0.1-SNAPSHOT"
|
||||
velocity = "3.3.0-SNAPSHOT"
|
||||
minecraft = "1.21.1"
|
||||
brigadier = "1.3.10"
|
||||
## Paper API
|
||||
paperweight = "2.0.0-beta.21" # https://github.com/PaperMC/paperweight
|
||||
adventure = "5.2.0" # https://github.com/KyoriPowered/adventure
|
||||
run-paper = "3.0.2" # https://github.com/jpenilla/run-task
|
||||
|
||||
# Vital API
|
||||
vital-common = "0.0.6"
|
||||
vital-paper = "1.0.6"
|
||||
paper = "26.1.2.build.+" # https://github.com/PaperMC/Paper
|
||||
|
||||
# Gradle Plugins
|
||||
runPaper = "2.3.0"
|
||||
minotaur = "2.8.7"
|
||||
hangar = "0.1.2"
|
||||
shadow = "8.3.0"
|
||||
## Minecraft API
|
||||
minecraft = "26.1.2" # https://minecraft.net
|
||||
|
||||
## Other API
|
||||
fusion = "4.50.1" # https://github.com/ryderbelserion/Fusion
|
||||
|
||||
## Metrics API
|
||||
bstats = "3.2.1" # https://bstats.org/docs
|
||||
|
||||
## Fabric API
|
||||
fabric-loader = "0.19.2" # https://fabricmc.net/develop/
|
||||
fabric-loom = "1.16-SNAPSHOT" # https://fabricmc.net/develop/
|
||||
fabric-api = "0.150.0+26.1.2" # https://fabricmc.net/develop/
|
||||
|
||||
## Gradle Plugins
|
||||
fix-javadoc = "1.19" # https://github.com/mfnalex/gradle-fix-javadoc-plugin
|
||||
curseforge = "1.1.26" # https://github.com/Darkhax/CurseForgeGradle
|
||||
minotaur = "2.9.0" # https://github.com/modrinth/minotaur
|
||||
feather = "0.6.1" # https://github.com/ryderbelserion/Feather
|
||||
hangar = "0.1.4" # https://github.com/HangarMC/hangar-publish-plugin
|
||||
shadow = "9.6.0" # https://github.com/GradleUp/shadow
|
||||
|
||||
[plugins]
|
||||
# https://github.com/mfnalex/gradle-fix-javadoc-plugin
|
||||
fix-javadoc = { id = "com.jeff-media.fix-javadoc-plugin", version.ref = "fix-javadoc" }
|
||||
|
||||
# https://fabricmc.net/develop/
|
||||
fabric-loom = { id = "net.fabricmc.fabric-loom", version.ref = "fabric-loom" }
|
||||
|
||||
[libraries]
|
||||
# Velocity API
|
||||
velocity = { module = "com.velocitypowered:velocity-api", version.ref = "velocity" }
|
||||
# https://github.com/Darkhax/CurseForgeGradle
|
||||
curseforge = { group = "net.darkhax.curseforgegradle", name = "net.darkhax.curseforgegradle.gradle.plugin", version.ref = "curseforge" }
|
||||
|
||||
# https://github.com/PaperMC/paperweight
|
||||
paperweight = { module = "io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin", version.ref = "paperweight" }
|
||||
|
||||
# https://github.com/ryderbelserion/Feather
|
||||
feather = { module = "com.ryderbelserion.feather.core:com.ryderbelserion.feather.core.gradle.plugin", version.ref = "feather" }
|
||||
|
||||
# https://github.com/HangarMC/hangar-publish-plugin
|
||||
hangar = { module = "io.papermc.hangar-publish-plugin:io.papermc.hangar-publish-plugin.gradle.plugin", version.ref = "hangar" }
|
||||
|
||||
# https://github.com/modrinth/minotaur
|
||||
minotaur = { module = "com.modrinth.minotaur:com.modrinth.minotaur.gradle.plugin", version.ref = "minotaur" }
|
||||
|
||||
# https://github.com/GradleUp/shadow
|
||||
shadow = { module = "com.gradleup.shadow:shadow-gradle-plugin", version.ref = "shadow" }
|
||||
|
||||
# https://github.com/jpenilla/run-task
|
||||
run-paper = { module = "xyz.jpenilla:run-task", version.ref = "run-paper" }
|
||||
|
||||
# https://github.com/ryderbelserion/Fusion
|
||||
fusion-velocity = { module = "com.ryderbelserion.fusion:fusion-velocity", version.ref = "fusion" }
|
||||
fusion-hytale = { module = "com.ryderbelserion.fusion:fusion-hytale", version.ref = "fusion" }
|
||||
fusion-paper = { module = "com.ryderbelserion.fusion:fusion-paper", version.ref = "fusion" }
|
||||
fusion-kyori = { module = "com.ryderbelserion.fusion:fusion-kyori", version.ref = "fusion" }
|
||||
fusion-core = { module = "com.ryderbelserion.fusion:fusion-core", version.ref = "fusion" }
|
||||
fusion-api = { module = "com.ryderbelserion.fusion:fusion-api", version.ref = "fusion" }
|
||||
|
||||
# https://fabricmc.net/develop/
|
||||
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api" }
|
||||
fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader" }
|
||||
|
||||
# WorldGuard API
|
||||
worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", version = "7.0.17" }
|
||||
|
||||
# Mojang API
|
||||
brigadier = { module = "com.mojang:brigadier", version.ref = "brigadier" }
|
||||
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
|
||||
|
||||
# Paper API
|
||||
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
|
||||
# https://github.com/KyoriPowered/adventure
|
||||
kyori-logger = { module = "net.kyori:adventure-text-logger-slf4j", version.ref = "adventure" }
|
||||
kyori-text = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure" }
|
||||
kyori-api = { module = "net.kyori:adventure-api", version.ref = "adventure" }
|
||||
|
||||
worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", version = "7.1.0-SNAPSHOT" }
|
||||
# https://bstats.org
|
||||
bstats-hytale = { module = "org.bstats:bstats-hytale", version.ref = "bstats" }
|
||||
bstats-paper = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" }
|
||||
|
||||
# Vital API
|
||||
vital-common = { module = "com.ryderbelserion.vital:common", version.ref = "vital-common" }
|
||||
vital-paper = { module = "com.ryderbelserion.vital:paper", version.ref = "vital-paper" }
|
||||
[bundles]
|
||||
kyori = [
|
||||
"kyori-logger",
|
||||
"kyori-text",
|
||||
"kyori-api"
|
||||
]
|
||||
|
||||
build = [
|
||||
"curseforge",
|
||||
"minotaur",
|
||||
"feather",
|
||||
"hangar",
|
||||
"shadow"
|
||||
]
|
||||
|
||||
paper = [
|
||||
"paperweight",
|
||||
|
||||
"run-paper"
|
||||
]
|
||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -84,7 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -112,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -170,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -203,15 +203,14 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+13
-12
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,22 +59,21 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
plugins {
|
||||
`paper-plugin`
|
||||
}
|
||||
|
||||
project.group = "${rootProject.group}.paper"
|
||||
|
||||
repositories {
|
||||
maven("https://maven.enginehub.org/repo")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.fusion.paper)
|
||||
|
||||
compileOnly(libs.worldguard)
|
||||
}
|
||||
|
||||
tasks {
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
listOf(
|
||||
"com.ryderbelserion.fusion",
|
||||
"io.leangen.geantyref",
|
||||
//"com.zaxxer.hikari",
|
||||
"org.spongepowered",
|
||||
"com.google.gson",
|
||||
"org.jspecify"
|
||||
).forEach {
|
||||
relocate(it, "libs.$it")
|
||||
}
|
||||
}
|
||||
|
||||
runPaper.folia.registerTask()
|
||||
|
||||
runServer {
|
||||
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
|
||||
jvmArgs("-Dcom.mojang.eula.agree=true")
|
||||
|
||||
defaultCharacterEncoding = Charsets.UTF_8.name()
|
||||
|
||||
minecraftVersion(libs.versions.minecraft.get())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.ryderbelserion.simpleflags.paper;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.ryderbelserion.fusion.core.api.registry.message.MessageRegistry;
|
||||
import com.ryderbelserion.fusion.core.files.FileManager;
|
||||
import com.ryderbelserion.fusion.paper.FusionPaper;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.types.other.FlyFlag;
|
||||
import com.ryderbelserion.simpleflags.paper.commands.BaseCommand;
|
||||
import com.ryderbelserion.simpleflags.paper.commands.types.ReloadCommand;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.types.damage.DrownFlag;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.types.entity.NaturalFlag;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.types.blocks.BlockCrafterFlag;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.types.blocks.InteractionCrafterFlag;
|
||||
import com.ryderbelserion.simpleflags.paper.listeners.block.CrafterListener;
|
||||
import com.ryderbelserion.simpleflags.paper.listeners.damage.DrowningListener;
|
||||
import com.ryderbelserion.simpleflags.paper.listeners.entity.NaturalSpawnListener;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.adapters.PaperSenderAdapter;
|
||||
import com.ryderbelserion.simpleflags.paper.listeners.other.FlightStatusListener;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.regions.RegionContainer;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager;
|
||||
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleFlags extends JavaPlugin {
|
||||
|
||||
public static final String namespace = "simpleflags";
|
||||
|
||||
private MessageRegistry messageRegistry;
|
||||
private ConfigManager configManager;
|
||||
private FileManager fileManager;
|
||||
private FusionPaper fusion;
|
||||
|
||||
private PaperSenderAdapter adapter;
|
||||
private FlagManager flagManager;
|
||||
private WorldGuard worldGuard;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.fusion = new FusionPaper(this);
|
||||
this.fusion.init();
|
||||
|
||||
this.messageRegistry = this.fusion.getMessageRegistry();
|
||||
this.fileManager = this.fusion.getFileManager();
|
||||
|
||||
this.configManager = new ConfigManager();
|
||||
this.configManager.init();
|
||||
|
||||
this.adapter = new PaperSenderAdapter();
|
||||
|
||||
this.configManager.loadMessages();
|
||||
|
||||
this.worldGuard = WorldGuard.getInstance();
|
||||
|
||||
this.flagManager = new FlagManager();
|
||||
|
||||
List.of(
|
||||
// damage flags
|
||||
new DrownFlag(),
|
||||
|
||||
// entity flags
|
||||
new NaturalFlag(),
|
||||
|
||||
// status flags
|
||||
new FlyFlag(),
|
||||
|
||||
// block flags
|
||||
new InteractionCrafterFlag(),
|
||||
new BlockCrafterFlag()
|
||||
).forEach(this.flagManager::addFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
if (this.fusion != null) {
|
||||
this.fusion.post();
|
||||
}
|
||||
|
||||
final PluginManager pluginManager = getServer().getPluginManager();
|
||||
|
||||
List.of(
|
||||
// entity listeners
|
||||
new NaturalSpawnListener(),
|
||||
|
||||
// damage listeners
|
||||
new DrowningListener(),
|
||||
|
||||
// status listeners
|
||||
new FlightStatusListener(),
|
||||
|
||||
// crafter listeners
|
||||
new CrafterListener()
|
||||
).forEach(event -> pluginManager.registerEvents(event, this));
|
||||
|
||||
final LifecycleEventManager<Plugin> eventManager = getLifecycleManager();
|
||||
|
||||
// Register commands.
|
||||
eventManager.registerEventHandler(LifecycleEvents.COMMANDS, event -> {
|
||||
LiteralArgumentBuilder<CommandSourceStack> root = new BaseCommand().registerPermissions().literal().createBuilder();
|
||||
|
||||
List.of(
|
||||
new ReloadCommand()
|
||||
).forEach(command -> root.then(command.registerPermissions().literal()));
|
||||
|
||||
event.registrar().register(root.build(), "The base command for SimpleFlags!");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
public @NonNull PaperSenderAdapter getSenderAdapter() {
|
||||
return this.adapter;
|
||||
}
|
||||
|
||||
public @NonNull MessageRegistry getMessageRegistry() {
|
||||
return this.messageRegistry;
|
||||
}
|
||||
|
||||
public @NonNull ConfigManager getConfigManager() {
|
||||
return this.configManager;
|
||||
}
|
||||
|
||||
public @NonNull RegionContainer getRegions() {
|
||||
return this.worldGuard.getPlatform().getRegionContainer();
|
||||
}
|
||||
|
||||
public @NonNull FlagManager getFlagManager() {
|
||||
return this.flagManager;
|
||||
}
|
||||
|
||||
public @NonNull FileManager getFileManager() {
|
||||
return this.fileManager;
|
||||
}
|
||||
|
||||
public @NonNull WorldGuard getWorldGuard() {
|
||||
return this.worldGuard;
|
||||
}
|
||||
|
||||
public @NonNull FusionPaper getFusion() {
|
||||
return this.fusion;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api;
|
||||
|
||||
import com.ryderbelserion.fusion.paper.FusionPaper;
|
||||
import com.ryderbelserion.fusion.paper.builders.commands.PaperCommand;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.ConfigManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public abstract class SimpleFlagsCommand extends PaperCommand {
|
||||
|
||||
protected final SimpleFlags platform = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
protected final ConfigManager configManager = this.platform.getConfigManager();
|
||||
|
||||
protected final FusionPaper fusion = this.platform.getFusion();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.enums;
|
||||
|
||||
import com.ryderbelserion.fusion.api.FusionProvider;
|
||||
import com.ryderbelserion.fusion.api.enums.Level;
|
||||
import com.ryderbelserion.fusion.api.enums.files.enums.FileAction;
|
||||
import com.ryderbelserion.fusion.api.enums.files.enums.FileType;
|
||||
import com.ryderbelserion.fusion.api.exceptions.FusionException;
|
||||
import com.ryderbelserion.fusion.core.files.FileManager;
|
||||
import com.ryderbelserion.fusion.core.files.interfaces.ICustomFile;
|
||||
import com.ryderbelserion.fusion.core.files.types.configurate.JsonCustomFile;
|
||||
import com.ryderbelserion.fusion.core.files.types.configurate.YamlCustomFile;
|
||||
import com.ryderbelserion.fusion.kyori.FusionKyori;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.spongepowered.configurate.BasicConfigurationNode;
|
||||
import org.spongepowered.configurate.CommentedConfigurationNode;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@NullMarked
|
||||
public enum FileKeys {
|
||||
|
||||
messages("messages.yml", FileType.YAML, List.of(
|
||||
FileAction.EXTRACT_FILE
|
||||
));
|
||||
|
||||
private final FusionKyori fusion = (FusionKyori) FusionProvider.api();
|
||||
|
||||
private final Path dataPath = this.fusion.getDataPath();
|
||||
|
||||
private final FileManager fileManager = this.fusion.getFileManager();
|
||||
|
||||
private final List<FileAction> actions;
|
||||
private final FileType fileType;
|
||||
private final Path path;
|
||||
|
||||
FileKeys(final String fileName, final String folder, final FileType fileType, final List<FileAction> actions) {
|
||||
this.path = this.dataPath.resolve(folder).resolve(fileName);
|
||||
this.fileType = fileType;
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
FileKeys(final String fileName, final FileType fileType, final List<FileAction> actions) {
|
||||
this.path = this.dataPath.resolve(fileName);
|
||||
this.fileType = fileType;
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
public final CommentedConfigurationNode getConfiguration() {
|
||||
return getYamlCustomFile().getConfiguration();
|
||||
}
|
||||
|
||||
public final YamlCustomFile getYamlCustomFile() {
|
||||
final Optional<YamlCustomFile> customFile = this.fileManager.getYamlFile(this.path);
|
||||
|
||||
if (customFile.isEmpty()) {
|
||||
throw new FusionException("Could not find custom file for " + this.path);
|
||||
}
|
||||
|
||||
return customFile.get();
|
||||
}
|
||||
|
||||
public final BasicConfigurationNode getConfigurationNode() {
|
||||
return getJsonCustomFile().getConfiguration();
|
||||
}
|
||||
|
||||
public final JsonCustomFile getJsonCustomFile() {
|
||||
final Optional<JsonCustomFile> customFile = this.fileManager.getJsonFile(this.path);
|
||||
|
||||
if (customFile.isEmpty()) {
|
||||
throw new FusionException("Could not find custom file for " + this.path);
|
||||
}
|
||||
|
||||
return customFile.get();
|
||||
}
|
||||
|
||||
public final ICustomFile<?, ?, ?> getCustomFile() {
|
||||
final Optional<ICustomFile<?, ?, ?>> customFile = this.fileManager.getFile(this.path);
|
||||
|
||||
if (customFile.isEmpty()) {
|
||||
throw new FusionException("Could not find custom file for " + this.path);
|
||||
}
|
||||
|
||||
return customFile.get();
|
||||
}
|
||||
|
||||
public final boolean hasCustomFile() {
|
||||
return this.fileManager.hasFile(this.path);
|
||||
}
|
||||
|
||||
public final void load() {
|
||||
if (this.actions.contains(FileAction.DELETE_FILE)) {
|
||||
try {
|
||||
java.nio.file.Files.deleteIfExists(this.path);
|
||||
} catch (final IOException exception) {
|
||||
this.fusion.log(Level.error, "Failed to delete: %s", exception, this.path);
|
||||
}
|
||||
}
|
||||
|
||||
this.fileManager.addFile(this.path, this.fileType, action -> action.addActions(this.actions));
|
||||
}
|
||||
|
||||
public final void reload() {
|
||||
if (this.actions.contains(FileAction.DELETE_FILE)) {
|
||||
try {
|
||||
java.nio.file.Files.deleteIfExists(this.path);
|
||||
} catch (final IOException exception) {
|
||||
this.fusion.log(Level.error, "Failed to delete: %s", exception, this.path);
|
||||
}
|
||||
}
|
||||
|
||||
this.fileManager.addFile(this.path, this.fileType, action -> action.addActions(this.actions).addAction(FileAction.RELOAD_FILE));
|
||||
}
|
||||
|
||||
public final void save() {
|
||||
this.fileManager.saveFile(this.path);
|
||||
}
|
||||
|
||||
public final FileType getFileType() {
|
||||
return this.fileType;
|
||||
}
|
||||
|
||||
public final Path getPath() {
|
||||
return this.path;
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.enums.messages;
|
||||
|
||||
import com.ryderbelserion.fusion.api.objects.FusionKey;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.PropertyManager;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.objects.enums.PropertyType;
|
||||
import com.ryderbelserion.fusion.core.api.registry.message.MessageRegistry;
|
||||
import com.ryderbelserion.fusion.core.api.registry.message.adapter.YamlMessageAdapter;
|
||||
import com.ryderbelserion.fusion.core.utils.StringUtils;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.adapters.PaperSenderAdapter;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.spongepowered.configurate.CommentedConfigurationNode;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import static com.ryderbelserion.simpleflags.paper.SimpleFlags.namespace;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@NullMarked
|
||||
public enum Message {
|
||||
|
||||
reload_plugin("root.reload-plugin", "{prefix}<red>You have reloaded the plugin.", "root", "reload-plugin"),
|
||||
help_menu("root.help-menu", List.of(
|
||||
"<red>SimpleFlags Help Menu",
|
||||
"",
|
||||
"<red>/simpleflags <gray>- <gold>Shows this menu.",
|
||||
"<red>/simpleflags reload <gray>- <gold>Reloads the plugin."
|
||||
), "root", "help-menu");
|
||||
|
||||
private final SimpleFlags platform = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final ConfigManager configManager = this.platform.getConfigManager();
|
||||
|
||||
private final PropertyManager pluginConfig = this.configManager.getConfig();
|
||||
|
||||
private final PaperSenderAdapter senderAdapter = this.platform.getSenderAdapter();
|
||||
|
||||
private final String defaultValue;
|
||||
private final PropertyType type;
|
||||
private final Object[] path;
|
||||
private final FusionKey id;
|
||||
|
||||
Message(final String id, final String defaultValue, final Object... path) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.id = FusionKey.key(namespace, id);
|
||||
this.type = PropertyType.STRING;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
Message(final String id, final List<String> defaultValue, final Object... path) {
|
||||
this.defaultValue = StringUtils.toString(defaultValue);
|
||||
this.id = FusionKey.key(namespace, id);
|
||||
this.type = PropertyType.STRING_LIST;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public void addKey(final MessageRegistry registry, final CommentedConfigurationNode configuration, final FusionKey id) {
|
||||
final YamlMessageAdapter adapter = new YamlMessageAdapter(configuration, this.defaultValue, this.path);
|
||||
|
||||
registry.addKey(
|
||||
id,
|
||||
this.id,
|
||||
adapter
|
||||
);
|
||||
}
|
||||
|
||||
public final List<String> toList(final String value) {
|
||||
return value.lines().toList();
|
||||
}
|
||||
|
||||
public void sendMessage(final CommandSender sender, final Map<String, String> placeholders) {
|
||||
switch (this.pluginConfig.getProperty(RootKeys.message_state)) {
|
||||
case send_message -> this.senderAdapter.sendMessage(sender, this.id, placeholders);
|
||||
case send_actionbar -> this.senderAdapter.sendActionBar(sender, this.id, placeholders);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMessage(final CommandSender sender, final String placeholder, final String value) {
|
||||
sendMessage(sender, Map.of(placeholder, value));
|
||||
}
|
||||
|
||||
public void sendMessage(final CommandSender sender) {
|
||||
sendMessage(sender, Map.of());
|
||||
}
|
||||
|
||||
public final FusionKey getKey() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.enums.messages;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@NullMarked
|
||||
public enum State {
|
||||
|
||||
send_message("send_message"),
|
||||
send_actionbar("send_actionbar");
|
||||
|
||||
private final String name;
|
||||
|
||||
State(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public final String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.adapters;
|
||||
|
||||
import com.ryderbelserion.fusion.api.objects.FusionKey;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.PropertyManager;
|
||||
import com.ryderbelserion.fusion.core.api.registry.message.MessageRegistry;
|
||||
import com.ryderbelserion.fusion.paper.FusionPaper;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PaperSenderAdapter {
|
||||
|
||||
private final SimpleFlags platform = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final FusionPaper fusion = this.platform.getFusion();
|
||||
|
||||
private final ConfigManager configManager = this.platform.getConfigManager();
|
||||
|
||||
private final PropertyManager pluginConfig = this.configManager.getConfig();
|
||||
|
||||
private final MessageRegistry messageRegistry = this.platform.getMessageRegistry();
|
||||
|
||||
public void sendActionBar(@NonNull final CommandSender sender, @NonNull final FusionKey id, @NonNull final Map<String, String> placeholders) {
|
||||
final Component component = getComponent(sender, id, placeholders);
|
||||
|
||||
if (component.equals(Component.empty())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
sender.sendMessage(component);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sender.sendActionBar(component);
|
||||
}
|
||||
|
||||
public void sendMessage(@NonNull final CommandSender sender, @NonNull final FusionKey id, @NonNull final Map<String, String> placeholders) {
|
||||
final Component component = getComponent(sender, id, placeholders);
|
||||
|
||||
if (component.equals(Component.empty())) {
|
||||
return;
|
||||
}
|
||||
|
||||
sender.sendMessage(component);
|
||||
}
|
||||
|
||||
public Component getComponent(@NonNull final CommandSender sender, @NonNull final FusionKey id, @NonNull final Map<String, String> placeholders) {
|
||||
final List<String> values = new ArrayList<>();
|
||||
|
||||
this.messageRegistry.getMessage(id).ifPresent(value -> values.add(value.getValue()));
|
||||
|
||||
if (values.isEmpty()) {
|
||||
return Component.empty();
|
||||
}
|
||||
|
||||
final String value = values.getFirst();
|
||||
|
||||
if (value.isEmpty()) {
|
||||
return Component.empty();
|
||||
}
|
||||
|
||||
final Map<String, String> map = new HashMap<>(placeholders);
|
||||
|
||||
final String prefix = this.pluginConfig.getProperty(RootKeys.command_prefix);
|
||||
|
||||
if (!prefix.isEmpty()) {
|
||||
map.putIfAbsent("{prefix}", prefix);
|
||||
}
|
||||
|
||||
return this.fusion.asComponent(sender, values.getFirst(), map, List.of());
|
||||
}
|
||||
|
||||
public String getMessage(@NonNull final CommandSender sender, @NonNull final FusionKey id, @NonNull final Map<String, String> placeholders) {
|
||||
final List<String> values = new ArrayList<>();
|
||||
|
||||
this.messageRegistry.getMessage(id).ifPresent(value -> values.add(value.getValue()));
|
||||
|
||||
if (values.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
final String value = values.getFirst();
|
||||
|
||||
if (value.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
final Map<String, String> map = new HashMap<>(placeholders);
|
||||
|
||||
final String prefix = this.pluginConfig.getProperty(RootKeys.command_prefix);
|
||||
|
||||
if (!prefix.isEmpty()) {
|
||||
map.putIfAbsent("{prefix}", prefix);
|
||||
}
|
||||
|
||||
return this.fusion.replacePlaceholders(this.fusion.papi(sender, value), map);
|
||||
}
|
||||
}
|
||||
+11
-6
@@ -1,18 +1,23 @@
|
||||
package com.ryderbelserion.simpleflags.flags;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags;
|
||||
|
||||
import ch.jalu.configme.SettingsManager;
|
||||
import com.ryderbelserion.simpleflags.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.config.ConfigManager;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.PropertyManager;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.ConfigManager;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
||||
import com.sk89q.worldguard.protection.regions.RegionQuery;
|
||||
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public abstract class FlagBuilder<T extends Flag> {
|
||||
|
||||
protected SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
protected final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
protected SettingsManager config = ConfigManager.getConfig();
|
||||
protected final ComponentLogger logger = this.plugin.getComponentLogger();
|
||||
|
||||
protected final ConfigManager configManager = this.plugin.getConfigManager();
|
||||
|
||||
protected final PropertyManager config = this.configManager.getConfig();
|
||||
|
||||
public abstract void register();
|
||||
|
||||
+6
-1
@@ -1,8 +1,9 @@
|
||||
package com.ryderbelserion.simpleflags.flags;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class FlagManager {
|
||||
|
||||
@@ -21,6 +22,10 @@ public class FlagManager {
|
||||
return this.flags.containsKey(name);
|
||||
}
|
||||
|
||||
public Optional<FlagBuilder<?>> getByFlag(String name) {
|
||||
return Optional.ofNullable(this.flags.get(name));
|
||||
}
|
||||
|
||||
public FlagBuilder<?> getFlag(String name) {
|
||||
return this.flags.get(name);
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.ryderbelserion.simpleflags.flags.builders;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.builders;
|
||||
|
||||
import com.ryderbelserion.simpleflags.flags.FlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagBuilder;
|
||||
import com.sk89q.worldguard.protection.flags.IntegerFlag;
|
||||
|
||||
public abstract class IntegerFlagBuilder extends FlagBuilder<IntegerFlag> {
|
||||
+22
-11
@@ -1,6 +1,6 @@
|
||||
package com.ryderbelserion.simpleflags.flags.builders;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.builders;
|
||||
|
||||
import com.ryderbelserion.simpleflags.flags.FlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagBuilder;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
@@ -14,26 +14,37 @@ public abstract class StateFlagBuilder extends FlagBuilder<StateFlag> {
|
||||
@Override
|
||||
public abstract StateFlag getFlag();
|
||||
|
||||
/**
|
||||
* Tests a location
|
||||
*
|
||||
* @param player the {@link Player}
|
||||
* @param flag the {@link StateFlag}
|
||||
* @return true or false
|
||||
*/
|
||||
public boolean testLocation(final Player player, final StateFlag flag) {
|
||||
return getQuery().testState(BukkitAdapter.adapt(player.getLocation()), WorldGuardPlugin.inst().wrapPlayer(player), flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent any type of damage in any region.
|
||||
*
|
||||
* @param player the player to prevent damage to.
|
||||
* @param source the source of the damage.
|
||||
* @param type the type of the damage to check.
|
||||
* @param flag the flag.
|
||||
* @param player the player to prevent damage to
|
||||
* @param source the source of the damage
|
||||
* @param type the type of the damage to check
|
||||
* @param flag the flag
|
||||
* @return true or false
|
||||
*/
|
||||
public boolean preventDamage(Player player, DamageSource source, DamageType type, StateFlag flag) {
|
||||
return source.getDamageType() == type && getQuery().testState(BukkitAdapter.adapt(player.getLocation()), WorldGuardPlugin.inst().wrapPlayer(player), flag);
|
||||
return source.getDamageType() != type || testLocation(player, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent spawning based on a supplied spawn reason.
|
||||
*
|
||||
* @param location the location to check.
|
||||
* @param receivingReason the reason from the event.
|
||||
* @param reason your reason.
|
||||
* @param flag the flag.
|
||||
* @param location the location to check
|
||||
* @param receivingReason the reason from the event
|
||||
* @param reason your reason
|
||||
* @param flag the flag
|
||||
* @return true or false
|
||||
*/
|
||||
public boolean preventSpawning(org.bukkit.Location location, CreatureSpawnEvent.SpawnReason receivingReason, CreatureSpawnEvent.SpawnReason reason, StateFlag flag) {
|
||||
+4
-1
@@ -1,8 +1,11 @@
|
||||
package com.ryderbelserion.simpleflags.flags.enums;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.enums;
|
||||
|
||||
public enum CustomFlags {
|
||||
|
||||
NATURAL_FLAG("prevent_natural_spawning"),
|
||||
FLIGHT_FLAG("prevent_flight"),
|
||||
CRAFTER_INTERACTION_FLAG("prevent_crafter_interaction"),
|
||||
CRAFTER_BLOCK_FLAG("prevent_crafter_block"),
|
||||
DROWN_FLAG("prevent_drowning"),
|
||||
CAPACITY_FLAG("max_players");
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.types.blocks;
|
||||
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
|
||||
public class BlockCrafterFlag extends StateFlagBuilder {
|
||||
|
||||
private StateFlag flag;
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
if (!isEnabled()) return;
|
||||
|
||||
try {
|
||||
getRegistry().register(this.flag = new StateFlag("prevent-crafter-block", true));
|
||||
} catch (FlagConflictException exception) {
|
||||
Flag<?> existingFlag = getRegistry().get("prevent-crafter-block");
|
||||
|
||||
if (existingFlag instanceof StateFlag stateFlag) {
|
||||
this.flag = stateFlag;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.warn("An error has occurred registering {} flag. Reason: {}", getName(), exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return CustomFlags.CRAFTER_BLOCK_FLAG.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StateFlag getFlag() {
|
||||
return this.flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.config.getProperty(RootKeys.is_crafter_place_enabled);
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.types.blocks;
|
||||
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
|
||||
public class InteractionCrafterFlag extends StateFlagBuilder {
|
||||
|
||||
private StateFlag flag;
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
if (!isEnabled()) return;
|
||||
|
||||
try {
|
||||
getRegistry().register(this.flag = new StateFlag("prevent-crafter-interaction", true));
|
||||
} catch (FlagConflictException exception) {
|
||||
Flag<?> existingFlag = getRegistry().get("prevent-crafter-interaction");
|
||||
|
||||
if (existingFlag instanceof StateFlag stateFlag) {
|
||||
this.flag = stateFlag;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.warn("An error has occurred registering {} flag. Reason: {}", getName(), exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return CustomFlags.CRAFTER_INTERACTION_FLAG.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StateFlag getFlag() {
|
||||
return this.flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.config.getProperty(RootKeys.is_crafter_interaction_enabled);
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,12 +1,11 @@
|
||||
package com.ryderbelserion.simpleflags.flags.types;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.types.damage;
|
||||
|
||||
import com.ryderbelserion.simpleflags.config.impl.Config;
|
||||
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.flags.enums.CustomFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class DrownFlag extends StateFlagBuilder {
|
||||
|
||||
@@ -27,7 +26,7 @@ public class DrownFlag extends StateFlagBuilder {
|
||||
return;
|
||||
}
|
||||
|
||||
this.plugin.getLogger().log(Level.WARNING, "An error has occurred registering " + getName() + " flag.", exception);
|
||||
this.logger.warn("An error has occurred registering {} flag. Reason: {}", getName(), exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +42,6 @@ public class DrownFlag extends StateFlagBuilder {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.config.getProperty(Config.drowning_flag);
|
||||
return this.config.getProperty(RootKeys.is_drowning_flag_enabled);
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,12 +1,11 @@
|
||||
package com.ryderbelserion.simpleflags.flags.types;
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.types.entity;
|
||||
|
||||
import com.ryderbelserion.simpleflags.config.impl.Config;
|
||||
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.flags.enums.CustomFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class NaturalFlag extends StateFlagBuilder {
|
||||
|
||||
@@ -27,7 +26,7 @@ public class NaturalFlag extends StateFlagBuilder {
|
||||
return;
|
||||
}
|
||||
|
||||
this.plugin.getLogger().log(Level.WARNING, "An error has occurred registering " + getName() + " flag.", exception);
|
||||
this.logger.warn("An error has occurred registering {} flag. Reason: {}", getName(), exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +42,6 @@ public class NaturalFlag extends StateFlagBuilder {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.config.getProperty(Config.natural_spawning_flag);
|
||||
return this.config.getProperty(RootKeys.is_natural_spawning_flag_enabled);
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.ryderbelserion.simpleflags.paper.api.registry.flags.types.other;
|
||||
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
|
||||
public class FlyFlag extends StateFlagBuilder {
|
||||
|
||||
private StateFlag flag;
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
if (!isEnabled()) return;
|
||||
|
||||
try {
|
||||
getRegistry().register(this.flag = new StateFlag("prevent-flight", true));
|
||||
} catch (FlagConflictException exception) {
|
||||
Flag<?> existingFlag = getRegistry().get("prevent-flight");
|
||||
|
||||
if (existingFlag instanceof StateFlag stateFlag) {
|
||||
this.flag = stateFlag;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.warn("An error has occurred registering {} flag. Reason: {}", getName(), exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return CustomFlags.FLIGHT_FLAG.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StateFlag getFlag() {
|
||||
return this.flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.config.getProperty(RootKeys.is_fly_flag_enabled);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.ryderbelserion.simpleflags.paper.commands;
|
||||
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.ryderbelserion.fusion.kyori.permissions.PermissionContext;
|
||||
import com.ryderbelserion.fusion.paper.builders.commands.context.PaperCommandContext;
|
||||
import com.ryderbelserion.simpleflags.paper.api.SimpleFlagsCommand;
|
||||
import com.ryderbelserion.simpleflags.paper.api.enums.messages.Message;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.command.brigadier.Commands;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
public class BaseCommand extends SimpleFlagsCommand {
|
||||
|
||||
@Override
|
||||
public void run(@NonNull final PaperCommandContext context) {
|
||||
Message.help_menu.sendMessage(context.getSender());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull final LiteralCommandNode<CommandSourceStack> literal() {
|
||||
return Commands.literal("simpleflags").requires(this::requirement).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull final List<PermissionContext> getPermissions() {
|
||||
return List.of(
|
||||
new PermissionContext(
|
||||
"simpleflags.help",
|
||||
"Gives access to /simpleflags help."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean requirement(@NonNull final CommandSourceStack context) {
|
||||
boolean hasPermission = false;
|
||||
|
||||
final CommandSender sender = context.getSender();
|
||||
|
||||
for (final PermissionContext permissionContext : getPermissions()) {
|
||||
final String permission = permissionContext.getPermission();
|
||||
|
||||
hasPermission = sender.hasPermission(permission);
|
||||
|
||||
if (hasPermission) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasPermission;
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.ryderbelserion.simpleflags.paper.commands.types;
|
||||
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.ryderbelserion.fusion.kyori.permissions.PermissionContext;
|
||||
import com.ryderbelserion.fusion.kyori.permissions.enums.PermissionType;
|
||||
import com.ryderbelserion.fusion.paper.builders.commands.context.PaperCommandContext;
|
||||
import com.ryderbelserion.simpleflags.paper.api.SimpleFlagsCommand;
|
||||
import com.ryderbelserion.simpleflags.paper.api.enums.messages.Message;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.command.brigadier.Commands;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
public class ReloadCommand extends SimpleFlagsCommand {
|
||||
|
||||
@Override
|
||||
public void run(@NonNull final PaperCommandContext context) {
|
||||
this.fusion.reload();
|
||||
|
||||
this.configManager.reload();
|
||||
|
||||
Message.reload_plugin.sendMessage(context.getSender());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull final LiteralCommandNode<CommandSourceStack> literal() {
|
||||
return Commands.literal("reload").requires(this::requirement)
|
||||
.executes(context -> {
|
||||
run(new PaperCommandContext(context));
|
||||
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull final List<PermissionContext> getPermissions() {
|
||||
return List.of(
|
||||
new PermissionContext(
|
||||
"simpleflags.reload",
|
||||
"Reloads the plugin!",
|
||||
PermissionType.OP
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean requirement(@NonNull final CommandSourceStack context) {
|
||||
boolean hasPermission = false;
|
||||
|
||||
final CommandSender sender = context.getSender();
|
||||
|
||||
for (final PermissionContext permissionContext : getPermissions()) {
|
||||
final String permission = permissionContext.getPermission();
|
||||
|
||||
hasPermission = sender.hasPermission(permission);
|
||||
|
||||
if (hasPermission) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasPermission;
|
||||
}
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.ryderbelserion.simpleflags.paper.config.impl;
|
||||
|
||||
import com.ryderbelserion.fusion.api.enums.Level;
|
||||
import com.ryderbelserion.fusion.api.objects.FusionKey;
|
||||
import com.ryderbelserion.fusion.core.api.config.ConfigBuilder;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.PropertyManager;
|
||||
import com.ryderbelserion.fusion.core.api.registry.message.MessageRegistry;
|
||||
import com.ryderbelserion.fusion.core.files.FileManager;
|
||||
import com.ryderbelserion.fusion.paper.FusionPaper;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.api.enums.messages.Message;
|
||||
import com.ryderbelserion.simpleflags.paper.config.impl.types.RootKeys;
|
||||
import com.ryderbelserion.simpleflags.paper.api.enums.FileKeys;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.spongepowered.configurate.CommentedConfigurationNode;
|
||||
import org.spongepowered.configurate.loader.HeaderMode;
|
||||
import org.spongepowered.configurate.yaml.NodeStyle;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import static com.ryderbelserion.simpleflags.paper.SimpleFlags.namespace;
|
||||
|
||||
public final class ConfigManager {
|
||||
|
||||
private final SimpleFlags platform = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final MessageRegistry registry = this.platform.getMessageRegistry();
|
||||
|
||||
private final FileManager fileManager = this.platform.getFileManager();
|
||||
|
||||
private final FusionPaper fusion = this.platform.getFusion();
|
||||
|
||||
private final Path path = this.platform.getDataPath();
|
||||
|
||||
private PropertyManager config;
|
||||
|
||||
public void init() {
|
||||
this.config = ConfigBuilder.withYamlPath(this.path.resolve("config.yml"))
|
||||
.configuration(RootKeys.class)
|
||||
.withNodeStyle(NodeStyle.BLOCK)
|
||||
.withHeaderMode(HeaderMode.PRESERVE)
|
||||
.withIndent(1)
|
||||
.create();
|
||||
|
||||
for (final FileKeys key : FileKeys.values()) {
|
||||
key.load();
|
||||
}
|
||||
}
|
||||
|
||||
public void loadMessages() {
|
||||
final List<Path> paths = this.fileManager.getFilesByPath(this.path.resolve("locale"), ".yml");
|
||||
|
||||
paths.add(this.path.resolve("messages.yml")); // add to list
|
||||
|
||||
this.registry.init(action -> {
|
||||
for (final Path path : paths) {
|
||||
this.fileManager.getYamlFile(path).ifPresentOrElse(customFile -> {
|
||||
final String fileName = customFile.getFileName();
|
||||
|
||||
final FusionKey key = FusionKey.key(namespace, fileName.equalsIgnoreCase("messages.yml") ? "default" : fileName.toLowerCase());
|
||||
|
||||
final CommentedConfigurationNode configuration = customFile.getConfiguration();
|
||||
|
||||
for (final Message message : Message.values()) {
|
||||
message.addKey(action, configuration, key);
|
||||
}
|
||||
}, () -> this.fusion.log(Level.info, "Path %s not found in cache.".formatted(path)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
this.config.reload();
|
||||
|
||||
for (final FileKeys key : FileKeys.values()) {
|
||||
key.reload();
|
||||
}
|
||||
|
||||
loadMessages();
|
||||
}
|
||||
|
||||
public @NonNull PropertyManager getConfig() {
|
||||
return this.config;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.ryderbelserion.simpleflags.paper.config.impl.types;
|
||||
|
||||
import com.ryderbelserion.fusion.core.api.config.annotations.Comment;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.builders.CommentsBuilder;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.interfaces.IPropertyHolder;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.objects.interfaces.Property;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.objects.primitives.BooleanProperty;
|
||||
import com.ryderbelserion.fusion.core.api.config.properties.objects.primitives.string.StringProperty;
|
||||
import com.ryderbelserion.simpleflags.paper.api.enums.messages.State;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import java.util.List;
|
||||
import static com.ryderbelserion.fusion.core.api.config.properties.PropertyBuilder.newBeanProperty;
|
||||
import static com.ryderbelserion.fusion.core.api.config.properties.PropertyBuilder.newProperty;
|
||||
|
||||
public class RootKeys implements IPropertyHolder {
|
||||
|
||||
@Override
|
||||
public void registerComments(@NonNull final CommentsBuilder configuration) {
|
||||
final List<String> deprecation = List.of(
|
||||
" ",
|
||||
"Warning: This section is subject to change so it is considered deprecated.",
|
||||
"This is your warning before the change happens. Please read the latest changelogs",
|
||||
" "
|
||||
);
|
||||
|
||||
configuration.setComment(List.of(
|
||||
"Support: https://discord.gg/ktxCyUd7Ny",
|
||||
"Github: https://github.com/ryderbelserion",
|
||||
" ",
|
||||
"Issues: https://github.com/ryderbelserion/SimpleFlags/issues",
|
||||
"Features: https://github.com/ryderbelserion/SimpleFlags/issues",
|
||||
" ",
|
||||
"Sounds: https://mudkipdev.github.io/minecraft-sound-explorer/"
|
||||
), "root");
|
||||
|
||||
configuration.setComment(List.of(
|
||||
"Flags related to the Crafter block."
|
||||
), "flags", "crafter-flag");
|
||||
|
||||
configuration.setComment(List.of(
|
||||
"Configure the flags of the plugin."
|
||||
), "flags");
|
||||
}
|
||||
|
||||
@Comment("The prefix used in commands")
|
||||
public static final StringProperty command_prefix = newProperty(" <gradient:#e91e63:gold>SimpleFlags</gradient> | ", "root", "prefix");
|
||||
|
||||
@Comment({
|
||||
"This option will tell the plugin to send all messages as action bars or messages in chat.",
|
||||
" ",
|
||||
"send_message -> sends messages in chat.",
|
||||
"send_actionbar -> sends messages in actionbar.",
|
||||
" "
|
||||
})
|
||||
public static final Property<State> message_state = newBeanProperty(State.class, State.send_message, "root", "message-state");
|
||||
|
||||
@Comment("This flag prevent-drowning as you guessed it, it prevents drowning if enabled.")
|
||||
public static final BooleanProperty is_drowning_flag_enabled = newProperty(false, "flags", "drowning-flag");
|
||||
|
||||
@Comment("This flag prevent-flight Mr Holmes denies flight in a region if enabled.")
|
||||
public static final BooleanProperty is_fly_flag_enabled = newProperty(false, "flags", "flight-flag");
|
||||
|
||||
@Comment("This flag prevent-crafter-interaction prevents interacting with Crafters.")
|
||||
public static final BooleanProperty is_crafter_interaction_enabled = newProperty(false, "flags", "crafter-flag", "interaction");
|
||||
|
||||
@Comment("This flag prevent-crafter-block prevents placing Crafters.")
|
||||
public static final BooleanProperty is_crafter_place_enabled = newProperty(false, "flags", "crafter-flag", "place");
|
||||
|
||||
@Comment("This flag prevent-natural-spawning prevents natural mob spawns in regions.")
|
||||
public static final BooleanProperty is_natural_spawning_flag_enabled = newProperty(false, "flags", "natural-spawning-flag");
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.ryderbelserion.simpleflags.paper.listeners.block;
|
||||
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class CrafterListener implements Listener {
|
||||
|
||||
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final FlagManager flagManager = this.plugin.getFlagManager();
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPlace(final BlockPlaceEvent event) {
|
||||
final Block block = event.getBlock();
|
||||
|
||||
final Material material = block.getType();
|
||||
|
||||
if (material != Material.CRAFTER) return;
|
||||
|
||||
final String flagName = CustomFlags.CRAFTER_BLOCK_FLAG.getName();
|
||||
|
||||
if (!this.flagManager.hasFlag(flagName)) return;
|
||||
|
||||
final StateFlagBuilder flag = (StateFlagBuilder) this.flagManager.getFlag(flagName);
|
||||
|
||||
if (!flag.isEnabled()) return;
|
||||
|
||||
final StateFlag stateFlag = flag.getFlag();
|
||||
|
||||
if (stateFlag == null) return;
|
||||
|
||||
if (!flag.testLocation(event.getPlayer(), stateFlag)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteractEvent(final PlayerInteractEvent event) {
|
||||
final Block block = event.getClickedBlock();
|
||||
|
||||
if (block == null || block.isEmpty()) return;
|
||||
|
||||
final Material material = block.getType();
|
||||
|
||||
if (material != Material.CRAFTER) return;
|
||||
|
||||
final String flagName = CustomFlags.CRAFTER_INTERACTION_FLAG.getName();
|
||||
|
||||
if (!this.flagManager.hasFlag(flagName)) return;
|
||||
|
||||
final StateFlagBuilder flag = (StateFlagBuilder) this.flagManager.getFlag(flagName);
|
||||
|
||||
if (!flag.isEnabled()) return;
|
||||
|
||||
final StateFlag stateFlag = flag.getFlag();
|
||||
|
||||
if (stateFlag == null) return;
|
||||
|
||||
if (!flag.testLocation(event.getPlayer(), stateFlag)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-6
@@ -1,10 +1,11 @@
|
||||
package com.ryderbelserion.simpleflags.listeners;
|
||||
package com.ryderbelserion.simpleflags.paper.listeners.damage;
|
||||
|
||||
import com.ryderbelserion.simpleflags.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.flags.enums.CustomFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import org.bukkit.damage.DamageSource;
|
||||
import org.bukkit.damage.DamageType;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -37,7 +38,9 @@ public class DrowningListener implements Listener {
|
||||
|
||||
if (stateFlag == null) return;
|
||||
|
||||
if (!flag.preventDamage(player, event.getDamageSource(), DamageType.DROWN, stateFlag)) {
|
||||
final DamageSource source = event.getDamageSource();
|
||||
|
||||
if (!flag.preventDamage(player, source, DamageType.DROWN, stateFlag)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -1,17 +1,17 @@
|
||||
package com.ryderbelserion.simpleflags.listeners;
|
||||
package com.ryderbelserion.simpleflags.paper.listeners.entity;
|
||||
|
||||
import com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent;
|
||||
import com.ryderbelserion.simpleflags.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.flags.enums.CustomFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class NaturalListener implements Listener {
|
||||
public class NaturalSpawnListener implements Listener {
|
||||
|
||||
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.ryderbelserion.simpleflags.paper.listeners.other;
|
||||
|
||||
import com.ryderbelserion.fusion.paper.FusionPaper;
|
||||
import com.ryderbelserion.simpleflags.paper.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.builders.StateFlagBuilder;
|
||||
import com.ryderbelserion.simpleflags.paper.api.registry.flags.enums.CustomFlags;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class FlightStatusListener implements Listener {
|
||||
|
||||
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final FlagManager flagManager = this.plugin.getFlagManager();
|
||||
|
||||
private final FusionPaper fusion = this.plugin.getFusion();
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerToggleFlight(final PlayerToggleFlightEvent event) {
|
||||
this.flagManager.getByFlag(CustomFlags.FLIGHT_FLAG.getName()).ifPresent(index -> {
|
||||
final StateFlagBuilder builder = (StateFlagBuilder) index;
|
||||
|
||||
if (!builder.isEnabled()) return;
|
||||
|
||||
final StateFlag flag = builder.getFlag();
|
||||
|
||||
if (flag == null) return;
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
if (!builder.testLocation(player, flag)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
# Support: https://discord.gg/ktxCyUd7Ny
|
||||
# Github: https://github.com/ryderbelserion
|
||||
|
||||
# Issues: https://github.com/ryderbelserion/SimpleFlags/issues
|
||||
# Features: https://github.com/ryderbelserion/SimpleFlags/issues
|
||||
|
||||
# Sounds: https://mudkipdev.github.io/minecraft-sound-explorer/
|
||||
root:
|
||||
# The prefix that appears in front of messages.
|
||||
prefix: " <gradient:#e91e63:gold>SimpleFlags</gradient> | "
|
||||
# This option will tell the plugin to send all messages as action bars or messages in chat.
|
||||
# send_message -> sends messages in chat.
|
||||
# send_actionbar -> sends messages in actionbar.
|
||||
message-state: "send_message"
|
||||
|
||||
# Configure the flags of the plugin.
|
||||
flags:
|
||||
# This flag prevent-drowning as you guessed it, it prevents drowning if enabled.
|
||||
drowning-flag: false
|
||||
# Flags related to the Crafter block.
|
||||
crafter-flag:
|
||||
# This flag prevent-crafter-interaction prevents interacting with Crafters.
|
||||
interaction: false
|
||||
# This flag prevent-crafter-block prevents placing Crafters.
|
||||
place: false
|
||||
# This flag prevent-natural-spawning prevents natural mob spawns in regions.
|
||||
natural-spawning-flag: false
|
||||
# This flag prevent-flight Mr Holmes denies flight in a region if enabled.
|
||||
flight-flag: false
|
||||
@@ -0,0 +1,10 @@
|
||||
# The start of the messages file!
|
||||
root:
|
||||
# Sent when doing /simpleflags reload
|
||||
reload-plugin: "{prefix}<red>You have reloaded the plugin."
|
||||
# Sent when doing /simpleflags
|
||||
help-menu:
|
||||
- "<red>SimpleFlags Help Menu"
|
||||
- ""
|
||||
- "<red>/simpleflags <gray>- <gold>Shows this menu."
|
||||
- "<red>/simpleflags reload <gray>- <gold>Reloads the plugin."
|
||||
@@ -0,0 +1,25 @@
|
||||
name: '${artifact}'
|
||||
main: '${group}.${artifact}'
|
||||
|
||||
version: '${version}'
|
||||
api-version: '${minecraft}'
|
||||
description: '${description}'
|
||||
|
||||
dependencies:
|
||||
server:
|
||||
# Placeholder plugins
|
||||
PlaceholderAPI:
|
||||
load: BEFORE
|
||||
required: false
|
||||
join-classpath: true
|
||||
|
||||
# Skull plugins
|
||||
HeadDatabase:
|
||||
load: BEFORE
|
||||
required: false
|
||||
join-classpath: true
|
||||
|
||||
WorldGuard:
|
||||
load: AFTER
|
||||
required: true
|
||||
join-classpath: true
|
||||
@@ -1,32 +0,0 @@
|
||||
settings:
|
||||
allow-end: false
|
||||
warn-on-overload: false
|
||||
permissions-file: permissions.yml
|
||||
update-folder: update
|
||||
plugin-profiling: false
|
||||
connection-throttle: 4000
|
||||
query-plugins: false
|
||||
deprecated-verbose: default
|
||||
shutdown-message: Server Closed
|
||||
minimum-api: none
|
||||
use-map-color-cache: true
|
||||
spawn-limits:
|
||||
monsters: 70
|
||||
animals: 10
|
||||
water-animals: 5
|
||||
water-ambient: 20
|
||||
water-underground-creature: 5
|
||||
axolotls: 5
|
||||
ambient: 15
|
||||
chunk-gc:
|
||||
period-in-ticks: 600
|
||||
ticks-per:
|
||||
animal-spawns: 400
|
||||
monster-spawns: 1
|
||||
water-spawns: 1
|
||||
water-ambient-spawns: 1
|
||||
water-underground-creature-spawns: 1
|
||||
axolotl-spawns: 1
|
||||
ambient-spawns: 1
|
||||
autosave: 6000
|
||||
aliases: now-in-commands.yml
|
||||
@@ -1,135 +0,0 @@
|
||||
# This is the global configuration file for Paper.
|
||||
# As you can see, there's a lot to configure. Some options may impact gameplay, so use
|
||||
# with caution, and make sure you know what each option does before configuring.
|
||||
#
|
||||
# If you need help with the configuration or have any questions related to Paper,
|
||||
# join us in our Discord or check the docs page.
|
||||
#
|
||||
# The world configuration options have been moved inside
|
||||
# their respective world folder. The files are named paper-world.yml
|
||||
#
|
||||
# Docs: https://docs.papermc.io/
|
||||
# Discord: https://discord.gg/papermc
|
||||
# Website: https://papermc.io/
|
||||
|
||||
_version: 29
|
||||
block-updates:
|
||||
disable-chorus-plant-updates: false
|
||||
disable-mushroom-block-updates: false
|
||||
disable-noteblock-updates: false
|
||||
disable-tripwire-updates: false
|
||||
chunk-loading-advanced:
|
||||
auto-config-send-distance: true
|
||||
player-max-concurrent-chunk-generates: 0
|
||||
player-max-concurrent-chunk-loads: 0
|
||||
chunk-loading-basic:
|
||||
player-max-chunk-generate-rate: -1.0
|
||||
player-max-chunk-load-rate: 100.0
|
||||
player-max-chunk-send-rate: 75.0
|
||||
chunk-system:
|
||||
gen-parallelism: default
|
||||
io-threads: -1
|
||||
worker-threads: -1
|
||||
collisions:
|
||||
enable-player-collisions: true
|
||||
send-full-pos-for-hard-colliding-entities: true
|
||||
commands:
|
||||
fix-target-selector-tag-completion: true
|
||||
suggest-player-names-when-null-tab-completions: true
|
||||
time-command-affects-all-worlds: false
|
||||
console:
|
||||
enable-brigadier-completions: true
|
||||
enable-brigadier-highlighting: true
|
||||
has-all-permissions: false
|
||||
item-validation:
|
||||
book:
|
||||
author: 8192
|
||||
page: 16384
|
||||
title: 8192
|
||||
book-size:
|
||||
page-max: 2560
|
||||
total-multiplier: 0.98
|
||||
display-name: 8192
|
||||
lore-line: 8192
|
||||
resolve-selectors-in-books: false
|
||||
logging:
|
||||
deobfuscate-stacktraces: true
|
||||
messages:
|
||||
kick:
|
||||
authentication-servers-down: <lang:multiplayer.disconnect.authservers_down>
|
||||
connection-throttle: Connection throttled! Please wait before reconnecting.
|
||||
flying-player: <lang:multiplayer.disconnect.flying>
|
||||
flying-vehicle: <lang:multiplayer.disconnect.flying>
|
||||
no-permission: <red>I'm sorry, but you do not have permission to perform this command.
|
||||
Please contact the server administrators if you believe that this is in error.
|
||||
use-display-name-in-quit-message: false
|
||||
misc:
|
||||
chat-threads:
|
||||
chat-executor-core-size: -1
|
||||
chat-executor-max-size: -1
|
||||
client-interaction-leniency-distance: default
|
||||
compression-level: default
|
||||
fix-entity-position-desync: true
|
||||
load-permissions-yml-before-plugins: true
|
||||
max-joins-per-tick: 5
|
||||
region-file-cache-size: 256
|
||||
strict-advancement-dimension-check: false
|
||||
use-alternative-luck-formula: false
|
||||
use-dimension-type-for-custom-spawners: false
|
||||
packet-limiter:
|
||||
all-packets:
|
||||
action: KICK
|
||||
interval: 7.0
|
||||
max-packet-rate: 500.0
|
||||
kick-message: <red><lang:disconnect.exceeded_packet_rate>
|
||||
overrides:
|
||||
ServerboundPlaceRecipePacket:
|
||||
action: DROP
|
||||
interval: 4.0
|
||||
max-packet-rate: 5.0
|
||||
player-auto-save:
|
||||
max-per-tick: -1
|
||||
rate: -1
|
||||
proxies:
|
||||
bungee-cord:
|
||||
online-mode: false
|
||||
proxy-protocol: false
|
||||
velocity:
|
||||
enabled: false
|
||||
online-mode: false
|
||||
secret: ''
|
||||
scoreboards:
|
||||
save-empty-scoreboard-teams: false
|
||||
track-plugin-scoreboards: false
|
||||
spam-limiter:
|
||||
incoming-packet-threshold: 300
|
||||
recipe-spam-increment: 1
|
||||
recipe-spam-limit: 20
|
||||
tab-spam-increment: 1
|
||||
tab-spam-limit: 500
|
||||
spark:
|
||||
enable-immediately: false
|
||||
enabled: true
|
||||
timings:
|
||||
enabled: false
|
||||
hidden-config-entries:
|
||||
- database
|
||||
- proxies.velocity.secret
|
||||
history-interval: 300
|
||||
history-length: 3600
|
||||
server-name: Unknown Server
|
||||
server-name-privacy: false
|
||||
url: https://timings.aikar.co/
|
||||
verbose: false
|
||||
unsupported-settings:
|
||||
allow-headless-pistons: false
|
||||
allow-permanent-block-break-exploits: false
|
||||
allow-piston-duplication: false
|
||||
allow-tripwire-disarming-exploits: false
|
||||
allow-unsafe-end-portal-teleportation: false
|
||||
compression-format: ZLIB
|
||||
perform-username-validation: true
|
||||
skip-vanilla-damage-tick-when-shield-blocked: false
|
||||
watchdog:
|
||||
early-warning-delay: 10000
|
||||
early-warning-every: 5000
|
||||
@@ -1,322 +0,0 @@
|
||||
# This is the world defaults configuration file for Paper.
|
||||
# As you can see, there's a lot to configure. Some options may impact gameplay, so use
|
||||
# with caution, and make sure you know what each option does before configuring.
|
||||
#
|
||||
# If you need help with the configuration or have any questions related to Paper,
|
||||
# join us in our Discord or check the docs page.
|
||||
#
|
||||
# Configuration options here apply to all worlds, unless you specify overrides inside
|
||||
# the world-specific config file inside each world folder.
|
||||
#
|
||||
# Docs: https://docs.papermc.io/
|
||||
# Discord: https://discord.gg/papermc
|
||||
# Website: https://papermc.io/
|
||||
|
||||
_version: 31
|
||||
anticheat:
|
||||
anti-xray:
|
||||
enabled: false
|
||||
engine-mode: 1
|
||||
hidden-blocks:
|
||||
- copper_ore
|
||||
- deepslate_copper_ore
|
||||
- gold_ore
|
||||
- deepslate_gold_ore
|
||||
- iron_ore
|
||||
- deepslate_iron_ore
|
||||
- coal_ore
|
||||
- deepslate_coal_ore
|
||||
- lapis_ore
|
||||
- deepslate_lapis_ore
|
||||
- mossy_cobblestone
|
||||
- obsidian
|
||||
- chest
|
||||
- diamond_ore
|
||||
- deepslate_diamond_ore
|
||||
- redstone_ore
|
||||
- deepslate_redstone_ore
|
||||
- clay
|
||||
- emerald_ore
|
||||
- deepslate_emerald_ore
|
||||
- ender_chest
|
||||
lava-obscures: false
|
||||
max-block-height: 64
|
||||
replacement-blocks:
|
||||
- stone
|
||||
- oak_planks
|
||||
- deepslate
|
||||
update-radius: 2
|
||||
use-permission: false
|
||||
obfuscation:
|
||||
items:
|
||||
hide-durability: false
|
||||
hide-itemmeta: false
|
||||
hide-itemmeta-with-visual-effects: false
|
||||
chunks:
|
||||
auto-save-interval: default
|
||||
delay-chunk-unloads-by: 10s
|
||||
entity-per-chunk-save-limit:
|
||||
arrow: -1
|
||||
ender_pearl: -1
|
||||
experience_orb: -1
|
||||
fireball: -1
|
||||
small_fireball: -1
|
||||
snowball: -1
|
||||
fixed-chunk-inhabited-time: -1
|
||||
flush-regions-on-save: false
|
||||
max-auto-save-chunks-per-tick: 24
|
||||
prevent-moving-into-unloaded-chunks: false
|
||||
collisions:
|
||||
allow-player-cramming-damage: false
|
||||
allow-vehicle-collisions: true
|
||||
fix-climbing-bypassing-cramming-rule: false
|
||||
max-entity-collisions: 8
|
||||
only-players-collide: false
|
||||
command-blocks:
|
||||
force-follow-perm-level: true
|
||||
permissions-level: 2
|
||||
entities:
|
||||
armor-stands:
|
||||
do-collision-entity-lookups: true
|
||||
tick: true
|
||||
behavior:
|
||||
allow-spider-world-border-climbing: true
|
||||
baby-zombie-movement-modifier: 0.5
|
||||
disable-chest-cat-detection: false
|
||||
disable-creeper-lingering-effect: false
|
||||
disable-player-crits: false
|
||||
door-breaking-difficulty:
|
||||
husk:
|
||||
- HARD
|
||||
vindicator:
|
||||
- NORMAL
|
||||
- HARD
|
||||
zombie:
|
||||
- HARD
|
||||
zombie_villager:
|
||||
- HARD
|
||||
zombified_piglin:
|
||||
- HARD
|
||||
ender-dragons-death-always-places-dragon-egg: false
|
||||
experience-merge-max-value: -1
|
||||
mobs-can-always-pick-up-loot:
|
||||
skeletons: false
|
||||
zombies: false
|
||||
nerf-pigmen-from-nether-portals: false
|
||||
only-merge-items-horizontally: false
|
||||
parrots-are-unaffected-by-player-movement: false
|
||||
phantoms-do-not-spawn-on-creative-players: true
|
||||
phantoms-only-attack-insomniacs: true
|
||||
phantoms-spawn-attempt-max-seconds: 119
|
||||
phantoms-spawn-attempt-min-seconds: 60
|
||||
piglins-guard-chests: true
|
||||
pillager-patrols:
|
||||
disable: false
|
||||
spawn-chance: 0.2
|
||||
spawn-delay:
|
||||
per-player: false
|
||||
ticks: 12000
|
||||
start:
|
||||
day: 5
|
||||
per-player: false
|
||||
player-insomnia-start-ticks: 72000
|
||||
should-remove-dragon: false
|
||||
spawner-nerfed-mobs-should-jump: false
|
||||
zombie-villager-infection-chance: default
|
||||
zombies-target-turtle-eggs: true
|
||||
entities-target-with-follow-range: false
|
||||
markers:
|
||||
tick: true
|
||||
mob-effects:
|
||||
immune-to-wither-effect:
|
||||
wither: true
|
||||
wither-skeleton: true
|
||||
spiders-immune-to-poison-effect: true
|
||||
sniffer:
|
||||
boosted-hatch-time: default
|
||||
hatch-time: default
|
||||
spawning:
|
||||
all-chunks-are-slime-chunks: false
|
||||
alt-item-despawn-rate:
|
||||
enabled: false
|
||||
items:
|
||||
cobblestone: 300
|
||||
count-all-mobs-for-spawning: false
|
||||
creative-arrow-despawn-rate: default
|
||||
despawn-range-shape: ELLIPSOID
|
||||
despawn-ranges:
|
||||
ambient:
|
||||
hard: 128
|
||||
soft: 32
|
||||
axolotls:
|
||||
hard: 128
|
||||
soft: 32
|
||||
creature:
|
||||
hard: 128
|
||||
soft: 32
|
||||
misc:
|
||||
hard: 128
|
||||
soft: 32
|
||||
monster:
|
||||
hard: 128
|
||||
soft: 32
|
||||
underground_water_creature:
|
||||
hard: 128
|
||||
soft: 32
|
||||
water_ambient:
|
||||
hard: 64
|
||||
soft: 32
|
||||
water_creature:
|
||||
hard: 128
|
||||
soft: 32
|
||||
disable-mob-spawner-spawn-egg-transformation: false
|
||||
duplicate-uuid:
|
||||
mode: SAFE_REGEN
|
||||
safe-regen-delete-range: 32
|
||||
filter-bad-tile-entity-nbt-from-falling-blocks: true
|
||||
filtered-entity-tag-nbt-paths:
|
||||
- Pos
|
||||
- Motion
|
||||
- SleepingX
|
||||
- SleepingY
|
||||
- SleepingZ
|
||||
iron-golems-can-spawn-in-air: false
|
||||
monster-spawn-max-light-level: default
|
||||
non-player-arrow-despawn-rate: default
|
||||
per-player-mob-spawns: true
|
||||
scan-for-legacy-ender-dragon: true
|
||||
skeleton-horse-thunder-spawn-chance: default
|
||||
slime-spawn-height:
|
||||
slime-chunk:
|
||||
maximum: 40.0
|
||||
surface-biome:
|
||||
maximum: 70.0
|
||||
minimum: 50.0
|
||||
spawn-limits:
|
||||
ambient: -1
|
||||
axolotls: -1
|
||||
creature: -1
|
||||
monster: -1
|
||||
underground_water_creature: -1
|
||||
water_ambient: -1
|
||||
water_creature: -1
|
||||
ticks-per-spawn:
|
||||
ambient: -1
|
||||
axolotls: -1
|
||||
creature: -1
|
||||
monster: -1
|
||||
underground_water_creature: -1
|
||||
water_ambient: -1
|
||||
water_creature: -1
|
||||
wandering-trader:
|
||||
spawn-chance-failure-increment: 25
|
||||
spawn-chance-max: 75
|
||||
spawn-chance-min: 25
|
||||
spawn-day-length: 24000
|
||||
spawn-minute-length: 1200
|
||||
wateranimal-spawn-height:
|
||||
maximum: default
|
||||
minimum: default
|
||||
tracking-range-y:
|
||||
animal: default
|
||||
display: default
|
||||
enabled: false
|
||||
misc: default
|
||||
monster: default
|
||||
other: default
|
||||
player: default
|
||||
environment:
|
||||
disable-explosion-knockback: false
|
||||
disable-ice-and-snow: false
|
||||
disable-teleportation-suffocation-check: false
|
||||
disable-thunder: false
|
||||
fire-tick-delay: 30
|
||||
frosted-ice:
|
||||
delay:
|
||||
max: 40
|
||||
min: 20
|
||||
enabled: true
|
||||
generate-flat-bedrock: false
|
||||
locate-structures-outside-world-border: false
|
||||
max-block-ticks: 65536
|
||||
max-fluid-ticks: 65536
|
||||
nether-ceiling-void-damage-height: disabled
|
||||
optimize-explosions: false
|
||||
portal-create-radius: 16
|
||||
portal-search-radius: 128
|
||||
portal-search-vanilla-dimension-scaling: true
|
||||
treasure-maps:
|
||||
enabled: true
|
||||
find-already-discovered:
|
||||
loot-tables: default
|
||||
villager-trade: false
|
||||
void-damage-amount: 4.0
|
||||
void-damage-min-build-height-offset: -64.0
|
||||
water-over-lava-flow-speed: 5
|
||||
feature-seeds:
|
||||
generate-random-seeds-for-all: false
|
||||
fishing-time-range:
|
||||
maximum: 600
|
||||
minimum: 100
|
||||
fixes:
|
||||
disable-unloaded-chunk-enderpearl-exploit: true
|
||||
falling-block-height-nerf: disabled
|
||||
fix-items-merging-through-walls: false
|
||||
prevent-tnt-from-moving-in-water: false
|
||||
split-overstacked-loot: true
|
||||
tnt-entity-height-nerf: disabled
|
||||
hopper:
|
||||
cooldown-when-full: true
|
||||
disable-move-event: false
|
||||
ignore-occluding-blocks: false
|
||||
lootables:
|
||||
auto-replenish: false
|
||||
max-refills: -1
|
||||
refresh-max: 2d
|
||||
refresh-min: 12h
|
||||
reset-seed-on-fill: true
|
||||
restrict-player-reloot: true
|
||||
restrict-player-reloot-time: disabled
|
||||
retain-unlooted-shulker-box-loot-table-on-non-player-break: true
|
||||
maps:
|
||||
item-frame-cursor-limit: 128
|
||||
item-frame-cursor-update-interval: 10
|
||||
max-growth-height:
|
||||
bamboo:
|
||||
max: 16
|
||||
min: 11
|
||||
cactus: 3
|
||||
reeds: 3
|
||||
misc:
|
||||
alternate-current-update-order: HORIZONTAL_FIRST_OUTWARD
|
||||
disable-end-credits: false
|
||||
disable-relative-projectile-velocity: false
|
||||
disable-sprint-interruption-on-attack: false
|
||||
light-queue-size: 20
|
||||
max-leash-distance: 10.0
|
||||
redstone-implementation: VANILLA
|
||||
shield-blocking-delay: 5
|
||||
show-sign-click-command-failure-msgs-to-player: false
|
||||
update-pathfinding-on-block-update: true
|
||||
scoreboards:
|
||||
allow-non-player-entities-on-scoreboards: true
|
||||
use-vanilla-world-scoreboard-name-coloring: false
|
||||
spawn:
|
||||
allow-using-signs-inside-spawn-protection: false
|
||||
keep-spawn-loaded: true
|
||||
keep-spawn-loaded-range: 10
|
||||
tick-rates:
|
||||
behavior:
|
||||
villager:
|
||||
validatenearbypoi: -1
|
||||
container-update: 1
|
||||
dry-farmland: 1
|
||||
grass-spread: 1
|
||||
mob-spawner: 1
|
||||
sensor:
|
||||
villager:
|
||||
secondarypoisensor: 40
|
||||
wet-farmland: 1
|
||||
unsupported-settings:
|
||||
disable-world-ticking-when-empty: false
|
||||
fix-invulnerable-end-crystal-exploit: true
|
||||
@@ -1,3 +0,0 @@
|
||||
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA).
|
||||
#Mon Oct 16 20:19:20 EDT 2023
|
||||
eula=true
|
||||
@@ -1,8 +0,0 @@
|
||||
[
|
||||
{
|
||||
"uuid": "45123240-248b-44e3-93c9-5c89093ffaad",
|
||||
"name": "ryderbelserion",
|
||||
"level": 4,
|
||||
"bypassesPlayerLimit": false
|
||||
}
|
||||
]
|
||||
@@ -1,64 +0,0 @@
|
||||
#Minecraft server properties
|
||||
#Mon Oct 14 12:22:12 EDT 2024
|
||||
accepts-transfers=false
|
||||
allow-flight=false
|
||||
allow-nether=false
|
||||
broadcast-console-to-ops=false
|
||||
broadcast-rcon-to-ops=false
|
||||
bug-report-link=
|
||||
debug=false
|
||||
difficulty=peaceful
|
||||
enable-command-block=false
|
||||
enable-jmx-monitoring=false
|
||||
enable-query=false
|
||||
enable-rcon=false
|
||||
enable-status=true
|
||||
enforce-secure-profile=true
|
||||
enforce-whitelist=false
|
||||
entity-broadcast-range-percentage=100
|
||||
force-gamemode=false
|
||||
function-permission-level=2
|
||||
gamemode=survival
|
||||
generate-structures=true
|
||||
generator-settings={}
|
||||
hardcore=false
|
||||
hide-online-players=false
|
||||
initial-disabled-packs=
|
||||
initial-enabled-packs=vanilla
|
||||
level-name=world
|
||||
level-seed=
|
||||
level-type=minecraft\:normal
|
||||
log-ips=false
|
||||
max-chained-neighbor-updates=1000000
|
||||
max-players=5
|
||||
max-tick-time=60000
|
||||
max-world-size=29999984
|
||||
motd=A test server
|
||||
network-compression-threshold=256
|
||||
online-mode=true
|
||||
op-permission-level=4
|
||||
player-idle-timeout=0
|
||||
prevent-proxy-connections=false
|
||||
pvp=true
|
||||
query.port=25565
|
||||
rate-limit=0
|
||||
rcon.password=
|
||||
rcon.port=25575
|
||||
region-file-compression=deflate
|
||||
require-resource-pack=false
|
||||
resource-pack=
|
||||
resource-pack-id=
|
||||
resource-pack-prompt=
|
||||
resource-pack-sha1=
|
||||
server-ip=
|
||||
server-port=25565
|
||||
simulation-distance=10
|
||||
spawn-animals=true
|
||||
spawn-monsters=true
|
||||
spawn-npcs=true
|
||||
spawn-protection=32
|
||||
sync-chunk-writes=false
|
||||
text-filtering-config=
|
||||
use-native-transport=true
|
||||
view-distance=6
|
||||
white-list=false
|
||||
-183
@@ -1,183 +0,0 @@
|
||||
# This is the main configuration file for Spigot.
|
||||
# As you can see, there's tons to configure. Some options may impact gameplay, so use
|
||||
# with caution, and make sure you know what each option does before configuring.
|
||||
# For a reference for any variable inside this file, check out the Spigot wiki at
|
||||
# http://www.spigotmc.org/wiki/spigot-configuration/
|
||||
#
|
||||
# If you need help with the configuration or have any questions related to Spigot,
|
||||
# join us at the Discord or drop by our forums and leave a post.
|
||||
#
|
||||
# Discord: https://www.spigotmc.org/go/discord
|
||||
# Forums: http://www.spigotmc.org/
|
||||
|
||||
settings:
|
||||
debug: false
|
||||
timeout-time: 60
|
||||
restart-on-crash: false
|
||||
restart-script: ./start.sh
|
||||
save-user-cache-on-stop-only: false
|
||||
moved-too-quickly-multiplier: 10.0
|
||||
moved-wrongly-threshold: 0.0625
|
||||
player-shuffle: 0
|
||||
user-cache-size: 1000
|
||||
netty-threads: 4
|
||||
attribute:
|
||||
maxAbsorption:
|
||||
max: 2048.0
|
||||
maxHealth:
|
||||
max: 2048.0
|
||||
movementSpeed:
|
||||
max: 2048.0
|
||||
attackDamage:
|
||||
max: 2048.0
|
||||
log-villager-deaths: false
|
||||
log-named-deaths: false
|
||||
sample-count: 12
|
||||
bungeecord: false
|
||||
messages:
|
||||
restart: Server is restarting
|
||||
whitelist: You are not whitelisted on this server!
|
||||
unknown-command: Unknown command. Type "/help" for help.
|
||||
server-full: The server is full!
|
||||
outdated-client: Outdated client! Please use {0}
|
||||
outdated-server: Outdated server! I'm still on {0}
|
||||
advancements:
|
||||
disable-saving: true
|
||||
disabled:
|
||||
- minecraft:story/disabled
|
||||
commands:
|
||||
silent-commandblock-console: false
|
||||
spam-exclusions:
|
||||
- /skill
|
||||
replace-commands:
|
||||
- setblock
|
||||
- summon
|
||||
- testforblock
|
||||
- tellraw
|
||||
log: true
|
||||
tab-complete: 0
|
||||
send-namespaced: true
|
||||
players:
|
||||
disable-saving: false
|
||||
world-settings:
|
||||
default:
|
||||
unload-frozen-chunks: false
|
||||
seed-trialchambers: 94251327
|
||||
below-zero-generation-in-existing-chunks: true
|
||||
hanging-tick-frequency: 100
|
||||
dragon-death-sound-radius: 0
|
||||
wither-spawn-sound-radius: 0
|
||||
end-portal-sound-radius: 0
|
||||
zombie-aggressive-towards-villager: true
|
||||
entity-activation-range:
|
||||
animals: 32
|
||||
monsters: 32
|
||||
raiders: 48
|
||||
misc: 16
|
||||
water: 16
|
||||
villagers: 32
|
||||
flying-monsters: 32
|
||||
wake-up-inactive:
|
||||
animals-max-per-tick: 4
|
||||
animals-every: 1200
|
||||
animals-for: 100
|
||||
monsters-max-per-tick: 8
|
||||
monsters-every: 400
|
||||
monsters-for: 100
|
||||
villagers-max-per-tick: 4
|
||||
villagers-every: 600
|
||||
villagers-for: 100
|
||||
flying-monsters-max-per-tick: 8
|
||||
flying-monsters-every: 200
|
||||
flying-monsters-for: 100
|
||||
villagers-work-immunity-after: 100
|
||||
villagers-work-immunity-for: 20
|
||||
villagers-active-for-panic: true
|
||||
tick-inactive-villagers: true
|
||||
ignore-spectators: false
|
||||
seed-village: 10387312
|
||||
seed-desert: 14357617
|
||||
seed-igloo: 14357618
|
||||
seed-jungle: 14357619
|
||||
seed-swamp: 14357620
|
||||
seed-monument: 10387313
|
||||
seed-shipwreck: 165745295
|
||||
seed-ocean: 14357621
|
||||
seed-outpost: 165745296
|
||||
seed-endcity: 10387313
|
||||
seed-slime: 987234911
|
||||
seed-nether: 30084232
|
||||
seed-mansion: 10387319
|
||||
seed-fossil: 14357921
|
||||
seed-portal: 34222645
|
||||
seed-ancientcity: 20083232
|
||||
seed-trailruins: 83469867
|
||||
seed-buriedtreasure: 10387320
|
||||
seed-mineshaft: default
|
||||
seed-stronghold: default
|
||||
entity-tracking-range:
|
||||
players: 48
|
||||
animals: 48
|
||||
monsters: 48
|
||||
misc: 32
|
||||
display: 128
|
||||
other: 64
|
||||
ticks-per:
|
||||
hopper-transfer: 8
|
||||
hopper-check: 1
|
||||
hopper-amount: 1
|
||||
hopper-can-load-chunks: false
|
||||
max-tnt-per-tick: 100
|
||||
max-tick-time:
|
||||
tile: 50
|
||||
entity: 50
|
||||
hunger:
|
||||
jump-walk-exhaustion: 0.05
|
||||
jump-sprint-exhaustion: 0.2
|
||||
combat-exhaustion: 0.1
|
||||
regen-exhaustion: 6.0
|
||||
swim-multiplier: 0.01
|
||||
sprint-multiplier: 0.1
|
||||
other-multiplier: 0.0
|
||||
enable-zombie-pigmen-portal-spawns: true
|
||||
thunder-chance: 100000
|
||||
growth:
|
||||
cactus-modifier: 100
|
||||
cane-modifier: 100
|
||||
melon-modifier: 100
|
||||
mushroom-modifier: 100
|
||||
pumpkin-modifier: 100
|
||||
sapling-modifier: 100
|
||||
beetroot-modifier: 100
|
||||
carrot-modifier: 100
|
||||
potato-modifier: 100
|
||||
torchflower-modifier: 100
|
||||
wheat-modifier: 100
|
||||
netherwart-modifier: 100
|
||||
vine-modifier: 100
|
||||
cocoa-modifier: 100
|
||||
bamboo-modifier: 100
|
||||
sweetberry-modifier: 100
|
||||
kelp-modifier: 100
|
||||
twistingvines-modifier: 100
|
||||
weepingvines-modifier: 100
|
||||
cavevines-modifier: 100
|
||||
glowberry-modifier: 100
|
||||
pitcherplant-modifier: 100
|
||||
mob-spawn-range: 8
|
||||
simulation-distance: default
|
||||
merge-radius:
|
||||
item: 2.5
|
||||
exp: 3.0
|
||||
arrow-despawn-rate: 1200
|
||||
trident-despawn-rate: 1200
|
||||
view-distance: default
|
||||
item-despawn-rate: 6000
|
||||
nerf-spawner-mobs: false
|
||||
verbose: false
|
||||
worldeditregentempworld:
|
||||
verbose: false
|
||||
config-version: 12
|
||||
stats:
|
||||
disable-saving: false
|
||||
forced-stats: {}
|
||||
+9
-1
@@ -1 +1,9 @@
|
||||
rootProject.name = "SimpleFlags"
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "SimpleFlags"
|
||||
|
||||
include("paper")
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags;
|
||||
|
||||
import io.papermc.paper.plugin.loader.PluginClasspathBuilder;
|
||||
import io.papermc.paper.plugin.loader.PluginLoader;
|
||||
import io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LibraryLoader implements PluginLoader {
|
||||
|
||||
@Override
|
||||
public void classloader(@NotNull PluginClasspathBuilder classpathBuilder) {
|
||||
MavenLibraryResolver resolver = new MavenLibraryResolver();
|
||||
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("com.ryderbelserion.vital:paper:1.0.6"), null));
|
||||
|
||||
resolver.addRepository(new RemoteRepository.Builder("crazycrew-libraries", "default", "https://repo.crazycrew.us/libraries").build());
|
||||
resolver.addRepository(new RemoteRepository.Builder("paper", "default", "https://repo.papermc.io/repository/maven-public").build());
|
||||
|
||||
classpathBuilder.addLibrary(resolver);
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.ryderbelserion.simpleflags.commands.BaseCommand;
|
||||
import com.ryderbelserion.simpleflags.commands.types.CommandHelp;
|
||||
import com.ryderbelserion.simpleflags.commands.types.CommandReload;
|
||||
import com.ryderbelserion.simpleflags.config.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.flags.FlagManager;
|
||||
import com.ryderbelserion.simpleflags.flags.types.DrownFlag;
|
||||
import com.ryderbelserion.simpleflags.flags.types.NaturalFlag;
|
||||
import com.ryderbelserion.simpleflags.listeners.DrowningListener;
|
||||
import com.ryderbelserion.simpleflags.listeners.NaturalListener;
|
||||
import com.ryderbelserion.vital.paper.Vital;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.regions.RegionContainer;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleFlags extends Vital {
|
||||
|
||||
private WorldGuard worldGuard;
|
||||
|
||||
private FlagManager flagManager;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
ConfigManager.load(getDataFolder());
|
||||
|
||||
this.worldGuard = WorldGuard.getInstance();
|
||||
|
||||
this.flagManager = new FlagManager();
|
||||
|
||||
List.of(
|
||||
new DrownFlag(),
|
||||
new NaturalFlag()
|
||||
).forEach(this.flagManager::addFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getServer().getPluginManager().registerEvents(new NaturalListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new DrowningListener(), this);
|
||||
|
||||
// Register commands.
|
||||
getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
|
||||
LiteralArgumentBuilder<CommandSourceStack> root = new BaseCommand().registerPermission().literal().createBuilder();
|
||||
|
||||
List.of(
|
||||
new CommandReload(),
|
||||
new CommandHelp()
|
||||
).forEach(command -> root.then(command.registerPermission().literal()));
|
||||
|
||||
event.registrar().register(root.build(), "the base command for RedstonePvP");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
public @NotNull WorldGuard getWorldGuard() {
|
||||
return this.worldGuard;
|
||||
}
|
||||
|
||||
public @NotNull RegionContainer getRegions() {
|
||||
return this.worldGuard.getPlatform().getRegionContainer();
|
||||
}
|
||||
|
||||
public @NotNull FlagManager getFlagManager() {
|
||||
return this.flagManager;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags.commands;
|
||||
|
||||
import ch.jalu.configme.SettingsManager;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.ryderbelserion.simpleflags.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.config.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.config.impl.Locale;
|
||||
import com.ryderbelserion.vital.paper.commands.PaperCommand;
|
||||
import com.ryderbelserion.vital.paper.commands.context.PaperCommandInfo;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.command.brigadier.Commands;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class BaseCommand extends PaperCommand {
|
||||
|
||||
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final SettingsManager locale = ConfigManager.getLocale();
|
||||
|
||||
@Override
|
||||
public void execute(final PaperCommandInfo info) {
|
||||
final CommandSender sender = info.getCommandSender();
|
||||
|
||||
this.locale.getProperty(Locale.help).forEach(sender::sendRichMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final String getPermission() {
|
||||
return "simpleflags.help";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final LiteralCommandNode<CommandSourceStack> literal() {
|
||||
final LiteralArgumentBuilder<CommandSourceStack> root = Commands.literal("simpleflags").requires(source -> source.getSender().hasPermission(getPermission()));
|
||||
|
||||
return root.executes(context -> {
|
||||
execute(new PaperCommandInfo(context));
|
||||
|
||||
return com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final PaperCommand registerPermission() {
|
||||
final PluginManager pluginManager = this.plugin.getServer().getPluginManager();
|
||||
|
||||
final Permission permission = pluginManager.getPermission(getPermission());
|
||||
|
||||
if (permission == null) {
|
||||
pluginManager.addPermission(new Permission(getPermission(), PermissionDefault.OP));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags.commands.types;
|
||||
|
||||
import ch.jalu.configme.SettingsManager;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.ryderbelserion.simpleflags.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.config.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.config.impl.Locale;
|
||||
import com.ryderbelserion.vital.paper.commands.PaperCommand;
|
||||
import com.ryderbelserion.vital.paper.commands.context.PaperCommandInfo;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.command.brigadier.Commands;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CommandHelp extends PaperCommand {
|
||||
|
||||
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final SettingsManager locale = ConfigManager.getLocale();
|
||||
|
||||
@Override
|
||||
public void execute(final PaperCommandInfo info) {
|
||||
final CommandSender sender = info.getCommandSender();
|
||||
|
||||
this.locale.getProperty(Locale.help).forEach(sender::sendRichMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final String getPermission() {
|
||||
return "simpleflags.help";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final LiteralCommandNode<CommandSourceStack> literal() {
|
||||
final LiteralArgumentBuilder<CommandSourceStack> root = Commands.literal("help").requires(source -> source.getSender().hasPermission(getPermission()));
|
||||
|
||||
return root.executes(context -> {
|
||||
execute(new PaperCommandInfo(context));
|
||||
|
||||
return com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final PaperCommand registerPermission() {
|
||||
final PluginManager pluginManager = this.plugin.getServer().getPluginManager();
|
||||
|
||||
final Permission permission = pluginManager.getPermission(getPermission());
|
||||
|
||||
if (permission == null) {
|
||||
pluginManager.addPermission(new Permission(getPermission(), PermissionDefault.OP));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags.commands.types;
|
||||
|
||||
import ch.jalu.configme.SettingsManager;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.ryderbelserion.simpleflags.SimpleFlags;
|
||||
import com.ryderbelserion.simpleflags.config.ConfigManager;
|
||||
import com.ryderbelserion.simpleflags.config.impl.Config;
|
||||
import com.ryderbelserion.simpleflags.config.impl.Locale;
|
||||
import com.ryderbelserion.vital.paper.commands.PaperCommand;
|
||||
import com.ryderbelserion.vital.paper.commands.context.PaperCommandInfo;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.command.brigadier.Commands;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CommandReload extends PaperCommand {
|
||||
|
||||
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
|
||||
|
||||
private final SettingsManager config = ConfigManager.getConfig();
|
||||
|
||||
private final SettingsManager locale = ConfigManager.getLocale();
|
||||
|
||||
@Override
|
||||
public void execute(final PaperCommandInfo info) {
|
||||
final CommandSender sender = info.getCommandSender();
|
||||
|
||||
this.config.reload();
|
||||
|
||||
this.locale.reload();
|
||||
|
||||
sender.sendRichMessage(this.locale.getProperty(Locale.reload_plugin).replaceAll("\\{prefix}", this.config.getProperty(Config.command_prefix)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final String getPermission() {
|
||||
return "simpleflags.reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final LiteralCommandNode<CommandSourceStack> literal() {
|
||||
final LiteralArgumentBuilder<CommandSourceStack> root = Commands.literal("reload").requires(source -> source.getSender().hasPermission(getPermission()));
|
||||
|
||||
return root.executes(context -> {
|
||||
execute(new PaperCommandInfo(context));
|
||||
|
||||
return com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull final PaperCommand registerPermission() {
|
||||
final PluginManager pluginManager = this.plugin.getServer().getPluginManager();
|
||||
|
||||
final Permission permission = pluginManager.getPermission(getPermission());
|
||||
|
||||
if (permission == null) {
|
||||
pluginManager.addPermission(new Permission(getPermission(), PermissionDefault.OP));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags.config;
|
||||
|
||||
import ch.jalu.configme.SettingsManager;
|
||||
import ch.jalu.configme.SettingsManagerBuilder;
|
||||
import ch.jalu.configme.resource.YamlFileResourceOptions;
|
||||
import com.ryderbelserion.simpleflags.config.impl.Config;
|
||||
import com.ryderbelserion.simpleflags.config.impl.Locale;
|
||||
import java.io.File;
|
||||
|
||||
public class ConfigManager {
|
||||
|
||||
private static SettingsManager config;
|
||||
private static SettingsManager locale;
|
||||
|
||||
public static void load(final File dataFolder) {
|
||||
// Create config files
|
||||
YamlFileResourceOptions builder = YamlFileResourceOptions.builder().indentationSize(2).build();
|
||||
|
||||
config = SettingsManagerBuilder
|
||||
.withYamlFile(new File(dataFolder, "config.yml"), builder)
|
||||
.useDefaultMigrationService()
|
||||
.configurationData(Config.class)
|
||||
.create();
|
||||
|
||||
locale = SettingsManagerBuilder
|
||||
.withYamlFile(new File(dataFolder, "messages.yml"), builder)
|
||||
.useDefaultMigrationService()
|
||||
.configurationData(Locale.class)
|
||||
.create();
|
||||
}
|
||||
|
||||
public static SettingsManager getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public static SettingsManager getLocale() {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags.config.impl;
|
||||
|
||||
import ch.jalu.configme.Comment;
|
||||
import ch.jalu.configme.SettingsHolder;
|
||||
import ch.jalu.configme.properties.Property;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class Config implements SettingsHolder {
|
||||
|
||||
@Comment("The prefix that appears in front of messages.")
|
||||
public static final Property<String> command_prefix = newProperty("root.prefix", "<gold>[<red>SimpleFlags<gold>]: ");
|
||||
|
||||
@Comment("The flag prevent_drowning as you guessed it, it prevents drowning if enabled.")
|
||||
public static final Property<Boolean> drowning_flag = newProperty("flags.drowning-flag", false);
|
||||
|
||||
@Comment("The flag prevent_natural_spawning prevents natural mob spawns in regions.")
|
||||
public static final Property<Boolean> natural_spawning_flag = newProperty("flags.natural-spawning-flag", false);
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.ryderbelserion.simpleflags.config.impl;
|
||||
|
||||
import ch.jalu.configme.SettingsHolder;
|
||||
import ch.jalu.configme.properties.Property;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class Locale implements SettingsHolder {
|
||||
|
||||
public static final Property<String> reload_plugin = newProperty("root.reload-plugin", "{prefix}<red>You have reloaded the plugin.");
|
||||
|
||||
public static final Property<List<String>> help = newListProperty("root.help-menu", List.of(
|
||||
"<red>SimpleFlags Help Menu",
|
||||
"",
|
||||
" <red>/simpleflags <gray>- <gold>Shows this menu.",
|
||||
" <red>/simpleflags reload <gray>- <gold>Reloads the plugin."
|
||||
));
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
name: '${name}'
|
||||
main: '${group}.${name}'
|
||||
|
||||
version: '${version}'
|
||||
api-version: '${apiVersion}'
|
||||
description: '${description}'
|
||||
|
||||
loader: '${group}.LibraryLoader'
|
||||
|
||||
dependencies:
|
||||
server:
|
||||
WorldGuard:
|
||||
load: AFTER
|
||||
required: true
|
||||
join-classpath: true
|
||||
Reference in new issue
Block a user