Update to gradle 8.14.3
This commit is contained in:
1 parent
75684165f2
commit
cd50fa98e3
10 files changed
+860
-57
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Fetch all submodule content.
|
||||
git submodule update --force --recursive --init --remote
|
||||
git submodule update --force --recursive --init
|
||||
+75
-41
@@ -1,89 +1,123 @@
|
||||
/* ------------------------------ Plugins ------------------------------ */
|
||||
plugins {
|
||||
id("java") // Tell gradle this is a java project.
|
||||
id("java-library") // Import helper for source-based libraries.
|
||||
id("com.diffplug.spotless") version "7.0.4" // Import auto-formatter.
|
||||
id("com.gradleup.shadow") version "8.3.6" // Import shadow API.
|
||||
eclipse // Import eclipse plugin for IDE integration.
|
||||
id("java") // Import Java plugin.
|
||||
id("java-library") // Import Java Library plugin.
|
||||
id("com.diffplug.spotless") version "7.0.4" // Import Spotless plugin.
|
||||
id("com.gradleup.shadow") version "8.3.6" // Import Shadow plugin.
|
||||
id("checkstyle") // Import Checkstyle plugin.
|
||||
eclipse // Import Eclipse plugin.
|
||||
kotlin("jvm") version "2.1.21" // Import Kotlin JVM plugin.
|
||||
}
|
||||
|
||||
extra["kotlinAttribute"] = Attribute.of("kotlin-tag", Boolean::class.javaObjectType)
|
||||
|
||||
val kotlinAttribute: Attribute<Boolean> by rootProject.extra
|
||||
|
||||
/* --------------------------- JDK / Kotlin ---------------------------- */
|
||||
java {
|
||||
// Declare java version.
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
sourceCompatibility = JavaVersion.VERSION_17 // Compile with JDK 17 compatibility.
|
||||
toolchain { // Select Java toolchain.
|
||||
languageVersion.set(JavaLanguageVersion.of(17)) // Use JDK 17.
|
||||
vendor.set(JvmVendorSpec.GRAAL_VM) // Use GraalVM CE.
|
||||
}
|
||||
}
|
||||
|
||||
group = "net.trueog.miniplaceholdersessentials" // Declare bundle identifier.
|
||||
kotlin { jvmToolchain(17) }
|
||||
|
||||
/* ----------------------------- Metadata ------------------------------ */
|
||||
group = "net.trueog.miniplaceholdersessentials-og" // Declare bundle identifier.
|
||||
|
||||
version = "1.0" // Declare plugin version (will be in .jar).
|
||||
|
||||
val apiVersion = "1.19" // Declare minecraft server target version.
|
||||
|
||||
/* ----------------------------- Resources ----------------------------- */
|
||||
tasks.named<ProcessResources>("processResources") {
|
||||
val props = mapOf("version" to version, "apiVersion" to apiVersion)
|
||||
|
||||
inputs.properties(props) // Indicates to rerun if version changes.
|
||||
|
||||
filesMatching("plugin.yml") { expand(props) }
|
||||
from("LICENSE") { // Bundle license into .jars.
|
||||
into("/")
|
||||
}
|
||||
from("LICENSE") { into("/") } // Bundle licenses into jarfiles.
|
||||
}
|
||||
|
||||
/* ---------------------------- Repos ---------------------------------- */
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") }
|
||||
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
|
||||
maven { url = uri("https://repo.essentialsx.net/releases/") }
|
||||
mavenCentral() // Import the Maven Central Maven Repository.
|
||||
gradlePluginPortal() // Import the Gradle Plugin Portal Maven Repository.
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") } // Import the PurpurMC Maven Repository.
|
||||
maven { url = uri("https://repo.essentialsx.net/releases/") } // Import the EssentialsX Maven Repository.
|
||||
}
|
||||
|
||||
/* ---------------------- Java project deps ---------------------------- */
|
||||
dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare Purpur API version to be packaged.
|
||||
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.2.3") // Import MiniPlaceholders API.
|
||||
compileOnlyApi(project(":libs:Utilities-OG")) // Import TrueOG Network Utilities-OG Java API (from source).
|
||||
compileOnly("net.essentialsx:EssentialsX:2.20.1") {
|
||||
exclude(group = "org.bstats", module = "bstats-bukkit") // Exclude bstats.
|
||||
}
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare purpur API version to be packaged.
|
||||
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.2.3") // Import MiniPlaceholders API.
|
||||
compileOnlyApi(project(":libs:Utilities-OG"))
|
||||
}
|
||||
|
||||
apply(from = "eclipse.gradle.kts") // Import eclipse classpath support script.
|
||||
|
||||
/* ---------------------- Reproducible jars ---------------------------- */
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
/* ----------------------------- Shadow -------------------------------- */
|
||||
tasks.shadowJar {
|
||||
exclude("io.github.miniplaceholders.*") // Exclude the MiniPlaceholders package from being shadowed.
|
||||
archiveClassifier.set("") // Use empty string instead of null.
|
||||
minimize()
|
||||
}
|
||||
|
||||
tasks.build {
|
||||
dependsOn(tasks.spotlessApply)
|
||||
dependsOn(tasks.shadowJar)
|
||||
}
|
||||
tasks.jar { archiveClassifier.set("part") } // Applies to root jarfile only.
|
||||
|
||||
tasks.jar { archiveClassifier.set("part") }
|
||||
tasks.build { dependsOn(tasks.spotlessApply, tasks.shadowJar) } // Build depends on spotless and shadow.
|
||||
|
||||
/* --------------------------- Javac opts ------------------------------- */
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("-parameters")
|
||||
options.compilerArgs.add("-Xlint:deprecation") // Triggers deprecation warning messages.
|
||||
options.encoding = "UTF-8"
|
||||
options.isFork = true
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
vendor = JvmVendorSpec.GRAAL_VM
|
||||
}
|
||||
options.compilerArgs.add("-parameters") // Enable reflection for java code.
|
||||
options.isFork = true // Run javac in its own process.
|
||||
options.compilerArgs.add("-Xlint:deprecation") // Trigger deprecation warning messages.
|
||||
options.encoding = "UTF-8" // Use UTF-8 file encoding.
|
||||
}
|
||||
|
||||
/* ----------------------------- Auto Formatting ------------------------ */
|
||||
spotless {
|
||||
java {
|
||||
removeUnusedImports()
|
||||
palantirJavaFormat()
|
||||
eclipse().configFile("config/formatter/eclipse-java-formatter.xml") // Eclipse java formatting.
|
||||
leadingTabsToSpaces() // Convert leftover leading tabs to spaces.
|
||||
removeUnusedImports() // Remove imports that aren't being called.
|
||||
}
|
||||
kotlinGradle {
|
||||
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
|
||||
target("build.gradle.kts", "settings.gradle.kts")
|
||||
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) } // JetBrains Kotlin formatting.
|
||||
target("build.gradle.kts", "settings.gradle.kts") // Gradle files to format.
|
||||
}
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "10.18.1" // Declare checkstyle version to use.
|
||||
configFile = file("config/checkstyle/checkstyle.xml") // Point checkstyle to config file.
|
||||
isIgnoreFailures = true // Don't fail the build if checkstyle does not pass.
|
||||
isShowViolations = true // Show the violations in any IDE with the checkstyle plugin.
|
||||
}
|
||||
|
||||
tasks.named("compileJava") {
|
||||
dependsOn("spotlessApply") // Run spotless before compiling with the JDK.
|
||||
}
|
||||
|
||||
tasks.named("spotlessCheck") {
|
||||
dependsOn("spotlessApply") // Run spotless before checking if spotless ran.
|
||||
}
|
||||
|
||||
/* ------------------------------ Eclipse SHIM ------------------------- */
|
||||
|
||||
// This can't be put in eclipse.gradle.kts because Gradle is weird.
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "eclipse")
|
||||
eclipse.project.name = "${project.name}-${rootProject.name}"
|
||||
tasks.withType<Jar>().configureEach { archiveBaseName.set("${project.name}-${rootProject.name}") }
|
||||
}
|
||||
@@ -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>
|
||||
@@ -0,0 +1,151 @@
|
||||
/* This is free and unencumbered software released into the public domain */
|
||||
|
||||
import org.gradle.plugins.ide.eclipse.model.EclipseModel
|
||||
import java.nio.file.Files
|
||||
import javax.xml.parsers.DocumentBuilderFactory
|
||||
import javax.xml.transform.OutputKeys
|
||||
import javax.xml.transform.TransformerFactory
|
||||
import javax.xml.transform.dom.DOMSource
|
||||
import javax.xml.transform.stream.StreamResult
|
||||
|
||||
val kotlinAttribute: Attribute<Boolean> by rootProject.extra
|
||||
|
||||
val kotlinPluginProjects = configurations
|
||||
.getByName("compileClasspath")
|
||||
.allDependencies
|
||||
.filterIsInstance<ProjectDependency>()
|
||||
.filter { it -> it.attributes.getAttribute(kotlinAttribute) != null }
|
||||
.map { it.path }
|
||||
kotlinPluginProjects.forEach { evaluationDependsOn(it) }
|
||||
|
||||
val ideLibs: Configuration by
|
||||
configurations.creating {
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
}
|
||||
|
||||
configure<EclipseModel> {
|
||||
project {
|
||||
name = "Template-OG-Plugin"
|
||||
}
|
||||
classpath {
|
||||
plusConfigurations.add(ideLibs)
|
||||
}
|
||||
}
|
||||
|
||||
val ideLibDir = layout.buildDirectory.dir("ide-libs")
|
||||
val hashRegex = Regex("-[0-9a-fA-F]{10}(?=\\.jar$)") // Black magic.
|
||||
|
||||
val copyTasks = mutableListOf<TaskProvider<Copy>>()
|
||||
|
||||
kotlinPluginProjects.forEach { path ->
|
||||
val sub = project(path)
|
||||
val shadowJarProv = sub.tasks.named("shadowJar")
|
||||
val copyTask =
|
||||
tasks.register<Copy>("ideCopy${sub.name.replaceFirstChar(Char::titlecase)}") {
|
||||
dependsOn(shadowJarProv)
|
||||
from(shadowJarProv)
|
||||
into(ideLibDir)
|
||||
rename { it.replace(hashRegex, "") } // Remove git commit hash from jarfile.
|
||||
}
|
||||
copyTasks += copyTask
|
||||
}
|
||||
|
||||
/* Ensure the jars exist before .classpath is generated */
|
||||
tasks.named("eclipseClasspath").configure { dependsOn(copyTasks) }
|
||||
|
||||
/* Supply those jars to the ideLibs configuration (after evaluation) */
|
||||
afterEvaluate { dependencies { add("ideLibs", fileTree(ideLibDir) { include("*.jar") }) } }
|
||||
|
||||
val injectIdeLibs =
|
||||
tasks.register("injectIdeLibs") {
|
||||
dependsOn("eclipse") // run after all eclipse files are generated
|
||||
doLast {
|
||||
val cpFile = file(".classpath")
|
||||
if (!cpFile.exists()) return@doLast
|
||||
|
||||
val jars = fileTree(ideLibDir.get()) { include("*.jar") }.files.sortedBy { it.name }
|
||||
if (jars.isEmpty()) return@doLast
|
||||
|
||||
// Parse DOM
|
||||
val dbf = DocumentBuilderFactory.newInstance()
|
||||
val doc = dbf.newDocumentBuilder().parse(cpFile)
|
||||
val root = doc.documentElement
|
||||
|
||||
// Helper to see if an entry already exists
|
||||
fun exists(path: String): Boolean =
|
||||
root.getElementsByTagName("classpathentry").let { list ->
|
||||
(0 until list.length).any { i ->
|
||||
val n = list.item(i)
|
||||
val kind = n.attributes?.getNamedItem("kind")?.nodeValue
|
||||
val p = n.attributes?.getNamedItem("path")?.nodeValue
|
||||
kind == "lib" && p == path
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any entry that points to ide-libs dir (folder or jars) to avoid dupes
|
||||
val toRemove = mutableListOf<org.w3c.dom.Node>()
|
||||
val list = root.getElementsByTagName("classpathentry")
|
||||
val dirPath = ideLibDir.get().asFile.absolutePath
|
||||
for (i in 0 until list.length) {
|
||||
val n = list.item(i)
|
||||
val kind = n.attributes?.getNamedItem("kind")?.nodeValue
|
||||
val p = n.attributes?.getNamedItem("path")?.nodeValue ?: ""
|
||||
if (kind == "lib" && (p == dirPath || p.startsWith("$dirPath/"))) {
|
||||
toRemove += n
|
||||
}
|
||||
}
|
||||
toRemove.forEach { root.removeChild(it) }
|
||||
|
||||
// Append our jar entries LAST
|
||||
jars.forEach { f ->
|
||||
val abs = f.absolutePath
|
||||
if (!exists(abs)) {
|
||||
val entry = doc.createElement("classpathentry")
|
||||
entry.setAttribute("kind", "lib")
|
||||
entry.setAttribute("path", abs)
|
||||
root.appendChild(entry)
|
||||
}
|
||||
}
|
||||
|
||||
// Write back pretty
|
||||
val tf =
|
||||
TransformerFactory.newInstance().newTransformer().apply {
|
||||
setOutputProperty(OutputKeys.INDENT, "yes")
|
||||
setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "1")
|
||||
setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no")
|
||||
setOutputProperty(OutputKeys.ENCODING, "UTF-8")
|
||||
}
|
||||
Files.newBufferedWriter(cpFile.toPath()).use { w -> tf.transform(DOMSource(doc), StreamResult(w)) }
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("eclipse").configure { finalizedBy(injectIdeLibs) }
|
||||
|
||||
val eclipseModel = extensions.getByType<EclipseModel>()
|
||||
|
||||
fun Project.addResolvableEclipseConfigs() {
|
||||
val jarAttr =
|
||||
objects.named(org.gradle.api.attributes.LibraryElements::class, org.gradle.api.attributes.LibraryElements.JAR)
|
||||
val apiAttr = objects.named(org.gradle.api.attributes.Usage::class, org.gradle.api.attributes.Usage.JAVA_API)
|
||||
|
||||
val compileOnlyRes =
|
||||
configurations.create("eclipseCompileOnly") {
|
||||
extendsFrom(configurations.getByName("compileOnly"))
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
attributes.attribute(org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, apiAttr)
|
||||
attributes.attribute(org.gradle.api.attributes.LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, jarAttr)
|
||||
}
|
||||
val compileOnlyApiRes =
|
||||
configurations.create("eclipseCompileOnlyApi") {
|
||||
extendsFrom(configurations.getByName("compileOnlyApi"))
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
attributes.attribute(org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, apiAttr)
|
||||
attributes.attribute(org.gradle.api.attributes.LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, jarAttr)
|
||||
}
|
||||
eclipseModel.classpath.plusConfigurations.addAll(listOf(compileOnlyRes, compileOnlyApiRes))
|
||||
}
|
||||
|
||||
addResolvableEclipseConfigs()
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+1
-1
Submodule libs/Utilities-OG updated: ed7f99d354...4b730712ad.
+9
-8
@@ -1,12 +1,13 @@
|
||||
rootProject.name = "MiniPlaceholders-Essentials-OG"
|
||||
|
||||
// Run the bootstrap at configuration time.
|
||||
val process = ProcessBuilder("sh", "bootstrap.sh").directory(rootDir).start()
|
||||
|
||||
val exitValue = process.waitFor()
|
||||
|
||||
if (exitValue != 0) {
|
||||
throw GradleException("bootstrap.sh failed with exit code $exitValue")
|
||||
ProcessBuilder("sh", "bootstrap.sh").directory(rootDir).inheritIO().start().let {
|
||||
if (it.waitFor() != 0) throw GradleException("bootstrap.sh failed")
|
||||
}
|
||||
|
||||
include("libs:Utilities-OG")
|
||||
file("libs")
|
||||
.listFiles()
|
||||
?.filter { it.isDirectory && !it.name.startsWith(".") }
|
||||
?.forEach { dir ->
|
||||
include(":libs:${dir.name}")
|
||||
project(":libs:${dir.name}").projectDir = dir
|
||||
}
|
||||
@@ -33,5 +33,7 @@ public class EssentialsExpansion extends JavaPlugin {
|
||||
new EssentialsHook();
|
||||
|
||||
getLogger().info(getName() + " v." + getPluginMeta().getVersion() + " has been enabled!");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,7 +46,9 @@ public class EssentialsHook {
|
||||
if (canRegister()) {
|
||||
|
||||
register();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,6 +60,7 @@ public class EssentialsHook {
|
||||
|
||||
return Bukkit.getPluginManager().getPlugin("Essentials") != null
|
||||
&& Bukkit.getPluginManager().getPlugin("Essentials").isEnabled();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,6 +91,7 @@ public class EssentialsHook {
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
// Register all MiniPlaceholders.
|
||||
@@ -97,6 +101,7 @@ public class EssentialsHook {
|
||||
registerWorldPlaceholders();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,15 +111,18 @@ public class EssentialsHook {
|
||||
|
||||
// baltop_balance_fixed:id
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_baltop_balance_fixed", args -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
Integer id = Ints.tryParse(args.get(0));
|
||||
if (id == null) {
|
||||
|
||||
return "Invalid ID";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
@@ -122,22 +130,27 @@ public class EssentialsHook {
|
||||
if (id >= entries.length || id < 0) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
return String.valueOf(entries[id].getBalance().longValue());
|
||||
|
||||
});
|
||||
|
||||
// baltop_balance_formatted:id
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_baltop_balance_formatted", args -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
Integer id = Ints.tryParse(args.get(0));
|
||||
if (id == null) {
|
||||
|
||||
return "Invalid ID";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
@@ -146,22 +159,27 @@ public class EssentialsHook {
|
||||
if (id >= entries.length || id < 0) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
return fixMoney(entries[id].getBalance().doubleValue());
|
||||
|
||||
});
|
||||
|
||||
// baltop_balance_commas:id
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_baltop_balance_commas", args -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
Integer id = Ints.tryParse(args.get(0));
|
||||
if (id == null) {
|
||||
|
||||
return "Invalid ID";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
@@ -169,22 +187,27 @@ public class EssentialsHook {
|
||||
if (id >= entries.length || id < 0) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
return format.format(entries[id].getBalance().doubleValue());
|
||||
|
||||
});
|
||||
|
||||
// baltop_balance:id
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_baltop_balance", args -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
Integer id = Ints.tryParse(args.get(0));
|
||||
if (id == null) {
|
||||
|
||||
return "Invalid ID";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
@@ -194,22 +217,27 @@ public class EssentialsHook {
|
||||
if (id >= entries.length || id < 0) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
return String.valueOf(entries[id].getBalance().doubleValue());
|
||||
|
||||
});
|
||||
|
||||
// baltop_player:id
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_baltop_player", args -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
Integer id = Ints.tryParse(args.get(0));
|
||||
if (id == null) {
|
||||
|
||||
return "Invalid ID";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
@@ -217,22 +245,29 @@ public class EssentialsHook {
|
||||
BalanceTop.Entry[] entries = baltopCache.values().toArray(new BalanceTop.Entry[0]);
|
||||
|
||||
if (id >= entries.length || id < 0) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
return entries[id].getDisplayName();
|
||||
|
||||
});
|
||||
|
||||
// baltop_player_stripped:id
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_baltop_player_stripped", args -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
Integer id = Ints.tryParse(args.get(0));
|
||||
if (id == null) {
|
||||
|
||||
return "Invalid ID";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
@@ -241,28 +276,35 @@ public class EssentialsHook {
|
||||
if (id >= entries.length || id < 0) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
String displayName = entries[id].getDisplayName();
|
||||
|
||||
return UtilitiesOG.stripFormatting(displayName);
|
||||
|
||||
});
|
||||
|
||||
// baltop_rank (requires player context)
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_baltop_rank", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
|
||||
if (!baltopCache.containsKey(player.getUniqueId())) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
return String.valueOf(new ArrayList<>(baltopCache.keySet()).indexOf(player.getUniqueId()) + 1);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,9 +314,11 @@ public class EssentialsHook {
|
||||
|
||||
// tp_cooldown
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_tp_cooldown", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
@@ -285,16 +329,20 @@ public class EssentialsHook {
|
||||
if (diff < cooldown) {
|
||||
|
||||
return String.valueOf((int) (cooldown - diff));
|
||||
|
||||
}
|
||||
|
||||
return "0";
|
||||
|
||||
});
|
||||
|
||||
// kit_last_use:kitname
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_kit_last_use", (player, args) -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "Invalid kit name";
|
||||
|
||||
}
|
||||
|
||||
String kitName = args.get(0).toLowerCase();
|
||||
@@ -306,24 +354,29 @@ public class EssentialsHook {
|
||||
} catch (Exception error) {
|
||||
|
||||
return "Invalid kit name";
|
||||
|
||||
}
|
||||
|
||||
long time = essentials.getUser(player.getUniqueId()).getKitTimestamp(kit.getName());
|
||||
if (time == 1 || time <= 0) {
|
||||
|
||||
return "1";
|
||||
|
||||
}
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
return dateFormat.format(new Date(time));
|
||||
|
||||
});
|
||||
|
||||
// kit_is_available:kitname
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_kit_is_available", (player, args) -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
String kitName = args.get(0).toLowerCase();
|
||||
@@ -336,6 +389,7 @@ public class EssentialsHook {
|
||||
} catch (Exception error) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
long time;
|
||||
@@ -346,16 +400,20 @@ public class EssentialsHook {
|
||||
} catch (Exception error) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
return time == 0 ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// kit_time_until_available:kitname
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_kit_time_until_available", (player, args) -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "-1";
|
||||
|
||||
}
|
||||
|
||||
String kitName = args.get(0).toLowerCase();
|
||||
@@ -368,7 +426,9 @@ public class EssentialsHook {
|
||||
if (kitName.isEmpty()) {
|
||||
|
||||
return "Invalid kit name";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Kit kit;
|
||||
@@ -380,6 +440,7 @@ public class EssentialsHook {
|
||||
} catch (Exception error) {
|
||||
|
||||
return "Invalid kit name";
|
||||
|
||||
}
|
||||
|
||||
long time;
|
||||
@@ -390,11 +451,13 @@ public class EssentialsHook {
|
||||
} catch (Exception error) {
|
||||
|
||||
return "-1";
|
||||
|
||||
}
|
||||
|
||||
if (time <= System.currentTimeMillis()) {
|
||||
|
||||
return raw ? "0" : DateUtil.formatDateDiff(System.currentTimeMillis());
|
||||
|
||||
}
|
||||
|
||||
if (raw) {
|
||||
@@ -404,14 +467,18 @@ public class EssentialsHook {
|
||||
} else {
|
||||
|
||||
return DateUtil.formatDateDiff(time);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// has_kit:kitname
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_has_kit", (player, args) -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
String kit = args.get(0);
|
||||
@@ -419,22 +486,27 @@ public class EssentialsHook {
|
||||
if (oPlayer == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
return oPlayer.hasPermission("essentials.kits." + kit) ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// home:number
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_home", (player, args) -> {
|
||||
|
||||
if (args.size() < 1) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
Integer homeNumber = Ints.tryParse(args.get(0).replaceAll("\\D+", ""));
|
||||
if (homeNumber == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
homeNumber -= 1;
|
||||
@@ -443,6 +515,7 @@ public class EssentialsHook {
|
||||
if (homeNumber >= user.getHomes().size() || homeNumber < 0) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
String homeName = user.getHomes().get(homeNumber);
|
||||
@@ -451,22 +524,27 @@ public class EssentialsHook {
|
||||
if (args.size() == 1 && args.get(0).matches("\\w+_\\d+")) {
|
||||
|
||||
return homeName;
|
||||
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
});
|
||||
|
||||
// home:number:coord (w/x/y/z)
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_home_coord", (player, args) -> {
|
||||
|
||||
if (args.size() < 2) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
Integer homeNumber = Ints.tryParse(args.get(0).replaceAll("\\D+", ""));
|
||||
if (homeNumber == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
homeNumber -= 1;
|
||||
@@ -475,6 +553,7 @@ public class EssentialsHook {
|
||||
if (homeNumber >= user.getHomes().size() || homeNumber < 0) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
String homeName = user.getHomes().get(homeNumber);
|
||||
@@ -485,6 +564,7 @@ public class EssentialsHook {
|
||||
String coord = args.get(1).toLowerCase();
|
||||
|
||||
switch (coord) {
|
||||
|
||||
case "w":
|
||||
return home.getWorld().getName();
|
||||
case "x":
|
||||
@@ -495,16 +575,20 @@ public class EssentialsHook {
|
||||
return coordsFormat.format(home.getZ());
|
||||
default:
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception error) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// worth[:material]
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_worth", (player, args) -> {
|
||||
|
||||
ItemStack item;
|
||||
if (args.size() >= 1 && !args.get(0).isEmpty()) {
|
||||
|
||||
@@ -512,6 +596,7 @@ public class EssentialsHook {
|
||||
if (material == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
item = new ItemStack(material, 1);
|
||||
@@ -522,25 +607,31 @@ public class EssentialsHook {
|
||||
if (oPlayer == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
ItemStack inHand = oPlayer.getInventory().getItemInMainHand();
|
||||
if (inHand.getType() == Material.AIR) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
item = inHand;
|
||||
|
||||
}
|
||||
|
||||
BigDecimal worth = essentials.getWorth().getPrice(essentials, item);
|
||||
if (worth == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
return String.valueOf(worth.doubleValue());
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -550,151 +641,190 @@ public class EssentialsHook {
|
||||
|
||||
// is_clearinventory_confirm
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_is_clearinventory_confirm", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isPromptingClearConfirm() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// is_pay_confirm
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_is_pay_confirm", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isPromptingPayConfirm() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// is_pay_enabled
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_is_pay_enabled", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isAcceptingPay() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// is_teleport_enabled
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_is_teleport_enabled", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isTeleportEnabled() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// is_muted
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_is_muted", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isMuted() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// vanished
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_vanished", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isVanished() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// afk
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_afk", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isAfk() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// afk_reason
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_afk_reason", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
if (user.getAfkMessage() == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
return UtilitiesOG.trueogExpand(user.getAfkMessage()).content();
|
||||
|
||||
});
|
||||
|
||||
// afk_player_count
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_afk_player_count", args -> {
|
||||
|
||||
long count = essentials.getUsers().getUserCount();
|
||||
|
||||
return String.valueOf(count);
|
||||
|
||||
});
|
||||
|
||||
// msg_ignore
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_msg_ignore", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isIgnoreMsg() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// fly
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_fly", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.getBase().getAllowFlight() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// nickname
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_nickname", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.getNickname() != null ? user.getNickname() : player.getName();
|
||||
|
||||
});
|
||||
|
||||
// nickname_stripped
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_nickname_stripped", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
@@ -702,119 +832,146 @@ public class EssentialsHook {
|
||||
String nickname = user.getNickname() != null ? user.getNickname() : player.getName();
|
||||
|
||||
return UtilitiesOG.stripFormatting(nickname);
|
||||
|
||||
});
|
||||
|
||||
// muted_time_remaining
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_muted_time_remaining", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isMuted() ? DateUtil.formatDateDiff(user.getMuteTimeout()) : "";
|
||||
|
||||
});
|
||||
|
||||
// geolocation
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_geolocation", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.getGeoLocation() != null ? user.getGeoLocation() : "";
|
||||
|
||||
});
|
||||
|
||||
// godmode
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_godmode", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isGodModeEnabled() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// unique
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_unique", args -> {
|
||||
|
||||
return NumberFormat.getInstance().format(essentials.getUsers());
|
||||
|
||||
});
|
||||
|
||||
// homes_set
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_homes_set", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.getHomes().isEmpty()
|
||||
? "0"
|
||||
: String.valueOf(user.getHomes().size());
|
||||
return user.getHomes().isEmpty() ? "0" : String.valueOf(user.getHomes().size());
|
||||
|
||||
});
|
||||
|
||||
// homes_max
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_homes_max", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return String.valueOf(essentials.getSettings().getHomeLimit(user));
|
||||
|
||||
});
|
||||
|
||||
// jailed
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_jailed", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "false";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isJailed() ? "true" : "false";
|
||||
|
||||
});
|
||||
|
||||
// jailed_time_remaining
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_jailed_time_remaining", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.isJailed() ? user.getFormattedJailTime() : "";
|
||||
|
||||
});
|
||||
|
||||
// pm_recipient
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_pm_recipient", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
|
||||
return user.getReplyRecipient() != null ? user.getReplyRecipient().getName() : "";
|
||||
|
||||
});
|
||||
|
||||
// safe_online
|
||||
UtilitiesOG.registerGlobalPlaceholder("essentials_safe_online", args -> {
|
||||
|
||||
long count = StreamSupport.stream(essentials.getOnlineUsers().spliterator(), false)
|
||||
.filter(user -> !user.isHidden())
|
||||
.count();
|
||||
.filter(user -> !user.isHidden()).count();
|
||||
|
||||
return String.valueOf(count);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -824,9 +981,11 @@ public class EssentialsHook {
|
||||
|
||||
// world_date
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_world_date", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
@@ -836,13 +995,16 @@ public class EssentialsHook {
|
||||
|
||||
return DateFormat.getDateInstance(DateFormat.MEDIUM, locale)
|
||||
.format(DescParseTickFormat.ticksToDate(worldTime));
|
||||
|
||||
});
|
||||
|
||||
// world_time
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_world_time", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
@@ -850,13 +1012,16 @@ public class EssentialsHook {
|
||||
long worldTime = user.getWorld() == null ? 0 : user.getWorld().getTime();
|
||||
|
||||
return DescParseTickFormat.format12(worldTime);
|
||||
|
||||
});
|
||||
|
||||
// world_time_24
|
||||
UtilitiesOG.registerAudiencePlaceholder("essentials_world_time_24", player -> {
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
User user = essentials.getUser(player.getUniqueId());
|
||||
@@ -864,7 +1029,9 @@ public class EssentialsHook {
|
||||
long worldTime = user.getWorld() == null ? 0 : user.getWorld().getTime();
|
||||
|
||||
return DescParseTickFormat.format24(worldTime);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -881,6 +1048,7 @@ public class EssentialsHook {
|
||||
format.setMinimumFractionDigits(0);
|
||||
|
||||
return format.format(d);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -894,32 +1062,41 @@ public class EssentialsHook {
|
||||
if (d < 1_000L) {
|
||||
|
||||
return format(d);
|
||||
|
||||
}
|
||||
|
||||
if (d < 1_000_000L) {
|
||||
|
||||
return format(d / 1_000L) + k;
|
||||
|
||||
}
|
||||
|
||||
if (d < 1_000_000_000L) {
|
||||
|
||||
return format(d / 1_000_000L) + m;
|
||||
|
||||
}
|
||||
|
||||
if (d < 1_000_000_000_000L) {
|
||||
|
||||
return format(d / 1_000_000_000L) + b;
|
||||
|
||||
}
|
||||
|
||||
if (d < 1_000_000_000_000_000L) {
|
||||
|
||||
return format(d / 1_000_000_000_000L) + t;
|
||||
|
||||
}
|
||||
|
||||
if (d < 1_000_000_000_000_000_000L) {
|
||||
|
||||
return format(d / 1_000_000_000_000_000L) + q;
|
||||
|
||||
}
|
||||
|
||||
return String.valueOf(d);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user