11 Commits
Author SHA1 Message Date
Ryder Belserion 28c1fd6d42 Fixed a bug with drowning listener 2026-02-18 16:17:00 -05:00
Ryder Belserion cb0311a524 Rename workflow 2026-01-18 21:59:33 -05:00
Ryder Belserion fa6798aca7 Update to 1.21.11 2026-01-18 21:57:35 -05:00
Ryder Belserion 668a0301c3 Update workflows 2026-01-18 19:52:10 -05:00
Ryder Belserion 1c22bddb81 Update build script 2025-07-20 21:15:02 -04:00
Ryder Belserion e592ef6dff Allow build numbers for the version 2025-04-06 13:27:27 -04:00
Ryder Belserion cf83f64762 Bump gradle version 2025-04-06 13:26:30 -04:00
Ryder Belserion 7ba8b918c0 Bump worldguard version 2025-02-17 11:36:02 -05:00
Ryder Belserion 8675ec5d77 Bump version 2025-02-17 11:26:19 -05:00
Ryder Belserion a0d011e2a3 Add new flags to prevent block placement/interaction 2025-02-17 11:24:33 -05:00
Ryder Belserion 24b711a875 Update LICENSE 2024-12-06 23:04:37 -05:00
46 changed files with 872 additions and 1363 deletions

No files matched your search

