Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
537701eeb4
|
||
|
|
05cc6d7038
|
||
|
|
6d92e5e5d9 | ||
|
|
2ee91697fd | ||
|
|
1a87501e75 | ||
|
|
f1ecbddcdc | ||
|
|
72bb096f85 | ||
|
|
018e0c1265 | ||
|
|
383e7752de | ||
|
|
7cc3c4c5d2 | ||
|
|
ecf7b2cb1c | ||
|
|
39272c3e3f | ||
|
|
3fe95d7c36 | ||
|
|
4283964e0b | ||
|
|
23f9ca8350 | ||
|
|
423a552e5b | ||
|
|
b5dc9d45e0 | ||
|
|
55a1857392 | ||
|
|
24b97184cc | ||
|
|
8e10485e89 | ||
|
|
95a766d250 | ||
|
|
75db35d027 | ||
|
|
b698132801 | ||
|
|
a7085b1bc0 |
No files matched your search
@@ -0,0 +1 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -0,0 +1,3 @@
|
||||
# Pull requests request review from the eligible staff team(s).
|
||||
# One approval from either an Admin or Developer satisfies branch protection.
|
||||
* @trueog/Admins @trueog/Developers
|
||||
+3
-1
@@ -91,4 +91,6 @@ $RECYCLE.BIN/
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
*.lnk
|
||||
*.lnk
|
||||
/.gradle/
|
||||
/build/
|
||||
@@ -1,6 +1,5 @@
|
||||
# WorldEditSUI
|
||||
[](https://discord.gg/vGCUzHq)
|
||||
[](https://twitter.com/KennyTVN)
|
||||
|
||||
Sassy Minecraft plugin to show your current WorldEdit selection by displaying particles (which can be greatly customized in the plugin's config).
|
||||
Compared to other server plugins with similar functionality, it aims at a higher performance and lesser memory impact by having a quite simplistic approach to calculating vectors.
|
||||
@@ -9,10 +8,10 @@ You can read up on everything else and see examples on the [**Spigot page**](htt
|
||||
|
||||
## Legacy support
|
||||
This branch supports Minecraft versions from 1.9 upwards.
|
||||
If you want a jar that supports 1.8.4-1.8.9 as well, see the `1.8-support` branch / the [**last release to contain a 1.8 build**](https://github.com/KennyTV/WorldEditSUI/releases/tag/1.6.1).
|
||||
If you want a jar that supports 1.8.4-1.8.9 as well, see the `1.8-support` branch / the [**last release to contain a 1.8 build**](https://github.com/kennytv/WorldEditSUI/releases/tag/1.6.1).
|
||||
|
||||
## Compiling
|
||||
Use Maven to compile the project (`mvn clean package`).
|
||||
Use Maven to compile the project (`mvn package`).
|
||||
|
||||
## Licence
|
||||
This project is licensed under the [GNU General Public License](http://www.gnu.org/licenses/gpl-3.0).
|
||||
@@ -0,0 +1,173 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.kotlin.dsl.provideDelegate
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
id("java-library")
|
||||
id("com.diffplug.spotless") version "7.0.4"
|
||||
id("com.gradleup.shadow") version "8.3.8"
|
||||
id("checkstyle")
|
||||
eclipse
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
vendor.set(JvmVendorSpec.GRAAL_VM)
|
||||
}
|
||||
}
|
||||
|
||||
group = "eu.kennytv.worldeditsui"
|
||||
|
||||
version = "1.7.4"
|
||||
|
||||
val apiVersion = "1.19"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
|
||||
maven { url = uri("https://maven.enginehub.org/repo/") }
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") }
|
||||
maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") }
|
||||
System.getProperty("SELF_MAVEN_LOCAL_REPO")?.let {
|
||||
val dir = file(it)
|
||||
if (dir.isDirectory) {
|
||||
println("Using SELF_MAVEN_LOCAL_REPO at: $it")
|
||||
maven { url = uri("file://${dir.absolutePath}") }
|
||||
} else {
|
||||
logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 for mavenLocal()")
|
||||
mavenLocal()
|
||||
}
|
||||
} ?: logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 for mavenLocal()")
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "eclipse")
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
|
||||
maven { url = uri("https://maven.enginehub.org/repo/") }
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") }
|
||||
maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") }
|
||||
System.getProperty("SELF_MAVEN_LOCAL_REPO")?.let {
|
||||
val dir = file(it)
|
||||
if (dir.isDirectory) {
|
||||
println("Using SELF_MAVEN_LOCAL_REPO at: $it")
|
||||
maven { url = uri("file://${dir.absolutePath}") }
|
||||
} else {
|
||||
logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 for mavenLocal()")
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
project(":worldedit-sui") {
|
||||
apply(plugin = "com.gradleup.shadow")
|
||||
|
||||
dependencies {
|
||||
implementation(project(":we-compat:we-compat-common"))
|
||||
implementation(project(":we-compat:we6-compat"))
|
||||
implementation(project(":we-compat:we7-compat"))
|
||||
implementation("org.bstats:bstats-bukkit:3.0.2")
|
||||
compileOnly("dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT")
|
||||
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.3.0-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:24.0.1")
|
||||
}
|
||||
|
||||
tasks.named<ProcessResources>("processResources") {
|
||||
val props = mapOf("version" to rootProject.version, "apiVersion" to apiVersion)
|
||||
inputs.properties(props)
|
||||
filesMatching("plugin.yml") { expand(props) }
|
||||
from(rootProject.file("LICENSE")) { into("/") }
|
||||
}
|
||||
|
||||
tasks.named<ShadowJar>("shadowJar") {
|
||||
relocate("org.bstats", "eu.kennytv.worldeditsui.lib.bstats")
|
||||
archiveBaseName.set("WorldEditSUI")
|
||||
archiveClassifier.set("")
|
||||
destinationDirectory.set(rootProject.layout.buildDirectory.dir("libs"))
|
||||
minimize()
|
||||
manifest { attributes(mapOf("paperweight-mappings-namespace" to "mojang")) }
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") { manifest { attributes(mapOf("paperweight-mappings-namespace" to "mojang")) } }
|
||||
}
|
||||
|
||||
project(":we-compat") {
|
||||
// aggregator
|
||||
}
|
||||
|
||||
project(":we-compat:we-compat-common") {
|
||||
dependencies {
|
||||
compileOnly("com.sk89q.worldedit:worldedit-bukkit:6.1.4-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:24.0.1")
|
||||
}
|
||||
}
|
||||
|
||||
project(":we-compat:we6-compat") {
|
||||
dependencies {
|
||||
compileOnly(project(":we-compat:we-compat-common"))
|
||||
compileOnly("com.sk89q.worldedit:worldedit-bukkit:6.1.4-SNAPSHOT")
|
||||
compileOnly("com.sk89q:worldguard:6.1.1-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:24.0.1")
|
||||
}
|
||||
}
|
||||
|
||||
project(":we-compat:we7-compat") {
|
||||
dependencies {
|
||||
compileOnly(project(":we-compat:we-compat-common"))
|
||||
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.3.0-SNAPSHOT")
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.9") { exclude(group = "com.sk89q.worldedit") }
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:24.0.1")
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
tasks.withType<AbstractArchiveTask>().configureEach {
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
}
|
||||
|
||||
tasks.jar { archiveClassifier.set("part") }
|
||||
|
||||
tasks.build { dependsOn(tasks.spotlessApply, ":worldedit-sui:shadowJar") }
|
||||
|
||||
subprojects {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("-parameters")
|
||||
options.isFork = true
|
||||
options.encoding = "UTF-8"
|
||||
options.compilerArgs.add("-Xlint:-removal")
|
||||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
java {
|
||||
eclipse().configFile("config/formatter/eclipse-java-formatter.xml")
|
||||
leadingTabsToSpaces()
|
||||
removeUnusedImports()
|
||||
}
|
||||
kotlinGradle {
|
||||
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
|
||||
target("build.gradle.kts", "settings.gradle.kts")
|
||||
}
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "10.18.1"
|
||||
configFile = file("config/checkstyle/checkstyle.xml")
|
||||
isIgnoreFailures = true
|
||||
isShowViolations = true
|
||||
}
|
||||
|
||||
tasks.named("compileJava") { dependsOn("spotlessApply") }
|
||||
|
||||
tasks.named("spotlessCheck") { dependsOn("spotlessApply") }
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
<module name="Checker">
|
||||
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
<property name="severity" value="error"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="FinalLocalVariable"/>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="Indentation">
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
</module>
|
||||
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\borg\.junit\.jupiter\.api\.Assertions\.fail\s*\(\s*"Not yet implemented"\s*\)\s*;"/>
|
||||
<property name="message" value="Remove placeholder fail() and implement the test."/>
|
||||
<property name="ignoreCase" value="true"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="(?<!\w)fail\s*\(\s*"Not yet implemented"\s*\)\s*;"/>
|
||||
<property name="message" value="Remove placeholder fail() and implement the test."/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="23">
|
||||
<profile kind="CodeFormatterProfile" name="TrueOG Network Formatting" version="23">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.javadoc_do_not_separate_block_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case_after_arrow" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_arrows_in_switch_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow" value="20"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
Vendored
BIN
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,251 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# 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/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# 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 -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
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# 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" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * 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" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+94
@@ -0,0 +1,94 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@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 ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
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
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
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=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>worldedit-sui-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.7</version>
|
||||
|
||||
<modules>
|
||||
<module>worldedit-sui</module>
|
||||
<module>we-compat</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<plugin.java>1.8</plugin.java>
|
||||
<maven.compiler.target>${plugin.java}</maven.compiler.target>
|
||||
<maven.compiler.source>${plugin.java}</maven.compiler.source>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>enginehub-repo</id>
|
||||
<url>https://maven.sk89q.com/artifactory/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>19.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.name}-${project.version}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
rootProject.name = "WorldEditSUI"
|
||||
|
||||
include(":worldedit-sui")
|
||||
|
||||
include(":we-compat")
|
||||
|
||||
include(":we-compat:we-compat-common")
|
||||
|
||||
include(":we-compat:we6-compat")
|
||||
|
||||
include(":we-compat:we7-compat")
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>worldedit-sui-parent</artifactId>
|
||||
<version>1.7</version>
|
||||
</parent>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<artifactId>we-compat</artifactId>
|
||||
|
||||
<modules>
|
||||
<module>we-compat-common</module>
|
||||
<module>we6-compat</module>
|
||||
<module>we7-compat</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
/build/
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we-compat</artifactId>
|
||||
<version>1.7</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>we-compat-common</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>6.1.4-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -31,7 +31,7 @@ public enum SelectionType {
|
||||
NONE(null);
|
||||
|
||||
private static final Map<String, SelectionType> TYPES = new HashMap<>();
|
||||
private final String key;
|
||||
private final String key; // WE key, hence the inconsistent naming
|
||||
|
||||
SelectionType(final String key) {
|
||||
this.key = key;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/build/
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we-compat</artifactId>
|
||||
<version>1.7</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>we6-compat</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we-compat-common</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>6.1.4-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<version>6.1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+9
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -41,9 +41,15 @@ public final class ProtectedRegionHelper6 implements ProtectedRegionHelper {
|
||||
@Override
|
||||
public ProtectedRegionWrapper getRegion(final World world, final String regionName) {
|
||||
final RegionManager regionManager = regionContainer.get(world);
|
||||
if (regionManager == null) return null;
|
||||
if (regionManager == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final ProtectedRegion region = regionManager.getRegion(regionName);
|
||||
if (region == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final RegionType type = region.getType();
|
||||
final com.sk89q.worldedit.world.World worldWrapper = new BukkitWorld(world);
|
||||
switch (type) {
|
||||
|
||||
+8
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -24,7 +24,12 @@ import com.sk89q.worldedit.Vector2D;
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.regions.*;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.CylinderRegion;
|
||||
import com.sk89q.worldedit.regions.EllipsoidRegion;
|
||||
import com.sk89q.worldedit.regions.Polygonal2DRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import eu.kennytv.worldeditsui.compat.RegionHelper;
|
||||
import eu.kennytv.worldeditsui.compat.Simple2DVector;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/build/
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we-compat</artifactId>
|
||||
<version>1.7</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>we7-compat</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we-compat-common</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>7.1.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.2-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+9
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -42,9 +42,15 @@ public final class ProtectedRegionHelper7 implements ProtectedRegionHelper {
|
||||
public ProtectedRegionWrapper getRegion(final World world, final String regionName) {
|
||||
final BukkitWorld worldWrapper = new BukkitWorld(world);
|
||||
final RegionManager regionManager = regionContainer.get(worldWrapper);
|
||||
if (regionManager == null) return null;
|
||||
if (regionManager == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final ProtectedRegion region = regionManager.getRegion(regionName);
|
||||
if (region == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final RegionType type = region.getType();
|
||||
switch (type) {
|
||||
case CUBOID:
|
||||
|
||||
+10
-4
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -25,11 +25,17 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.regions.*;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.CylinderRegion;
|
||||
import com.sk89q.worldedit.regions.EllipsoidRegion;
|
||||
import com.sk89q.worldedit.regions.Polygonal2DRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import eu.kennytv.worldeditsui.compat.RegionHelper;
|
||||
import eu.kennytv.worldeditsui.compat.Simple2DVector;
|
||||
import eu.kennytv.worldeditsui.compat.SimpleVector;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.util.List;
|
||||
@@ -108,7 +114,7 @@ public final class RegionHelper7 implements RegionHelper {
|
||||
|
||||
@Override
|
||||
public Material getWand(final WorldEditPlugin plugin) {
|
||||
return Material.getMaterial(plugin.getLocalConfiguration().wandItem.toUpperCase().replace("MINECRAFT:", ""));
|
||||
return Material.getMaterial(plugin.getLocalConfiguration().wandItem.toUpperCase(Locale.ROOT).replace("MINECRAFT:", ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/build/
|
||||
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>worldedit-sui-parent</artifactId>
|
||||
<version>1.7</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>worldedit-sui</artifactId>
|
||||
<name>WorldEditSUI</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we-compat-common</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we6-compat</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.kennytv.worldeditsui</groupId>
|
||||
<artifactId>we7-compat</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>7.1.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -20,6 +20,7 @@ package eu.kennytv.worldeditsui;
|
||||
|
||||
import eu.kennytv.worldeditsui.drawer.base.DrawedType;
|
||||
import eu.kennytv.worldeditsui.util.ParticleData;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@@ -52,11 +53,12 @@ public final class Settings {
|
||||
private int particleSendInterval;
|
||||
private int particleViewDistance;
|
||||
private long expiresAfterMillis;
|
||||
private long maxSelectionSizeToDisplay;
|
||||
private int maxPing;
|
||||
private boolean useMaxSelectionSizeBypassPerm;
|
||||
private boolean cacheLocations;
|
||||
private boolean expiryEnabled;
|
||||
private boolean expireMessage;
|
||||
private boolean updateChecks;
|
||||
private boolean sendParticlesToAll;
|
||||
private boolean persistentToggles;
|
||||
private boolean showByDefault;
|
||||
@@ -80,14 +82,27 @@ public final class Settings {
|
||||
|
||||
public void loadSettings() {
|
||||
final YamlConfiguration config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "config.yml"));
|
||||
wandItem = config.getString("wand", "").toUpperCase().replace("MINECRAFT:", "");
|
||||
wandItem = config.getString("wand", "").toUpperCase(Locale.ROOT).replace("MINECRAFT:", "");
|
||||
|
||||
particleViewDistance = config.getInt("particle-viewdistance", 99);
|
||||
if (particleViewDistance < 1 || particleViewDistance > 500) {
|
||||
plugin.getLogger().warning("To punish you for your deeds of setting the particle viewdistance to an astonishing "
|
||||
+ particleViewDistance + ", it has been set to 2 blocks.");
|
||||
plugin.getLogger().warning("Also, this puppy just died.\n"
|
||||
+ " __\n" +
|
||||
" (___()'`;\n" +
|
||||
" /, /`\n" +
|
||||
" \\\\\"--\\\\");
|
||||
plugin.getLogger().warning("Is this what you wanted?");
|
||||
particleViewDistance = 2;
|
||||
}
|
||||
|
||||
particle = loadParticle(config, "particle", Particle.FLAME);
|
||||
clipboardParticle = loadParticle(config, "clipboard-particle", Particle.VILLAGER_HAPPY);
|
||||
wgRegionParticle = loadParticle(config, "wg-region-particle", Particle.VILLAGER_HAPPY);
|
||||
clipboardParticle = loadParticle(config, "clipboard-particle", Particle.END_ROD);
|
||||
wgRegionParticle = loadParticle(config, "wg-region-particle", Particle.END_ROD);
|
||||
|
||||
maxPing = Math.max(config.getInt("max-ping"), 0);
|
||||
try {
|
||||
maxPing = Math.max(config.getInt("max-ping"), 0);
|
||||
Player.Spigot.class.getDeclaredMethod("getPing");
|
||||
} catch (final NoSuchMethodException ignored) {
|
||||
if (maxPing != 0) {
|
||||
@@ -104,7 +119,7 @@ public final class Settings {
|
||||
}
|
||||
|
||||
othersParticle = loadParticle(sendToAllSection, "others-particle", Particle.FLAME);
|
||||
othersClipboardParticle = loadParticle(sendToAllSection, "others-clipboard-particle", Particle.VILLAGER_HAPPY);
|
||||
othersClipboardParticle = loadParticle(sendToAllSection, "others-clipboard-particle", Particle.END_ROD);
|
||||
|
||||
particlesPerBlock = config.getInt("particles-per-block", 4);
|
||||
if (particlesPerBlock < 0.5 || particlesPerBlock > 5) {
|
||||
@@ -140,24 +155,10 @@ public final class Settings {
|
||||
}
|
||||
|
||||
cacheLocations = config.getBoolean("cache-calculated-positions", true);
|
||||
updateChecks = config.getBoolean("update-checks", true);
|
||||
persistentToggles = config.getBoolean("persistent-toggles");
|
||||
showByDefault = config.getBoolean("show-selection-by-default", true);
|
||||
showClipboardByDefault = config.getBoolean("show-clipboard-by-default");
|
||||
|
||||
particleViewDistance = config.getInt("particle-viewdistance", 99);
|
||||
if (particleViewDistance < 1 || particleViewDistance > 500) {
|
||||
plugin.getLogger().warning("To punish you for your deeds of setting the particle viewdistance to an astonishing "
|
||||
+ particleViewDistance + ", it has been set to 2 blocks.");
|
||||
plugin.getLogger().warning("Also, this puppy just died.\n"
|
||||
+ " __\n" +
|
||||
" (___()'`;\n" +
|
||||
" /, /`\n" +
|
||||
" \\\\\"--\\\\");
|
||||
plugin.getLogger().warning("Is this what you wanted?");
|
||||
particleViewDistance = 2;
|
||||
}
|
||||
|
||||
expiryEnabled = config.getBoolean("particle-expiry.enabled", false);
|
||||
if (expiryEnabled) {
|
||||
expireMessage = config.getBoolean("particle-expiry.expire-message", true);
|
||||
@@ -171,6 +172,9 @@ public final class Settings {
|
||||
}
|
||||
}
|
||||
|
||||
maxSelectionSizeToDisplay = Math.max(config.getLong("max-selection-size-to-display"), 0);
|
||||
useMaxSelectionSizeBypassPerm = config.getBoolean("enable-max-selection-bypass-perm", true);
|
||||
|
||||
if (persistentToggles) {
|
||||
final File file = new File(plugin.getDataFolder(), "userdata.yml");
|
||||
if (!file.exists()) {
|
||||
@@ -201,24 +205,36 @@ public final class Settings {
|
||||
}
|
||||
|
||||
private ParticleData loadParticle(final ConfigurationSection section, final String s, final Particle defaultParticle) {
|
||||
final String particleName = section.getString(s, defaultParticle.name()).toUpperCase().replace("MINECRAFT:", "");
|
||||
final String particleName = section.getString(s, defaultParticle.name()).toUpperCase(Locale.ROOT).replace("MINECRAFT:", "");
|
||||
final Particle particle;
|
||||
try {
|
||||
particle = Particle.valueOf(particleName);
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().warning("Unknown particle for " + s + ": " + particleName.toUpperCase());
|
||||
plugin.getLogger().warning("Switched to default particle: " + defaultParticle);
|
||||
return new ParticleData(defaultParticle, null);
|
||||
return new ParticleData(defaultParticle, particleViewDistance);
|
||||
}
|
||||
|
||||
double speed = 0;
|
||||
double offX = 0;
|
||||
double offY = 0;
|
||||
double offZ = 0;
|
||||
int radius = particleViewDistance;
|
||||
final ConfigurationSection particleSection = section.getConfigurationSection(s + "-data");
|
||||
if (particleSection != null) {
|
||||
speed = Math.max(0, particleSection.getDouble("speed"));
|
||||
offX = particleSection.getDouble("offX");
|
||||
offY = particleSection.getDouble("offY");
|
||||
offZ = particleSection.getDouble("offZ");
|
||||
radius = Math.min(500, Math.max(1, particleSection.getInt("radius", radius))); // TODO warn if radius is too high
|
||||
}
|
||||
try {
|
||||
final Object data = ParticleData.getExtraData(particle, section.getConfigurationSection(s + "-data"));
|
||||
return new ParticleData(particle, data);
|
||||
return new ParticleData(particle, radius, speed, offX, offY, offZ, ParticleData.getExtraData(particle, particleSection));
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().warning("Error loading particle data of " + particleName + " - Missing data? You may read up on how to correctly set its data at the bottom of the plugin's Spigot page.");
|
||||
plugin.getLogger().warning("Falling back to default particle: " + defaultParticle);
|
||||
e.printStackTrace();
|
||||
return new ParticleData(particle, null);
|
||||
return new ParticleData(particle, particleViewDistance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +331,14 @@ public final class Settings {
|
||||
return maxPing;
|
||||
}
|
||||
|
||||
public long getMaxSelectionSizeToDisplay() {
|
||||
return maxSelectionSizeToDisplay;
|
||||
}
|
||||
|
||||
public boolean useMaxSelectionSizeBypassPerm() {
|
||||
return useMaxSelectionSizeBypassPerm;
|
||||
}
|
||||
|
||||
public boolean isExpiryEnabled() {
|
||||
return expiryEnabled;
|
||||
}
|
||||
@@ -323,10 +347,6 @@ public final class Settings {
|
||||
return expireMessage;
|
||||
}
|
||||
|
||||
public boolean hasUpdateChecks() {
|
||||
return updateChecks;
|
||||
}
|
||||
|
||||
public boolean sendParticlesToAll(final DrawedType drawedType) {
|
||||
return sendParticlesToAll && (drawedType == DrawedType.SELECTED || drawedType == DrawedType.CLIPBOARD);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -43,30 +43,26 @@ import eu.kennytv.worldeditsui.drawer.base.DrawedType;
|
||||
import eu.kennytv.worldeditsui.listener.PlayerJoinListener;
|
||||
import eu.kennytv.worldeditsui.listener.PlayerQuitListener;
|
||||
import eu.kennytv.worldeditsui.listener.WESelectionListener;
|
||||
import eu.kennytv.worldeditsui.metrics.MetricsLite;
|
||||
import eu.kennytv.worldeditsui.user.SelectionCache;
|
||||
import eu.kennytv.worldeditsui.user.User;
|
||||
import eu.kennytv.worldeditsui.user.UserManager;
|
||||
import eu.kennytv.worldeditsui.util.Cancellable;
|
||||
import eu.kennytv.worldeditsui.util.CancellableBukkitTask;
|
||||
import eu.kennytv.worldeditsui.util.CancellableScheduledTask;
|
||||
import eu.kennytv.worldeditsui.util.ParticleHelper;
|
||||
import eu.kennytv.worldeditsui.util.Version;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author KennyTV
|
||||
*/
|
||||
public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
|
||||
private static final String PREFIX = "§8[§eWorldEditSUI§8] ";
|
||||
private static final boolean FOLIA = hasClass("io.papermc.paper.threadedregions.scheduler.EntityScheduler");
|
||||
private RegionHelper regionHelper;
|
||||
private ProtectedRegionHelper protectedRegionHelper;
|
||||
private ParticleHelper particleHelper;
|
||||
@@ -74,17 +70,12 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
private Settings settings;
|
||||
private DrawManager drawManager;
|
||||
private WorldEditPlugin worldEditPlugin;
|
||||
private Version version;
|
||||
private Version newestVersion;
|
||||
private int expiryTask = -1;
|
||||
private int persistentTogglesTask = -1;
|
||||
private Cancellable expiryTask;
|
||||
private Cancellable persistentTogglesTask;
|
||||
private boolean worldGuardEnabled;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
version = new Version(getDescription().getVersion());
|
||||
printEnableMessage();
|
||||
|
||||
try {
|
||||
Class.forName("org.bukkit.Particle");
|
||||
} catch (final ClassNotFoundException e) {
|
||||
@@ -93,6 +84,7 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
boolean isWorldEdit7 = true;
|
||||
try {
|
||||
Class.forName("com.sk89q.worldedit.math.Vector2");
|
||||
@@ -101,9 +93,10 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
}
|
||||
|
||||
regionHelper = isWorldEdit7 ? new RegionHelper7() : new RegionHelper6();
|
||||
particleHelper = new ParticleHelper(settings);
|
||||
|
||||
settings = new Settings(this);
|
||||
|
||||
particleHelper = new ParticleHelper(settings);
|
||||
userManager = new UserManager(settings);
|
||||
drawManager = new DrawManager(this);
|
||||
|
||||
@@ -117,7 +110,7 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
// Imagine someone using the server reload command 👀
|
||||
getServer().getOnlinePlayers().forEach(p -> userManager.createUser(p));
|
||||
|
||||
pm.registerEvents(new PlayerJoinListener(this), this);
|
||||
pm.registerEvents(new PlayerJoinListener(userManager), this);
|
||||
pm.registerEvents(new PlayerQuitListener(userManager), this);
|
||||
pm.registerEvents(new WESelectionListener(this), this);
|
||||
|
||||
@@ -126,10 +119,10 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
command.setPermissionMessage(settings.getMessage("noPermission"));
|
||||
|
||||
// Start tasks
|
||||
getServer().getScheduler().runTaskTimerAsynchronously(this, this::updateSelections, settings.getParticleSendInterval(), settings.getParticleSendInterval());
|
||||
checkTasks();
|
||||
runRepeatedAsync(this::updateSelections, settings.getParticleSendInterval(), settings.getParticleSendInterval());
|
||||
reloadTasks();
|
||||
|
||||
new MetricsLite(this);
|
||||
new Metrics(this, 5444);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,80 +133,74 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
getServer().getOnlinePlayers().forEach(player -> userManager.deleteUser(player));
|
||||
}
|
||||
|
||||
private void printEnableMessage() {
|
||||
getLogger().info("Plugin by KennyTV");
|
||||
getServer().getScheduler().runTaskAsynchronously(this, () -> {
|
||||
updateAvailable();
|
||||
final int compare = version.compareTo(newestVersion);
|
||||
if (compare == -1) {
|
||||
getLogger().info("§cNewest version available: §aVersion " + newestVersion + "§c, you're on §a" + version);
|
||||
} else if (compare == 1) {
|
||||
if (version.getTag().equalsIgnoreCase("snapshot")) {
|
||||
getLogger().info("§cYou're running a development version, please report bugs on the Discord server (https://kennytv.eu/discord).");
|
||||
} else {
|
||||
getLogger().info("§cYou're running a version, that doesn't exist! §cN§ai§dc§ee§5!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean updateAvailable() {
|
||||
try {
|
||||
final HttpURLConnection c = (HttpURLConnection) new URL("https://api.spigotmc.org/legacy/update.php?resource=60726").openConnection();
|
||||
final String newVersionString = new BufferedReader(new InputStreamReader(c.getInputStream())).readLine().replaceAll("[a-zA-Z -]", "");
|
||||
final Version newVersion = new Version(newVersionString);
|
||||
if (newVersion.equals(version)) return false;
|
||||
|
||||
newestVersion = newVersion;
|
||||
return version.compareTo(newVersion) == -1;
|
||||
} catch (final Exception ignored) {
|
||||
return false;
|
||||
public Cancellable runRepeatedAsync(final Runnable runnable, final long delay, final long period) {
|
||||
if (FOLIA) {
|
||||
return new CancellableScheduledTask(getServer().getAsyncScheduler().runAtFixedRate(this, scheduledTask -> runnable.run(), delay * 50, period * 50, TimeUnit.MILLISECONDS));
|
||||
} else {
|
||||
return new CancellableBukkitTask(getServer().getScheduler().runTaskTimerAsynchronously(this, runnable, delay, period));
|
||||
}
|
||||
}
|
||||
|
||||
public void checkTasks() {
|
||||
// Start tasks if not already running, or cancel them if one is running but now disabled in the config
|
||||
if (expiryTask == -1 && settings.isExpiryEnabled()) {
|
||||
expiryTask = getServer().getScheduler().runTaskTimer(this, () -> {
|
||||
for (final User user : userManager.getUsers().values()) {
|
||||
if (user.getExpireTimestamp() == 0) continue;
|
||||
if (user.getExpireTimestamp() > System.currentTimeMillis()) continue;
|
||||
public Cancellable runRepeated(final Runnable runnable, final long delay, final long period) {
|
||||
if (FOLIA) {
|
||||
return new CancellableScheduledTask(getServer().getGlobalRegionScheduler().runAtFixedRate(this, task -> runnable.run(), delay, period));
|
||||
} else {
|
||||
return new CancellableBukkitTask(getServer().getScheduler().runTaskTimer(this, runnable, delay, period));
|
||||
}
|
||||
}
|
||||
|
||||
public void reloadTasks() {
|
||||
// Start tasks if not already running, or cancel them if one is running but now disabled in the config
|
||||
if (expiryTask == null && settings.isExpiryEnabled()) {
|
||||
expiryTask = runRepeated(this::expiryTask, 20, 20);
|
||||
} else if (expiryTask != null && !settings.isExpiryEnabled()) {
|
||||
expiryTask.cancel();
|
||||
expiryTask = null;
|
||||
|
||||
user.setExpireTimestamp(0);
|
||||
if (settings.hasExpireMessage()) {
|
||||
getServer().getPlayer(user.getUuid()).sendMessage(settings.getMessage("idled"));
|
||||
}
|
||||
}
|
||||
}, 20, 20).getTaskId();
|
||||
} else if (expiryTask != -1 && !settings.isExpiryEnabled()) {
|
||||
for (final User user : userManager.getUsers().values()) {
|
||||
user.setExpireTimestamp(-1);
|
||||
}
|
||||
getServer().getScheduler().cancelTask(expiryTask);
|
||||
expiryTask = -1;
|
||||
}
|
||||
|
||||
if (persistentTogglesTask == -1 && settings.hasPersistentToggles()) {
|
||||
if (persistentTogglesTask == null && settings.hasPersistentToggles()) {
|
||||
// Check every 15 minutes
|
||||
persistentTogglesTask = getServer().getScheduler().runTaskTimerAsynchronously(this, () -> settings.saveData(), 18000, 18000).getTaskId();
|
||||
} else if (persistentTogglesTask != -1 && !settings.hasPersistentToggles()) {
|
||||
getServer().getScheduler().cancelTask(persistentTogglesTask);
|
||||
persistentTogglesTask = -1;
|
||||
persistentTogglesTask = runRepeatedAsync(() -> settings.saveData(), 18000, 18000);
|
||||
} else if (persistentTogglesTask != null && !settings.hasPersistentToggles()) {
|
||||
persistentTogglesTask.cancel();
|
||||
persistentTogglesTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void expiryTask() {
|
||||
for (final User user : userManager.getUsers().values()) {
|
||||
if (user.getExpireTimestamp() == 0) continue;
|
||||
if (user.getExpireTimestamp() > System.currentTimeMillis()) continue;
|
||||
|
||||
user.setExpireTimestamp(0);
|
||||
if (settings.hasExpireMessage()) {
|
||||
getServer().getPlayer(user.getUuid()).sendMessage(settings.getMessage("idled"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSelections() {
|
||||
for (final Player player : getServer().getOnlinePlayers()) {
|
||||
if (!player.isOnline()) continue;
|
||||
if (!player.isOnline()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final User user = userManager.getUser(player);
|
||||
if (user == null) continue;
|
||||
// Check for sending restrictions
|
||||
if (!user.isSelectionShown() && !user.isClipboardShown()) continue;
|
||||
if (settings.isExpiryEnabled() && user.getExpireTimestamp() == 0)
|
||||
if (user == null) {
|
||||
continue;
|
||||
if (settings.getPermission() != null && !player.hasPermission(settings.getPermission())) continue;
|
||||
if (settings.getMaxPing() != 0 && player.spigot().getPing() > settings.getMaxPing()) continue;
|
||||
}
|
||||
|
||||
// Check for sending restrictions
|
||||
if (!user.isSelectionShown() && !user.isClipboardShown()
|
||||
|| settings.isExpiryEnabled() && user.getExpireTimestamp() == 0
|
||||
|| settings.getPermission() != null && !player.hasPermission(settings.getPermission())
|
||||
|| settings.getMaxPing() != 0 && player.spigot().getPing() > settings.getMaxPing()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final LocalSession session = worldEditPlugin.getSession(player);
|
||||
final RegionSelector selector = session.getRegionSelector(new BukkitWorld(player.getWorld()));
|
||||
@@ -226,42 +213,47 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
|
||||
// Clipboard
|
||||
if (user.isClipboardShown()) {
|
||||
try {
|
||||
final ClipboardHolder holder = session.getClipboard();
|
||||
final Clipboard clipboard = holder.getClipboard();
|
||||
final Location location = player.getLocation();
|
||||
final SimpleVector origin = regionHelper.getOrigin(clipboard);
|
||||
|
||||
// Transform the clipboard if necessary
|
||||
final Transform transform = holder.getTransform();
|
||||
final Region region = transform.isIdentity() ? clipboard.getRegion() : regionHelper.transformAndReShift(holder, clipboard.getRegion());
|
||||
|
||||
// Shift the transformed region relative to the player
|
||||
final Region shiftedRegion = regionHelper.shift(region,
|
||||
location.getBlockX() - origin.getX(), location.getBlockY() - origin.getY(), location.getBlockZ() - origin.getZ());
|
||||
drawManager.getDrawer(SelectionType.CUBOID).draw(player, shiftedRegion, DrawedType.CLIPBOARD);
|
||||
} catch (final EmptyClipboardException ignored) {
|
||||
// Ignore if there's no clipboard
|
||||
}
|
||||
drawClipboard(player, session);
|
||||
}
|
||||
|
||||
// Selection
|
||||
if (user.isSelectionShown()) {
|
||||
final Region region;
|
||||
try {
|
||||
region = selector.getRegion();
|
||||
} catch (final IncompleteRegionException ignored) {
|
||||
// Clear cache if present
|
||||
if (settings.cacheLocations()) {
|
||||
user.clearCache(DrawedType.SELECTED);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
drawSelection(selector, player, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final SelectionType selectionType = SelectionType.fromKey(selector.getTypeName());
|
||||
if (selectionType != null) {
|
||||
drawSelection(player, user, region, selectionType, DrawedType.SELECTED);
|
||||
}
|
||||
private void drawClipboard(final Player player, final LocalSession session) {
|
||||
try {
|
||||
final ClipboardHolder holder = session.getClipboard();
|
||||
final Clipboard clipboard = holder.getClipboard();
|
||||
final Location location = player.getLocation();
|
||||
final SimpleVector origin = regionHelper.getOrigin(clipboard);
|
||||
|
||||
// Transform the clipboard if necessary
|
||||
final Transform transform = holder.getTransform();
|
||||
final Region region = transform.isIdentity() ? clipboard.getRegion() : regionHelper.transformAndReShift(holder, clipboard.getRegion());
|
||||
|
||||
// Shift the transformed region relative to the player
|
||||
final Region shiftedRegion = regionHelper.shift(region,
|
||||
location.getBlockX() - origin.getX(), location.getBlockY() - origin.getY(), location.getBlockZ() - origin.getZ());
|
||||
drawManager.getDrawer(SelectionType.CUBOID).draw(player, shiftedRegion, DrawedType.CLIPBOARD);
|
||||
} catch (final EmptyClipboardException ignored) {
|
||||
// Ignore if there's no clipboard
|
||||
}
|
||||
}
|
||||
|
||||
private void drawSelection(final RegionSelector selector, final Player player, final User user) {
|
||||
try {
|
||||
final Region region = selector.getRegion();
|
||||
final SelectionType selectionType = SelectionType.fromKey(selector.getTypeName());
|
||||
if (selectionType != null) {
|
||||
drawSelection(player, user, region, selectionType, DrawedType.SELECTED);
|
||||
}
|
||||
} catch (final IncompleteRegionException ignored) {
|
||||
// Clear cache if present
|
||||
if (settings.cacheLocations()) {
|
||||
user.clearCache(DrawedType.SELECTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,15 +267,15 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
if (selectionType == cache.getSelectionType()
|
||||
&& cache.getMinimum().equals(minimumPoint) && cache.getMaximum().equals(maximumPoint)) {
|
||||
final Location location = new Location(player.getWorld(), 0, 0, 0);
|
||||
for (final SimpleVector vector : cache.getVectors()) {
|
||||
final List<SimpleVector> vectors = cache.getVectors();
|
||||
for (final SimpleVector vector : vectors) {
|
||||
location.setX(vector.getX());
|
||||
location.setY(vector.getY());
|
||||
location.setZ(vector.getZ());
|
||||
if (settings.sendParticlesToAll(drawedType)) {
|
||||
particleHelper.playEffectToAll(settings.getParticle(drawedType), settings.getOthersParticle(drawedType),
|
||||
location, settings.getParticleViewDistance(), player);
|
||||
particleHelper.playEffectToAll(settings.getParticle(drawedType), settings.getOthersParticle(drawedType), location, player);
|
||||
} else {
|
||||
particleHelper.playEffect(settings.getParticle(drawedType), location, settings.getParticleViewDistance(), player);
|
||||
particleHelper.playEffect(settings.getParticle(drawedType), location, player);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -294,10 +286,10 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
}
|
||||
|
||||
// If there's a new region, reset the cache and recalculate vectors
|
||||
cache.clear();
|
||||
cache.setMinimum(minimumPoint);
|
||||
cache.setMaximum(maximumPoint);
|
||||
cache.setSelectionType(selectionType);
|
||||
cache.getVectors().clear();
|
||||
}
|
||||
|
||||
// Current selection
|
||||
@@ -320,23 +312,11 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
return settings;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return PREFIX;
|
||||
}
|
||||
|
||||
public Version getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public Version getNewestVersion() {
|
||||
return newestVersion;
|
||||
}
|
||||
|
||||
public RegionHelper getRegionHelper() {
|
||||
return regionHelper;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@MonotonicNonNull
|
||||
public ProtectedRegionHelper getProtectedRegionHelper() {
|
||||
return protectedRegionHelper;
|
||||
}
|
||||
@@ -348,4 +328,13 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
public boolean isWorldGuardEnabled() {
|
||||
return worldGuardEnabled;
|
||||
}
|
||||
|
||||
private static boolean hasClass(final String className) {
|
||||
try {
|
||||
Class.forName(className);
|
||||
return true;
|
||||
} catch (final ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -23,6 +23,7 @@ import eu.kennytv.worldeditsui.WorldEditSUIPlugin;
|
||||
import eu.kennytv.worldeditsui.compat.ProtectedRegionWrapper;
|
||||
import eu.kennytv.worldeditsui.drawer.base.DrawedType;
|
||||
import eu.kennytv.worldeditsui.user.User;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -49,7 +50,7 @@ public final class WESUICommand implements CommandExecutor, TabCompleter {
|
||||
@Override
|
||||
public boolean onCommand(@NotNull final CommandSender sender, @NotNull final Command cmd, @NotNull final String s, @NotNull final String[] args) {
|
||||
if (args.length == 1) {
|
||||
final String arg = args[0].toLowerCase();
|
||||
final String arg = args[0].toLowerCase(Locale.ROOT);
|
||||
switch (arg) {
|
||||
case "toggle": {
|
||||
if (!(sender instanceof Player)) return true;
|
||||
@@ -91,7 +92,7 @@ public final class WESUICommand implements CommandExecutor, TabCompleter {
|
||||
settings.loadLanguageFile();
|
||||
// Empty cache to recalculate positions
|
||||
plugin.getUserManager().getUsers().values().forEach(User::clearCaches);
|
||||
plugin.checkTasks();
|
||||
plugin.reloadTasks();
|
||||
sender.sendMessage(getMessage("reload"));
|
||||
// Reset Bukkit's no perm message for the command
|
||||
plugin.getCommand("worldeditsui").setPermissionMessage(settings.getMessage("noPermission"));
|
||||
@@ -152,7 +153,7 @@ public final class WESUICommand implements CommandExecutor, TabCompleter {
|
||||
sender.sendMessage(getMessage("helpToggleClipboard"));
|
||||
if (plugin.isWorldGuardEnabled() && sender.hasPermission("wesui.command.showregion"))
|
||||
sender.sendMessage(getMessage("helpShowRegion"));
|
||||
sender.sendMessage("§8× §eVersion " + plugin.getVersion() + " §7by §bKennyTV");
|
||||
sender.sendMessage("§8× §eVersion " + plugin.getDescription().getVersion() + " §7by §bkennytv");
|
||||
sender.sendMessage(getMessage("helpHeader"));
|
||||
sender.sendMessage("");
|
||||
}
|
||||
@@ -169,7 +170,7 @@ public final class WESUICommand implements CommandExecutor, TabCompleter {
|
||||
public List<String> onTabComplete(@NotNull final CommandSender sender, @NotNull final Command cmd, @NotNull final String s, @NotNull final String[] args) {
|
||||
if (!sender.hasPermission("wesui.command")) return Collections.emptyList();
|
||||
if (args.length == 1) {
|
||||
final String arg = args[0].toLowerCase();
|
||||
final String arg = args[0].toLowerCase(Locale.ROOT);
|
||||
final List<String> list = new ArrayList<>();
|
||||
checkString(sender, arg, "reload", list);
|
||||
checkString(sender, arg, "toggle", list);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -35,6 +35,8 @@ public final class CuboidDrawer extends DrawerBase {
|
||||
|
||||
@Override
|
||||
public void draw(final Player player, final Region region, final DrawedType drawedType) {
|
||||
if (!hasValidSize(player, region)) return;
|
||||
|
||||
final double width = region.getWidth();
|
||||
final double length = region.getLength();
|
||||
final double height = region.getHeight();
|
||||
@@ -50,9 +52,9 @@ public final class CuboidDrawer extends DrawerBase {
|
||||
int gridSpaceZ = 0;
|
||||
int topGridSpace = 0;
|
||||
if (settings.hasAdvancedGrid(drawedType)) {
|
||||
gridSpaceX = settings.getParticlesPerBlock() * ((int) ((width * height) / AREA_FACTOR) + 1);
|
||||
gridSpaceZ = settings.getParticlesPerBlock() * ((int) ((length * height) / AREA_FACTOR) + 1);
|
||||
topGridSpace = settings.getParticlesPerBlock() * ((int) ((width * length) / AREA_FACTOR) + 1);
|
||||
gridSpaceX = settings.getParticlesPerBlock() * checkSpace(((int) ((width * height) / AREA_FACTOR) + 1));
|
||||
gridSpaceZ = settings.getParticlesPerBlock() * checkSpace(((int) ((length * height) / AREA_FACTOR) + 1));
|
||||
topGridSpace = settings.getParticlesPerBlock() * checkSpace(((int) ((width * length) / AREA_FACTOR) + 1));
|
||||
maxGridTicks = height * settings.getParticlesPerGridBlock(drawedType) - 1;
|
||||
maxTopGridTicksX = length * settings.getParticlesPerGridBlock(drawedType) - 1;
|
||||
maxTopGridTicksZ = width * settings.getParticlesPerGridBlock(drawedType) - 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -36,6 +36,8 @@ public final class CylinderDrawer extends DrawerBase {
|
||||
|
||||
@Override
|
||||
public void draw(final Player player, final Region region, final DrawedType drawedType) {
|
||||
if (!hasValidSize(player, region)) return;
|
||||
|
||||
final SimpleVector radius = plugin.getRegionHelper().getRadius((CylinderRegion) region, 1.3, 1.3);
|
||||
final int width = (int) radius.getX();
|
||||
final int length = (int) radius.getZ();
|
||||
@@ -65,7 +67,7 @@ public final class CylinderDrawer extends DrawerBase {
|
||||
final double x = location.getX();
|
||||
final double z = location.getZ();
|
||||
final double bottom = location.getY();
|
||||
final int gap = settings.getParticlesPerBlock() * (((width * length) / AREA_FACTOR) + 1);
|
||||
final int gap = checkSpace(settings.getParticlesPerBlock() * (((width * length) / AREA_FACTOR) + 1));
|
||||
final int ticks = 2 * (width - 1) / gap;
|
||||
if (xAxis) {
|
||||
location.setX(location.getX() - width);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package eu.kennytv.worldeditsui.drawer;
|
||||
|
||||
import eu.kennytv.worldeditsui.compat.SelectionType;
|
||||
import eu.kennytv.worldeditsui.WorldEditSUIPlugin;
|
||||
import eu.kennytv.worldeditsui.compat.SelectionType;
|
||||
import eu.kennytv.worldeditsui.drawer.base.Drawer;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -35,6 +35,8 @@ public final class EllipsoidDrawer extends DrawerBase {
|
||||
|
||||
@Override
|
||||
public void draw(final Player player, final Region region, final DrawedType drawedType) {
|
||||
if (!hasValidSize(player, region)) return;
|
||||
|
||||
final SimpleVector radius = plugin.getRegionHelper().getRadius((EllipsoidRegion) region, 1.5, 1.4, 1.5);
|
||||
final int width = (int) radius.getX();
|
||||
final int length = (int) radius.getZ();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -36,6 +36,8 @@ public final class PolygonalDrawer extends DrawerBase {
|
||||
|
||||
@Override
|
||||
public void draw(final Player player, final Region region, final DrawedType drawedType) {
|
||||
if (!hasValidSize(player, region)) return;
|
||||
|
||||
final Polygonal2DRegion polyRegion = (Polygonal2DRegion) region;
|
||||
final Simple2DVector[] points = plugin.getRegionHelper().getPoints(polyRegion);
|
||||
Simple2DVector last = points[0];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -20,7 +20,6 @@ package eu.kennytv.worldeditsui.drawer.base;
|
||||
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface Drawer {
|
||||
|
||||
@@ -33,7 +32,7 @@ public interface Drawer {
|
||||
* @param region region to be displayed with particles
|
||||
* @param drawedType drawed type
|
||||
*/
|
||||
void draw(@Nullable Player player, Region region, DrawedType drawedType);
|
||||
void draw(Player player, Region region, DrawedType drawedType);
|
||||
|
||||
/**
|
||||
* Recreates the given with particles.
|
||||
@@ -43,7 +42,7 @@ public interface Drawer {
|
||||
* @param player player to send the particles to, may be null when sent to all players
|
||||
* @param region region to be displayed with particles
|
||||
*/
|
||||
default void draw(@Nullable final Player player, final Region region) {
|
||||
default void draw(final Player player, final Region region) {
|
||||
draw(player, region, DrawedType.SELECTED);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package eu.kennytv.worldeditsui.drawer.base;
|
||||
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import eu.kennytv.worldeditsui.Settings;
|
||||
import eu.kennytv.worldeditsui.WorldEditSUIPlugin;
|
||||
import eu.kennytv.worldeditsui.compat.SimpleVector;
|
||||
@@ -29,6 +30,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public abstract class DrawerBase implements Drawer {
|
||||
|
||||
protected static final int MAX_GAP = 30;
|
||||
protected static final int AREA_FACTOR = 256;
|
||||
protected final WorldEditSUIPlugin plugin;
|
||||
protected final Settings settings;
|
||||
@@ -38,6 +40,12 @@ public abstract class DrawerBase implements Drawer {
|
||||
this.settings = plugin.getSettings();
|
||||
}
|
||||
|
||||
protected boolean hasValidSize(final Player player, final Region region) {
|
||||
if (settings.getMaxSelectionSizeToDisplay() == 0) return true;
|
||||
return region.getArea() <= settings.getMaxSelectionSizeToDisplay()
|
||||
|| (settings.useMaxSelectionSizeBypassPerm() && player.hasPermission("wesui.maxselectionsize.bypass"));
|
||||
}
|
||||
|
||||
protected void playEffect(final Location location, final Player player) {
|
||||
playEffect(location, player, DrawedType.SELECTED);
|
||||
}
|
||||
@@ -54,9 +62,13 @@ public abstract class DrawerBase implements Drawer {
|
||||
final ParticleData particle = settings.getParticle(drawedType);
|
||||
if (settings.sendParticlesToAll(drawedType)) {
|
||||
final ParticleData othersParticle = settings.getOthersParticle(drawedType);
|
||||
plugin.getParticleHelper().playEffectToAll(particle, othersParticle, location, settings.getParticleViewDistance(), player);
|
||||
plugin.getParticleHelper().playEffectToAll(particle, othersParticle, location, player);
|
||||
} else {
|
||||
plugin.getParticleHelper().playEffect(particle, location, settings.getParticleViewDistance(), player);
|
||||
plugin.getParticleHelper().playEffect(particle, location, player);
|
||||
}
|
||||
}
|
||||
|
||||
protected int checkSpace(final int gap) {
|
||||
return Math.min(gap, MAX_GAP);
|
||||
}
|
||||
}
|
||||
+7
-43
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -18,57 +18,21 @@
|
||||
|
||||
package eu.kennytv.worldeditsui.listener;
|
||||
|
||||
import eu.kennytv.worldeditsui.WorldEditSUIPlugin;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
import eu.kennytv.worldeditsui.user.UserManager;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class PlayerJoinListener implements Listener {
|
||||
|
||||
private final Set<UUID> notified = new HashSet<>();
|
||||
private final WorldEditSUIPlugin plugin;
|
||||
private final UserManager userManager;
|
||||
|
||||
public PlayerJoinListener(final WorldEditSUIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
public PlayerJoinListener(final UserManager userManager) {
|
||||
this.userManager = userManager;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void playerJoin(final PlayerJoinEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
plugin.getUserManager().createUser(player);
|
||||
if (!plugin.getSettings().hasUpdateChecks()) return;
|
||||
if (!player.hasPermission("worldeditsui.admin")) return;
|
||||
if (notified.contains(player.getUniqueId())) return;
|
||||
|
||||
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if (!plugin.updateAvailable()) return;
|
||||
if (!player.isOnline()) return;
|
||||
|
||||
player.sendMessage(plugin.getPrefix() + "§cThere is a newer version available: §aVersion " + plugin.getNewestVersion() + "§c, you're on §a" + plugin.getDescription().getVersion());
|
||||
notified.add(player.getUniqueId());
|
||||
|
||||
try {
|
||||
final TextComponent tc1 = new TextComponent(TextComponent.fromLegacyText(plugin.getPrefix()));
|
||||
final TextComponent tc2 = new TextComponent(TextComponent.fromLegacyText("§cDownload it at: §6https://www.spigotmc.org/resources/worldeditsui.60726/"));
|
||||
final TextComponent click = new TextComponent(TextComponent.fromLegacyText(" §7§l§o(CLICK ME)"));
|
||||
click.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.spigotmc.org/resources/worldeditsui.60726/"));
|
||||
click.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aDownload the latest version").create()));
|
||||
tc1.addExtra(tc2);
|
||||
tc1.addExtra(click);
|
||||
|
||||
player.spigot().sendMessage(tc1);
|
||||
} catch (final Exception e) {
|
||||
player.sendMessage(plugin.getPrefix() + "§cDownload it at: §6https://www.spigotmc.org/resources/worldeditsui.60726/");
|
||||
}
|
||||
});
|
||||
userManager.createUser(event.getPlayer());
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -22,6 +22,7 @@ import com.google.common.collect.Sets;
|
||||
import com.sk89q.worldedit.event.platform.CommandEvent;
|
||||
import com.sk89q.worldedit.util.eventbus.Subscribe;
|
||||
import eu.kennytv.worldeditsui.WorldEditSUIPlugin;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -94,7 +95,7 @@ public final class WESelectionListener implements Listener {
|
||||
|
||||
if (arguments.isEmpty()) return;
|
||||
|
||||
final String command = arguments.split(" ", 2)[0].toLowerCase();
|
||||
final String command = arguments.split(" ", 2)[0].toLowerCase(Locale.ROOT);
|
||||
if (weCommands.stream().noneMatch(command::equals)) return;
|
||||
|
||||
final UUID uuid = event.getActor().getUniqueId();
|
||||
|
||||
@@ -1,254 +0,0 @@
|
||||
package eu.kennytv.worldeditsui.metrics;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.ServicePriority;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
/**
|
||||
* bStats collects some data for plugin authors.
|
||||
* <p>
|
||||
* Check out https://bStats.org/ to learn more about bStats!
|
||||
*/
|
||||
public final class MetricsLite {
|
||||
|
||||
public static final int B_STATS_VERSION = 1;
|
||||
private static final int PLUGIN_ID = 5444;
|
||||
private static final String URL = "https://bStats.org/submitData/bukkit";
|
||||
private final boolean enabled;
|
||||
private static boolean logFailedRequests;
|
||||
private static boolean logSentData;
|
||||
private static boolean logResponseStatusText;
|
||||
private static String serverUUID;
|
||||
private final Plugin plugin;
|
||||
|
||||
public MetricsLite(final Plugin plugin) {
|
||||
if (plugin == null) {
|
||||
throw new IllegalArgumentException("Plugin cannot be null!");
|
||||
}
|
||||
this.plugin = plugin;
|
||||
|
||||
final File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
||||
final File configFile = new File(bStatsFolder, "config.yml");
|
||||
final YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
|
||||
|
||||
if (!config.isSet("serverUuid")) {
|
||||
config.addDefault("enabled", true);
|
||||
config.addDefault("serverUuid", UUID.randomUUID().toString());
|
||||
config.addDefault("logFailedRequests", false);
|
||||
config.addDefault("logSentData", false);
|
||||
config.addDefault("logResponseStatusText", false);
|
||||
|
||||
config.options().header(
|
||||
"bStats collects some data for plugin authors like how many servers are using their plugins.\n" +
|
||||
"To honor their work, you should not disable it.\n" +
|
||||
"This has nearly no effect on the server performance!\n" +
|
||||
"Check out https://bStats.org/ to learn more :)"
|
||||
).copyDefaults(true);
|
||||
try {
|
||||
config.save(configFile);
|
||||
} catch (final IOException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
serverUUID = config.getString("serverUuid");
|
||||
logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
enabled = config.getBoolean("enabled", true);
|
||||
logSentData = config.getBoolean("logSentData", false);
|
||||
logResponseStatusText = config.getBoolean("logResponseStatusText", false);
|
||||
if (enabled) {
|
||||
boolean found = false;
|
||||
for (final Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
|
||||
try {
|
||||
service.getField("B_STATS_VERSION");
|
||||
found = true;
|
||||
break;
|
||||
} catch (final NoSuchFieldException ignored) {
|
||||
}
|
||||
}
|
||||
Bukkit.getServicesManager().register(MetricsLite.class, this, plugin, ServicePriority.Normal);
|
||||
if (!found) {
|
||||
startSubmitting();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
private void startSubmitting() {
|
||||
final Timer timer = new Timer(true);
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!plugin.isEnabled()) { // Plugin was disabled
|
||||
timer.cancel();
|
||||
return;
|
||||
}
|
||||
Bukkit.getScheduler().runTask(plugin, () -> submitData());
|
||||
}
|
||||
}, 1000 * 60 * 5, 1000 * 60 * 30);
|
||||
}
|
||||
|
||||
public JsonObject getPluginData() {
|
||||
final JsonObject data = new JsonObject();
|
||||
|
||||
final String pluginName = plugin.getDescription().getName();
|
||||
final String pluginVersion = plugin.getDescription().getVersion();
|
||||
|
||||
data.addProperty("pluginName", pluginName);
|
||||
data.addProperty("id", PLUGIN_ID);
|
||||
data.addProperty("pluginVersion", pluginVersion);
|
||||
data.add("customCharts", new JsonArray());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private JsonObject getServerData() {
|
||||
final int playerAmount = Bukkit.getOnlinePlayers().size();
|
||||
final int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
|
||||
final String bukkitVersion = Bukkit.getVersion();
|
||||
final String bukkitName = Bukkit.getName();
|
||||
|
||||
final String javaVersion = System.getProperty("java.version");
|
||||
final String osName = System.getProperty("os.name");
|
||||
final String osArch = System.getProperty("os.arch");
|
||||
final String osVersion = System.getProperty("os.version");
|
||||
final int coreCount = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
final JsonObject data = new JsonObject();
|
||||
|
||||
data.addProperty("serverUUID", serverUUID);
|
||||
|
||||
data.addProperty("playerAmount", playerAmount);
|
||||
data.addProperty("onlineMode", onlineMode);
|
||||
data.addProperty("bukkitVersion", bukkitVersion);
|
||||
data.addProperty("bukkitName", bukkitName);
|
||||
|
||||
data.addProperty("javaVersion", javaVersion);
|
||||
data.addProperty("osName", osName);
|
||||
data.addProperty("osArch", osArch);
|
||||
data.addProperty("osVersion", osVersion);
|
||||
data.addProperty("coreCount", coreCount);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private void submitData() {
|
||||
final JsonObject data = getServerData();
|
||||
|
||||
final JsonArray pluginData = new JsonArray();
|
||||
for (final Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
|
||||
try {
|
||||
service.getField("B_STATS_VERSION");
|
||||
|
||||
for (final RegisteredServiceProvider<?> provider : Bukkit.getServicesManager().getRegistrations(service)) {
|
||||
try {
|
||||
final Object plugin = provider.getService().getMethod("getPluginData").invoke(provider.getProvider());
|
||||
if (plugin instanceof JsonObject) {
|
||||
pluginData.add((JsonObject) plugin);
|
||||
} else {
|
||||
try {
|
||||
final Class<?> jsonObjectJsonSimple = Class.forName("org.json.simple.JSONObject");
|
||||
if (plugin.getClass().isAssignableFrom(jsonObjectJsonSimple)) {
|
||||
final Method jsonStringGetter = jsonObjectJsonSimple.getDeclaredMethod("toJSONString");
|
||||
jsonStringGetter.setAccessible(true);
|
||||
final String jsonString = (String) jsonStringGetter.invoke(plugin);
|
||||
final JsonObject object = new JsonParser().parse(jsonString).getAsJsonObject();
|
||||
pluginData.add(object);
|
||||
}
|
||||
} catch (final ClassNotFoundException e) {
|
||||
if (logFailedRequests) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, "Encountered unexpected exception ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (final NullPointerException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
|
||||
}
|
||||
}
|
||||
} catch (final NoSuchFieldException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
data.add("plugins", pluginData);
|
||||
|
||||
new Thread(() -> {
|
||||
try {
|
||||
sendData(plugin, data);
|
||||
} catch (final Exception e) {
|
||||
if (logFailedRequests) {
|
||||
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats of " + plugin.getName(), e);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private static void sendData(final Plugin plugin, final JsonObject data) throws Exception {
|
||||
if (data == null) {
|
||||
throw new IllegalArgumentException("Data cannot be null!");
|
||||
}
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
throw new IllegalAccessException("This method must not be called from the main thread!");
|
||||
}
|
||||
if (logSentData) {
|
||||
plugin.getLogger().info("Sending data to bStats: " + data);
|
||||
}
|
||||
final HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
|
||||
|
||||
final byte[] compressedData = compress(data.toString());
|
||||
|
||||
connection.setRequestMethod("POST");
|
||||
connection.addRequestProperty("Accept", "application/json");
|
||||
connection.addRequestProperty("Connection", "close");
|
||||
connection.addRequestProperty("Content-Encoding", "gzip");
|
||||
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);
|
||||
|
||||
connection.setDoOutput(true);
|
||||
try (final DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
|
||||
outputStream.write(compressedData);
|
||||
}
|
||||
|
||||
if (logResponseStatusText) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
try (final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
}
|
||||
plugin.getLogger().info("Sent data to bStats and received response: " + builder);
|
||||
} else {
|
||||
connection.getInputStream().close();
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] compress(final String str) throws IOException {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
try (final GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
|
||||
gzip.write(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -18,15 +18,15 @@
|
||||
|
||||
package eu.kennytv.worldeditsui.user;
|
||||
|
||||
import eu.kennytv.worldeditsui.compat.SimpleVector;
|
||||
import eu.kennytv.worldeditsui.compat.SelectionType;
|
||||
import eu.kennytv.worldeditsui.compat.SimpleVector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class SelectionCache {
|
||||
|
||||
private final List<SimpleVector> vectors = new ArrayList<>();
|
||||
private List<SimpleVector> vectors = new ArrayList<>();
|
||||
private SelectionType selectionType = SelectionType.NONE;
|
||||
private SimpleVector minimum;
|
||||
private SimpleVector maximum;
|
||||
@@ -35,6 +35,10 @@ public final class SelectionCache {
|
||||
return vectors;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
vectors = new ArrayList<>();
|
||||
}
|
||||
|
||||
public SelectionType getSelectionType() {
|
||||
return selectionType;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -112,11 +112,11 @@ public final class User {
|
||||
|
||||
public void clearCaches() {
|
||||
if (selectionCache != null) {
|
||||
selectionCache.getVectors().clear();
|
||||
selectionCache.clear();
|
||||
selectionCache = null;
|
||||
}
|
||||
if (selectedWGRegionCache != null) {
|
||||
selectedWGRegionCache.getVectors().clear();
|
||||
selectedWGRegionCache.clear();
|
||||
selectedWGRegionCache = null;
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public final class User {
|
||||
public void clearCache(final DrawedType drawedType) {
|
||||
final SelectionCache oldCache = getSelectionCache(drawedType);
|
||||
if (oldCache != null) {
|
||||
oldCache.getVectors().clear();
|
||||
oldCache.clear();
|
||||
setSelectionCache(drawedType, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -58,7 +58,9 @@ public final class UserManager {
|
||||
|
||||
public void deleteUser(final Player player) {
|
||||
final User removedUser = users.remove(player.getUniqueId());
|
||||
removedUser.clearCaches();
|
||||
if (removedUser != null) {
|
||||
removedUser.clearCaches();
|
||||
}
|
||||
}
|
||||
|
||||
public Map<UUID, User> getUsers() {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package eu.kennytv.worldeditsui.util;
|
||||
|
||||
public interface Cancellable {
|
||||
|
||||
void cancel();
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package eu.kennytv.worldeditsui.util;
|
||||
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public final class CancellableBukkitTask implements Cancellable {
|
||||
private final BukkitTask task;
|
||||
|
||||
public CancellableBukkitTask(final BukkitTask task) {
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
task.cancel();
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package eu.kennytv.worldeditsui.util;
|
||||
|
||||
import io.papermc.paper.threadedregions.scheduler.ScheduledTask;
|
||||
|
||||
public final class CancellableScheduledTask implements Cancellable {
|
||||
private final ScheduledTask task;
|
||||
|
||||
public CancellableScheduledTask(final ScheduledTask task) {
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
task.cancel();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -30,24 +30,30 @@ import org.jetbrains.annotations.Nullable;
|
||||
public final class ParticleData {
|
||||
|
||||
private final Particle particle;
|
||||
private final int radiusSquared;
|
||||
private final double speed;
|
||||
private final double offX;
|
||||
private final double offY;
|
||||
private final double offZ;
|
||||
private final Object data;
|
||||
|
||||
public ParticleData(final Particle particle, @Nullable final Object data) {
|
||||
public ParticleData(final Particle particle, final int radius) {
|
||||
this(particle, radius, 0, 0, 0, 0, null);
|
||||
}
|
||||
|
||||
public ParticleData(final Particle particle, final int radius, final double speed,
|
||||
final double offX, final double offY, final double offZ, @Nullable final Object data) {
|
||||
this.particle = particle;
|
||||
this.radiusSquared = radius * radius;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Particle getParticle() {
|
||||
return particle;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object getData() {
|
||||
return data;
|
||||
this.speed = speed;
|
||||
this.offX = offX;
|
||||
this.offY = offY;
|
||||
this.offZ = offZ;
|
||||
}
|
||||
|
||||
//TODO proper error handling/warnings
|
||||
public static Object getExtraData(final Particle particle, final ConfigurationSection section) throws Exception {
|
||||
public static Object getExtraData(final Particle particle, final ConfigurationSection section) {
|
||||
final Class<?> dataType = particle.getDataType();
|
||||
if (dataType == null || dataType == Void.class) return null;
|
||||
|
||||
@@ -55,7 +61,7 @@ public final class ParticleData {
|
||||
|
||||
final String name = dataType.getSimpleName();
|
||||
// they might exist, they might not ¯\_(ツ)_/¯
|
||||
// also it's only executed when (re)loading the config, so I think I might just get away with this method (prolly not worth doing extra modules for this)
|
||||
// also it's only executed when (re)loading the config, so I might just get away with this method (not worth doing extra modules for this)
|
||||
if (name.equals("DustOptions")) {
|
||||
final float size = (float) section.getDouble("size");
|
||||
final Color color = section.contains("rgb") ? Color.fromRGB(section.getInt("rgb"))
|
||||
@@ -76,4 +82,33 @@ public final class ParticleData {
|
||||
|
||||
throw new IllegalArgumentException("The datatype " + name + " is not yet supported by the plugin - please report this error!");
|
||||
}
|
||||
|
||||
public Particle getParticle() {
|
||||
return particle;
|
||||
}
|
||||
|
||||
public int radiusSquared() {
|
||||
return radiusSquared;
|
||||
}
|
||||
|
||||
public double speed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public double offX() {
|
||||
return offX;
|
||||
}
|
||||
|
||||
public double offY() {
|
||||
return offY;
|
||||
}
|
||||
|
||||
public double offZ() {
|
||||
return offZ;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
* This file is part of WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2021 kennytv (https://github.com/kennytv)
|
||||
*
|
||||
* 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
|
||||
@@ -31,34 +31,26 @@ public final class ParticleHelper {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public void playEffect(final ParticleData particle, final Location location, final int radius, final Player player) {
|
||||
playEffect(particle, location, 0, 0, 0, radius, player);
|
||||
}
|
||||
|
||||
public void playEffect(final ParticleData particle, final Location location, final float offX, final float offY, final float offZ, final int radius, final Player player) {
|
||||
public void playEffect(final ParticleData particle, final Location location, final Player player) {
|
||||
if (!location.getWorld().equals(player.getWorld())) return;
|
||||
|
||||
final int radiusSquared = radius * radius;
|
||||
if (player.getLocation().distanceSquared(location) > radiusSquared) return;
|
||||
if (player.getLocation().distanceSquared(location) > particle.radiusSquared()) return;
|
||||
|
||||
player.spawnParticle(particle.getParticle(), location, 1, offX, offY, offZ, 0, particle.getData());
|
||||
player.spawnParticle(particle.getParticle(), location, 1,
|
||||
particle.offX(), particle.offY(), particle.offZ(), particle.speed(), particle.getData());
|
||||
}
|
||||
|
||||
public void playEffectToAll(final ParticleData particle, final ParticleData othersParticle, final Location location, final int radius, final Player origin) {
|
||||
playEffectToAll(particle, othersParticle, location, 0, 0, 0, radius, origin);
|
||||
}
|
||||
|
||||
public void playEffectToAll(final ParticleData particle, final ParticleData othersParticle, final Location location, final float offX, final float offY, final float offZ, final int radius, final Player origin) {
|
||||
final int radiusSquared = radius * radius;
|
||||
public void playEffectToAll(final ParticleData particle, final ParticleData othersParticle, final Location location, final Player origin) {
|
||||
for (final Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (!location.getWorld().equals(player.getWorld())
|
||||
|| player.getLocation().distanceSquared(location) > radiusSquared) continue;
|
||||
|| player.getLocation().distanceSquared(location) > particle.radiusSquared()) continue;
|
||||
|
||||
final boolean originalPlayer = player.getUniqueId().equals(origin.getUniqueId());
|
||||
if (!originalPlayer && !canSeeOtherParticles(player)) continue;
|
||||
|
||||
final ParticleData toSend = originalPlayer ? particle : othersParticle;
|
||||
player.spawnParticle(toSend.getParticle(), location, 1, offX, offY, offZ, 0, toSend.getData());
|
||||
player.spawnParticle(toSend.getParticle(), location, 1,
|
||||
particle.offX(), particle.offY(), particle.offZ(), particle.speed(), toSend.getData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* WorldEditSUI - https://git.io/wesui
|
||||
* Copyright (C) 2018-2020 KennyTV (https://github.com/KennyTV)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package eu.kennytv.worldeditsui.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class Version implements Comparable<Version> {
|
||||
|
||||
private final int[] parts;
|
||||
private final String version;
|
||||
private final String tag;
|
||||
|
||||
public Version(final String version) {
|
||||
if (version == null || version.isEmpty()) {
|
||||
this.version = "";
|
||||
tag = "";
|
||||
parts = new int[0];
|
||||
return;
|
||||
}
|
||||
final String[] split = version.split("-", 2)[0].split("\\.");
|
||||
parts = new int[split.length];
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (!split[i].matches("[0-9]+")) {
|
||||
this.version = "";
|
||||
tag = "";
|
||||
return;
|
||||
}
|
||||
parts[i] = Integer.parseInt(split[i]);
|
||||
}
|
||||
|
||||
this.version = version;
|
||||
tag = version.contains("-") ? version.split("-", 2)[1] : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two versions.
|
||||
*
|
||||
* @param version version to compare to
|
||||
* @return 0 if they are the same, 1 if this instance is newer, -1 if older
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(@NotNull final Version version) {
|
||||
if (version == null || version.toString() == null) return 0;
|
||||
final int max = Math.max(this.parts.length, version.parts.length);
|
||||
for (int i = 0; i < max; i++) {
|
||||
final int partA = i < this.parts.length ? this.parts[i] : 0;
|
||||
final int partB = i < version.parts.length ? version.parts[i] : 0;
|
||||
if (partA < partB) return -1;
|
||||
if (partA > partB) return 1;
|
||||
}
|
||||
|
||||
if (this.tag.isEmpty() && !version.tag.isEmpty())
|
||||
return 1;
|
||||
if (!this.tag.isEmpty() && version.tag.isEmpty())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (o == null) return false;
|
||||
return o instanceof Version && o == this || version.equals(o.toString());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# WorldEditSUI Plugin by KennyTV
|
||||
# WorldEditSUI Plugin by kennytv
|
||||
|
||||
# If enabled, the positions for particles will only be calculated once per selection and then cached.
|
||||
# This essentially entirely removes the higher CPU usage of the calculations, but results in some caching if many/big selections are being made.
|
||||
@@ -12,16 +12,17 @@ cache-calculated-positions: true
|
||||
#
|
||||
# If you want to use a particle that requires extra data (REDSTONE, FALLING_DUST, BLOCK_DUST, BLOCK_CRACK, ITEM_CRACK),
|
||||
# you can read up on how to do that at the bottom of the plugin's Spigot page.
|
||||
# The same applies to per-particle view-distance, speed, and offsets.
|
||||
particle: FLAME
|
||||
# Shown for the clipboard (after using WorldEdit's //copy command).
|
||||
# Can be enabled with the '/wesui toggleclipboard' command.
|
||||
clipboard-particle: VILLAGER_HAPPY
|
||||
clipboard-particle: END_ROD
|
||||
# Shown for the WG region view (when using '/wesui showregion <region>').
|
||||
wg-region-particle: VILLAGER_HAPPY
|
||||
wg-region-particle: END_ROD
|
||||
|
||||
# How many particles should be displayed for every block of length.
|
||||
# The recommended amount is between 2 and 4. Can be set from 1 to 5.
|
||||
particles-per-block: 3
|
||||
particles-per-block: 2
|
||||
|
||||
# This number determines how many ticks should be between every sending of particles.
|
||||
# Can be set from 5 to 200.
|
||||
@@ -30,13 +31,20 @@ particle-send-interval: 12
|
||||
|
||||
# Max ping a player can have before particles are no longer sent - this option only works on Paper servers.
|
||||
# Set this to -1 to disable.
|
||||
max-ping: 150
|
||||
max-ping: 250
|
||||
|
||||
# Selecting giant areas may result in a high cpu usage or server lag.
|
||||
# This limits the maximum number of blocks that can be displayed (default is 10 million, ~250*150*250 blocks).
|
||||
# You could still go even higher if they can only be used by trusted people.
|
||||
max-selection-size-to-display: 10_000_000
|
||||
# If set to true, players with the 'wesui.maxselectionsize.bypass' permission ignore the limit from above.
|
||||
enable-max-selection-bypass-perm: false
|
||||
|
||||
advanced-grid:
|
||||
# If enabled, the selection will not only be displayed by the outline,
|
||||
# but also with a grid between the outlines (the bigger the selection, the bigger the grid).
|
||||
# Requires more or less 2 to 3 times the amount of calculations, but looks amazing!
|
||||
enabled: false
|
||||
enabled: true
|
||||
# How many particles should be displayed for every block of length.
|
||||
# The recommended amount is between 2 and 3. Can be set from 2 to 5.
|
||||
particles-per-block: 2
|
||||
@@ -44,21 +52,21 @@ advanced-grid:
|
||||
advanced-clipboard-grid:
|
||||
# You can also enable the grid for the clipboard view.
|
||||
# Same as advanced-grid settings, but for the clipboard.
|
||||
enabled: false
|
||||
enabled: true
|
||||
particles-per-block: 2
|
||||
|
||||
advanced-wg-region-grid:
|
||||
# You can also enable the grid for the WG region view by using the '/wesui showregion <region>' command.
|
||||
# Same as advanced-grid settings, but for the WorldGuard regions.
|
||||
enabled: false
|
||||
enabled: true
|
||||
particles-per-block: 2
|
||||
|
||||
particle-expiry:
|
||||
# If enabled and a selection isn't changed for the given amount of seconds, particles will stop being sent for it
|
||||
enabled: false
|
||||
expires-after-seconds: 180
|
||||
enabled: true
|
||||
expires-after-seconds: 250
|
||||
# If enabled, players are notified if their particles disappear after the expiry.
|
||||
expire-message: true
|
||||
expire-message: false
|
||||
|
||||
# If set to 'none', every player will have their selection displayed.
|
||||
# Else, only players with the set permission will have particles for their selection.
|
||||
@@ -73,7 +81,7 @@ send-particles-to-all:
|
||||
view-others-particles-perm: "none"
|
||||
# If you want people to see different particles for another player's selections, you can set them here.
|
||||
others-particle: FLAME
|
||||
others-clipboard-particle: VILLAGER_HAPPY
|
||||
others-clipboard-particle: END_ROD
|
||||
|
||||
# If set to false, players will have to use '/wesui toggle' first to be able to see the particles.
|
||||
show-selection-by-default: true
|
||||
@@ -82,11 +90,8 @@ show-clipboard-by-default: false
|
||||
|
||||
# Saves toggles to a file, so that they stay changed after player quits and server restarts.
|
||||
# This also includes the clipboard toggle.
|
||||
persistent-toggles: false
|
||||
persistent-toggles: true
|
||||
|
||||
# Changes the distance from which particles can be seen, can be set from 1 to 500 (if you for some reason want to see them 500 blocks away).
|
||||
# This does NOT affect server performance in any way.
|
||||
particle-viewdistance: 99
|
||||
|
||||
# Recommended to have this enabled, as you'd else miss out on new features and overall improvements.
|
||||
update-checks: true
|
||||
particle-viewdistance: 250
|
||||
@@ -1,4 +1,4 @@
|
||||
prefix: "&8[&eWorldEditSUI&8]"
|
||||
prefix: "&7[&eWorldEditSUI&7]"
|
||||
|
||||
noPermission: "%prefix% &cYou don't have the permission to use this command."
|
||||
particlesShown: "%prefix% &aParticles of your selection are now shown!"
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
name: ${project.name}
|
||||
version: ${project.version}
|
||||
name: WorldEditSUI
|
||||
version: '${version}'
|
||||
main: eu.kennytv.worldeditsui.WorldEditSUIPlugin
|
||||
authors: [KennyTV]
|
||||
authors: [kennytv]
|
||||
depend: [WorldEdit]
|
||||
softdepend: [WorldGuard]
|
||||
website: https://www.spigotmc.org/resources/worldeditsui.60726/
|
||||
api-version: 1.13
|
||||
folia-supported: false
|
||||
|
||||
commands:
|
||||
worldeditsui:
|
||||
description: WorldEditSUI main command.
|
||||
aliases: [wesui]
|
||||
permission: wesui.command
|
||||
permission: wesui.command
|
||||
Reference in new issue
Block a user