+1 -4
View File
@@ -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
+53
View File
@@ -0,0 +1,53 @@
name: Release Build
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]') || !contains(github.event.commits[0].message, 'chore:')"
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build --stacktrace
- name: Publish to Modrinth
run: ./gradlew modrinth --stacktrace
env:
COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>') }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
#- name: Publish to Hangar
# run: ./gradlew publishAllPublicationsToHangar --stacktrace
# env:
# COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>') }}
# HANGAR_KEY: ${{ secrets.HANGAR_TOKEN }}
#- name: Notify Discord
# if: success()
# run: ./gradlew release-build --stacktrace
# env:
# BUILD_WEBHOOK: ${{ secrets.webhook }}
#- name: Build Failure
# if: failure()
# run: ./gradlew failed-build --stacktrace
# env:
# BUILD_WEBHOOK: ${{ secrets.webhook }}
+54
View File
@@ -0,0 +1,54 @@
name: Snapshot Build
on:
workflow_dispatch:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]') || !contains(github.event.commits[0].message, 'chore:')"
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build --stacktrace
- name: Publish to Modrinth
run: ./gradlew modrinth --stacktrace
env:
COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>') }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
#- name: Publish to Hangar
# run: ./gradlew publishAllPublicationsToHangar --stacktrace
# env:
# COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>') }}
# HANGAR_KEY: ${{ secrets.HANGAR_TOKEN }}
#- name: Notify Discord
# if: success()
# run: ./gradlew release-build --stacktrace
# env:
# BUILD_WEBHOOK: ${{ secrets.webhook }}
#- name: Build Failure
# if: failure()
# run: ./gradlew failed-build --stacktrace
# env:
# BUILD_WEBHOOK: ${{ secrets.webhook }}
+11 -11
View File
@@ -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/
-8
View File
@@ -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.
+17 -335
View File
@@ -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.
+111 -68
View File
@@ -1,14 +1,19 @@
plugins {
alias(libs.plugins.runPaper)
alias(libs.plugins.minotaur)
alias(libs.plugins.shadow)
import utils.convertList
import utils.updateMarkdown
`java-library`
plugins {
id("modrinth-plugin")
id("hangar-plugin")
`paper-plugin`
}
rootProject.group = "com.ryderbelserion.simpleflags"
rootProject.version = "1.0.1"
rootProject.description = "A plugin that adds simple worldguard flags."
val git = feather.getGit()
val releaseType = rootProject.ext.get("release_type").toString()
val color = rootProject.property("${releaseType.lowercase()}_color").toString()
val isRelease = releaseType.equals("release", true)
val isAlpha = releaseType.equals("alpha", true)
repositories {
maven("https://repo.papermc.io/repository/maven-public")
@@ -19,89 +24,127 @@ repositories {
}
dependencies {
compileOnly(libs.vital.paper)
implementation(libs.vital.paper)
compileOnly(libs.worldguard)
compileOnly(libs.paper)
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of("21"))
}
feather {
rootDirectory = rootProject.rootDir.toPath()
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
val data = git.getGithubCommit("ryderbelserion/${rootProject.name}")
javadoc {
options.encoding = Charsets.UTF_8.name()
}
val user = data.user
processResources {
filteringCharset = Charsets.UTF_8.name()
}
discord {
webhook {
group(rootProject.name.lowercase())
task("release-build")
assemble {
dependsOn(shadowJar)
if (System.getenv("BUILD_WEBHOOK") != null) {
post(System.getenv("BUILD_WEBHOOK"))
}
doLast {
copy {
from(shadowJar.get())
into(rootProject.projectDir.resolve("jars"))
if (isRelease) {
username(user.getName())
avatar(user.avatar)
} else {
username(rootProject.property("author_name").toString())
avatar(rootProject.property("author_avatar").toString())
}
embeds {
embed {
color(color)
title("A new $releaseType version of ${rootProject.name} is ready!")
//if (isRelease) {
// content("<@&${rootProject.property("discord_role_id").toString()}>")
//}
fields {
field(
"Version ${rootProject.version}",
listOf(
"*Click below to download!*",
"<:modrinth:1115307870473420800> [Modrinth](https://modrinth.com/plugin/${rootProject.name.lowercase()}/version/${rootProject.version})"
).convertList()
)
field(
":bug: Report Bugs",
"https://github.com/${rootProject.property("repository_owner")}/${rootProject.name}/issues"
)
field(
":hammer: Changelog",
rootProject.ext.get("mc_changelog").toString().updateMarkdown()
)
}
}
}
webhook {
group(rootProject.name.lowercase())
task("failed-build")
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.",
inline = true
)
}
}
}
}
}
}
}
shadowJar {
archiveClassifier.set("")
}
tasks {
runServer {
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
jvmArgs("-Dcom.mojang.eula.agree=true")
defaultCharacterEncoding = Charsets.UTF_8.name()
minecraftVersion(libs.versions.minecraft.get())
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name)
versionType.set("release")
versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set(rootProject.version as String)
changelog.set(rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8))
uploadFile.set(shadowJar.get())
gameVersions.set(listOf(libs.versions.minecraft.get()))
loaders.addAll(listOf("purpur", "paper", "folia"))
syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8))
autoAddDependsOn.set(false)
detectLoaders.set(false)
shadowJar {
listOf(
"com.ryderbelserion.vital"
).forEach {
relocate(it, "libs.$it")
}
}
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()
)
filesMatching("paper-plugin.yml") {
expand(props)
configurations.all { //todo() FIX ME later, fucking forced dependencies, give me a fucking break
resolutionStrategy {
force("org.apache.logging.log4j:log4j-bom:2.24.1")
force("com.google.guava:guava:33.3.1-jre")
force("com.google.code.gson:gson:2.11.0")
force("it.unimi.dsi:fastutil:8.5.15")
}
}
}
+16
View File
@@ -0,0 +1,16 @@
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
// Bundled plugins
implementation(libs.bundles.build)
// Paper plugins
implementation(libs.bundles.paper)
}
+9
View File
@@ -0,0 +1,9 @@
rootProject.name = "buildSrc"
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
@@ -0,0 +1,55 @@
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.triumphteam.dev/snapshots/")
maven("https://repo.crazycrew.us/libraries/")
maven("https://repo.crazycrew.us/releases/")
maven("https://jitpack.io/")
mavenCentral()
mavenLocal()
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
processResources {
filteringCharset = Charsets.UTF_8.name()
duplicatesStrategy = DuplicatesStrategy.INCLUDE
inputs.properties(
"name" to rootProject.name,
"version" to rootProject.version,
"description" to rootProject.description.toString(),
"minecraft" to libs.findVersion("minecraft").get(),
"website" to "https://github.com/${rootProject.property("repository_owner")}/${rootProject.name}",
"group" to project.group
)
with(copySpec {
include("*paper-plugin.yml", "*plugin.yml")
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,61 @@
import gradle.kotlin.dsl.accessors._bc702d41505d332776c95ae061891e6e.ext
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
}
hangar("FancyHolograms") {
required = false
}
url("CMI", "https://www.spigotmc.org/resources/cmi-300-commands-insane-kits-portals-essentials-economy-mysql-sqlite-much-more.3742/") {
required = false
}
url("DecentHolograms", "https://modrinth.com/plugin/decentholograms") {
required = false
}
url("ItemsAdder", "https://polymart.org/product/1851/itemsadder") {
required = false
}
url("Oraxen", "https://polymart.org/product/629/oraxen") {
required = false
}
url("Nexo", "https://polymart.org/resource/nexo.6901") {
required = false
}
}
}
}
}
}
@@ -0,0 +1,34 @@
plugins {
id("com.modrinth.minotaur")
id("shared-plugin")
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
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("DecentHolograms")
optional.project("FancyHolograms")
optional.project("PlaceholderAPI")
}
}
@@ -0,0 +1,12 @@
plugins {
id("com.gradleup.shadow")
id("java-plugin")
}
tasks {
shadowJar {
archiveClassifier.set("")
exclude("META-INF/**")
}
}
@@ -0,0 +1,27 @@
plugins {
id("com.ryderbelserion.feather.core")
id("java-plugin") apply false
}
val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
val git = feather.getGit()
val isBeta: Boolean = git.getCurrentBranch() == rootProject.property("beta_branch").toString()
val isAlpha: Boolean = git.getCurrentBranch() == rootProject.property("alpha_branch").toString()
val commitHash: String = git.getCurrentCommitHash().subSequence(0, 7).toString()
val content: String = if (isBeta) "[$commitHash](https://github.com/${rootProject.property("repository_owner")}/${rootProject.name}/commit/$commitHash) ${git.getCurrentCommit()}" else rootProject.file("changelog.md").readText(Charsets.UTF_8)
val minecraft = libs.findVersion("minecraft").get()
rootProject.description = rootProject.property("project_description").toString()
rootProject.version = if (isBeta) "$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", if (isBeta) "beta" else if (isAlpha) "alpha" else "release")
set("mc_changelog", content)
}
+29
View File
@@ -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}**")
} else {
builder.append(it)
}
}
return builder.toString()
}
fun List<String>.convertList(): String {
val builder = StringBuilder(size)
forEach {
builder.append(it).append("\n")
}
return builder.toString()
}
+1
View File
@@ -0,0 +1 @@
- Fixed a bug with drowning listener which canceled all forms of damage as the damage type wasn't properly checked.
+23
View File
@@ -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`
+44
View File
@@ -0,0 +1,44 @@
# 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 api version
api_version = 0.1.0
# The beta branch
beta_branch = dev
# The color for beta builds
beta_color = #ffa347
# The alpha branch
alpha_branch = alpha
# 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 = 929463441159254066
project_description = Adds simple worldguard flags.
project_group = com.ryderbelserion.simpleflags
project_platforms = paper,folia,purpur
project_versions = 1.21.1
project_id = SimpleFlags
+44 -25
View File
@@ -1,38 +1,57 @@
[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
paperweight = "2.0.0-beta.19" # https://github.com/PaperMC/paperweight
paper = "1.21.11-R0.1-SNAPSHOT" # https://github.com/PaperMC/Paper
## Minecraft
minecraft = "1.21.11" # https://minecraft.net
# Vital API
vital-common = "0.0.6"
vital-paper = "1.0.6"
# Gradle Plugins
runPaper = "2.3.0"
minotaur = "2.8.7"
hangar = "0.1.2"
shadow = "8.3.0"
## Gradle Plugins
fix-javadoc = "1.19" # https://github.com/mfnalex/gradle-fix-javadoc-plugin
run-paper = "3.0.2" # https://github.com/jpenilla/run-task
minotaur = "2.8.10" # https://github.com/modrinth/minotaur
feather = "0.4.0" # https://github.com/ryderbelserion/Feather
hangar = "0.1.4" # https://github.com/HangarMC/hangar-publish-plugin
shadow = "9.3.0" # https://github.com/GradleUp/shadow
[libraries]
# Velocity API
velocity = { module = "com.velocitypowered:velocity-api", version.ref = "velocity" }
# https://github.com/PaperMC/paperweight
paperweight = { module = "io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin", version.ref = "paperweight" }
# Mojang API
brigadier = { module = "com.mojang:brigadier", version.ref = "brigadier" }
# https://github.com/ryderbelserion/Feather
feather = { module = "com.ryderbelserion.feather.core:com.ryderbelserion.feather.core.gradle.plugin", version.ref = "feather" }
# Paper API
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
# https://github.com/HangarMC/hangar-publish-plugin
hangar = { module = "io.papermc.hangar-publish-plugin:io.papermc.hangar-publish-plugin.gradle.plugin", version.ref = "hangar" }
worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", version = "7.1.0-SNAPSHOT" }
# 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" }
# WorldGuard API
worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", version = "7.0.15" }
# Vital API
vital-common = { module = "com.ryderbelserion.vital:common", version.ref = "vital-common" }
vital-paper = { module = "com.ryderbelserion.vital:paper", version.ref = "vital-paper" }
vital-paper = { module = "com.ryderbelserion.vital:paper", version.ref = "vital-paper" }
[bundles]
build = [
"minotaur",
"feather",
"hangar",
"shadow"
]
paper = [
"paperweight",
"run-paper"
]
Binary file not shown.
+2 -2
View File
@@ -1,7 +1,7 @@
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.3.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Vendored
+5 -3
View File
@@ -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/HEAD/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
@@ -203,7 +205,7 @@ 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.
Vendored
+12 -10
View File
@@ -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,11 +59,11 @@ 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
-32
View File
@@ -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
-135
View File
@@ -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
-322
View File
@@ -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
-3
View File
@@ -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
-8
View File
@@ -1,8 +0,0 @@
[
{
"uuid": "45123240-248b-44e3-93c9-5c89093ffaad",
"name": "ryderbelserion",
"level": 4,
"bypassesPlayerLimit": false
}
]
-64
View File
@@ -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
View File
@@ -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: {}
@@ -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);
}
}
@@ -6,9 +6,11 @@ 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.CapacityFlag;
import com.ryderbelserion.simpleflags.flags.types.DrownFlag;
import com.ryderbelserion.simpleflags.flags.types.NaturalFlag;
import com.ryderbelserion.simpleflags.flags.types.temporary.BlockCrafterFlag;
import com.ryderbelserion.simpleflags.flags.types.temporary.InteractionCrafterFlag;
import com.ryderbelserion.simpleflags.listeners.BlockListener;
import com.ryderbelserion.simpleflags.listeners.DrowningListener;
import com.ryderbelserion.simpleflags.listeners.NaturalListener;
import com.ryderbelserion.vital.paper.Vital;
@@ -16,6 +18,7 @@ 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.bukkit.plugin.PluginManager;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -37,14 +40,19 @@ public class SimpleFlags extends Vital {
new DrownFlag(),
new NaturalFlag(),
new CapacityFlag()
// temporary
new BlockCrafterFlag(),
new InteractionCrafterFlag()
).forEach(this.flagManager::addFlag);
}
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new NaturalListener(), this);
getServer().getPluginManager().registerEvents(new DrowningListener(), this);
final PluginManager pluginManager = getServer().getPluginManager();
pluginManager.registerEvents(new NaturalListener(), this);
pluginManager.registerEvents(new DrowningListener(), this);
pluginManager.registerEvents(new BlockListener(), this);
// Register commands.
getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
@@ -55,7 +63,7 @@ public class SimpleFlags extends Vital {
new CommandHelp()
).forEach(command -> root.then(command.registerPermission().literal()));
event.registrar().register(root.build(), "the base command for RedstonePvP");
event.registrar().register(root.build(), "the base command for SimpleFlags");
});
}
@@ -2,19 +2,32 @@ package com.ryderbelserion.simpleflags.config.impl;
import ch.jalu.configme.Comment;
import ch.jalu.configme.SettingsHolder;
import ch.jalu.configme.configurationdata.CommentsConfiguration;
import ch.jalu.configme.properties.Property;
import org.jetbrains.annotations.NotNull;
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
public class Config implements SettingsHolder {
@Override
public void registerComments(@NotNull CommentsConfiguration conf) {
conf.setComment("flags.crafter-flag", """
Flags related to the crafter block
""");
}
@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 max_players only allows a set amount of players in a region.")
public static final Property<Boolean> max_players_flag = newProperty("flags.max-players-flag", false);
@Comment("The flag prevent_crafter_interaction prevents interacting with crafters.")
public static final Property<Boolean> crafter_flag_interaction = newProperty("flags.crafter-flag.interaction", false);
@Comment("The flag prevent_crafter_block prevents placing crafters.")
public static final Property<Boolean> crafter_flag_place = newProperty("flags.crafter-flag.place", 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);
@@ -6,26 +6,29 @@ import com.ryderbelserion.simpleflags.config.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<F extends Flag> {
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 SettingsManager config = ConfigManager.getConfig();
public abstract void register();
public abstract String getName();
public abstract F getFlag();
public abstract T getFlag();
public abstract boolean isEnabled();
/**
* @return A query of regions.
*/
public RegionQuery getQuery() {
protected RegionQuery getQuery() {
return this.plugin.getRegions().createQuery();
}
@@ -35,4 +38,5 @@ public abstract class FlagBuilder<F extends Flag> {
protected FlagRegistry getRegistry() {
return this.plugin.getWorldGuard().getFlagRegistry();
}
}
@@ -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) {
@@ -3,6 +3,8 @@ package com.ryderbelserion.simpleflags.flags.enums;
public enum CustomFlags {
NATURAL_FLAG("prevent_natural_spawning"),
CRAFTER_INTERACTION_FLAG("prevent_crafter_interaction"),
CRAFTER_BLOCK_FLAG("prevent_crafter_block"),
DROWN_FLAG("prevent_drowning"),
CAPACITY_FLAG("max_players");
@@ -1,54 +0,0 @@
package com.ryderbelserion.simpleflags.flags.types;
import com.ryderbelserion.simpleflags.config.impl.Config;
import com.ryderbelserion.simpleflags.flags.builders.IntegerFlagBuilder;
import com.ryderbelserion.simpleflags.flags.enums.CustomFlags;
import com.sk89q.worldguard.protection.flags.Flag;
import com.sk89q.worldguard.protection.flags.IntegerFlag;
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
import java.util.logging.Level;
public class CapacityFlag extends IntegerFlagBuilder {
private static final Number[] values = {0, 5, 10, 20};
private IntegerFlag flag;
@Override
public void register() {
if (!isEnabled()) return;
try {
this.flag = new IntegerFlag("max-players");
this.flag.setSuggestedValues(values); //todo() might break in the future
getRegistry().register(this.flag);
} catch (FlagConflictException exception) {
Flag<?> existingFlag = getRegistry().get("max-players");
if (existingFlag instanceof IntegerFlag integerFlag) {
this.flag = integerFlag;
return;
}
this.plugin.getLogger().log(Level.WARNING, "An error has occurred registering " + getName() + " flag.", exception);
}
}
@Override
public String getName() {
return CustomFlags.CAPACITY_FLAG.getName();
}
@Override
public IntegerFlag getFlag() {
return this.flag;
}
@Override
public boolean isEnabled() {
return this.config.getProperty(Config.max_players_flag);
}
}
@@ -6,7 +6,6 @@ import com.ryderbelserion.simpleflags.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());
}
}
@@ -6,7 +6,6 @@ import com.ryderbelserion.simpleflags.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());
}
}
@@ -0,0 +1,47 @@
package com.ryderbelserion.simpleflags.flags.types.temporary;
import com.ryderbelserion.simpleflags.config.impl.Config;
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
import com.ryderbelserion.simpleflags.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(Config.crafter_flag_place);
}
}
@@ -0,0 +1,47 @@
package com.ryderbelserion.simpleflags.flags.types.temporary;
import com.ryderbelserion.simpleflags.config.impl.Config;
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
import com.ryderbelserion.simpleflags.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(Config.crafter_flag_interaction);
}
}
@@ -0,0 +1,73 @@
package com.ryderbelserion.simpleflags.listeners;
import com.ryderbelserion.simpleflags.SimpleFlags;
import com.ryderbelserion.simpleflags.flags.FlagManager;
import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
import com.ryderbelserion.simpleflags.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 BlockListener 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);
}
}
}
@@ -1,43 +0,0 @@
package com.ryderbelserion.simpleflags.listeners;
import com.ryderbelserion.simpleflags.SimpleFlags;
import com.ryderbelserion.simpleflags.flags.builders.IntegerFlagBuilder;
import com.ryderbelserion.simpleflags.flags.FlagManager;
import com.ryderbelserion.simpleflags.flags.enums.CustomFlags;
import com.sk89q.worldguard.protection.flags.IntegerFlag;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class CapacityListener implements Listener {
private final SimpleFlags plugin = JavaPlugin.getPlugin(SimpleFlags.class);
private final FlagManager flagManager = this.plugin.getFlagManager();
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
final Location location = event.getTo();
if (location == event.getFrom()) return; // don't run if they didn't move.
final String flagName = CustomFlags.CAPACITY_FLAG.getName();
if (!this.flagManager.hasFlag(flagName)) return;
final IntegerFlagBuilder flag = (IntegerFlagBuilder) this.flagManager.getFlag(flagName);
if (!flag.isEnabled()) return;
final IntegerFlag integerFlag = flag.getFlag();
if (integerFlag == null) return;
final Player player = event.getPlayer();
final String query = flag.getQuery().queryValue(location, player, integerFlag);
}
}
@@ -5,6 +5,7 @@ import com.ryderbelserion.simpleflags.flags.builders.StateFlagBuilder;
import com.ryderbelserion.simpleflags.flags.FlagManager;
import com.ryderbelserion.simpleflags.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);
}
}
+1 -3
View File
@@ -2,11 +2,9 @@ name: '${name}'
main: '${group}.${name}'
version: '${version}'
api-version: '${apiVersion}'
api-version: '${minecraft}'
description: '${description}'
loader: '${group}.LibraryLoader'
dependencies:
server:
WorldGuard: