Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa7b96559f | ||
|
|
dcc1f99b39 | ||
|
|
9bfed4b6ea | ||
|
|
5f6ad3bfd5 | ||
|
|
a9a58161ac |
No files matched your search
@@ -1 +0,0 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -1,3 +0,0 @@
|
||||
# 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
|
||||
+166
-38
@@ -1,46 +1,174 @@
|
||||
# Compiled class file
|
||||
*.class
|
||||
### Eclipse ###
|
||||
|
||||
# Log file
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
/.idea/
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff:
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/dictionaries
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.xml
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# CMake
|
||||
cmake-build-debug/
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Ruby plugin and RubyMine
|
||||
/.rakeTasks
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
### Intellij Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
*.iml
|
||||
# modules.xml
|
||||
# .idea/misc.xml
|
||||
# *.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
.idea/sonarlint
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Gradle ###
|
||||
.gradle/
|
||||
gradle-app.setting
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
### OS/Logs ###
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
# macOS system files
|
||||
Thumbs.db
|
||||
Desktop.ini
|
||||
.DS_Store
|
||||
|
||||
# gradle build output files
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
|
||||
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
|
||||
!/.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/
|
||||
.gradle/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
nbactions.xml
|
||||
|
||||
# eclipse project files
|
||||
.settings/
|
||||
.project
|
||||
.classpath
|
||||
.checkstyle
|
||||
bin/
|
||||
### Piggy's Debugging Shit ###
|
||||
server/
|
||||
gradlew.bat
|
||||
gradlew
|
||||
gradle/wrapper/gradle-wrapper.jar
|
||||
libs/HytaleServer.jar
|
||||
libs/papiHytale.jar
|
||||
|
||||
# IntelliJ files
|
||||
.idea/
|
||||
.kotlin
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
out/
|
||||
gradle/wrapper/gradle-wrapper.properties
|
||||
@@ -0,0 +1,46 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'at.helpch.papi.expansion.player'
|
||||
version = '1.0.5'
|
||||
description = 'PlaceholderAPI expansion for Hytale player placeholders'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
|
||||
maven {
|
||||
url = uri("https://repo.codemc.io/repository/hytale/")
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri("https://repo.helpch.at/releases")
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.hypixel.hytale:Server:2026.01.17-4b0f30090")
|
||||
compileOnly("at.helpch:placeholderapi-hytale:1.0.0")
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
tasks.named('jar') {
|
||||
archiveBaseName.set('PAPI-Expansion-Player')
|
||||
manifest {
|
||||
attributes(
|
||||
'Implementation-Title': project.name,
|
||||
'Implementation-Version': project.version
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/* ------------------------------ Plugins ------------------------------ */
|
||||
plugins {
|
||||
id("java") // Import Java plugin.
|
||||
id("java-library") // Import Java Library plugin.
|
||||
id("com.diffplug.spotless") version "8.1.0" // Import Spotless plugin.
|
||||
id("checkstyle") // Import Checkstyle plugin.
|
||||
eclipse // Import Eclipse plugin.
|
||||
}
|
||||
|
||||
/* --------------------------- JDK ------------------------------------- */
|
||||
java {
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------- Metadata ------------------------------ */
|
||||
group = "com.extendedclip.papi.expansion.player" // Declare bundle identifier.
|
||||
|
||||
version = "2.0.9" // Declare expansion version (will be in .jar).
|
||||
|
||||
/* ---------------------------- Repos ---------------------------------- */
|
||||
repositories {
|
||||
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.extendedclip.com/releases") } // Import the PlaceholderAPI Maven Repository.
|
||||
maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") }
|
||||
System.getProperty("SELF_MAVEN_LOCAL_REPO")?.let { // TrueOG Bootstrap mavenLocal().
|
||||
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()")
|
||||
}
|
||||
|
||||
/* ---------------------- Java project deps ---------------------------- */
|
||||
dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Purpur API (compile-time only).
|
||||
compileOnly("me.clip:placeholderapi:2.11.6") // PlaceholderAPI (compile-time only).
|
||||
}
|
||||
|
||||
/* ---------------------- Reproducible jars ---------------------------- */
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
/* ----------------------------- Jar ----------------------------------- */
|
||||
tasks.jar {
|
||||
archiveBaseName.set("Player-PAPI") // Final artifact name: Player-PAPI-<version>.jar.
|
||||
archiveClassifier.set("")
|
||||
manifest { attributes(mapOf("Implementation-Title" to project.name, "Implementation-Version" to project.version)) }
|
||||
}
|
||||
|
||||
tasks.build { dependsOn(tasks.spotlessApply) } // Build depends on spotless.
|
||||
|
||||
/* --------------------------- Javac opts ------------------------------- */
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
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 {
|
||||
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) } // 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.
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?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>
|
||||
|
||||
@@ -1,404 +0,0 @@
|
||||
<?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
@@ -1,7 +0,0 @@
|
||||
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
|
||||
@@ -1,251 +0,0 @@
|
||||
#!/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
@@ -1,94 +0,0 @@
|
||||
@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
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = 'hyplayer-expansion'
|
||||
@@ -1 +0,0 @@
|
||||
rootProject.name = "Player-PAPI"
|
||||
@@ -0,0 +1,203 @@
|
||||
package at.helpch.papi.expansion.player;
|
||||
|
||||
import at.helpch.placeholderapi.PlaceholderAPIPlugin;
|
||||
import at.helpch.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import com.hypixel.hytale.component.Ref;
|
||||
import com.hypixel.hytale.component.Store;
|
||||
import com.hypixel.hytale.server.core.entity.entities.Player;
|
||||
import com.hypixel.hytale.server.core.modules.entitystats.EntityStatMap;
|
||||
import com.hypixel.hytale.server.core.modules.entitystats.asset.DefaultEntityStatTypes;
|
||||
import com.hypixel.hytale.server.core.universe.PlayerRef;
|
||||
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
|
||||
import com.hypixel.hytale.server.core.universe.world.worldgen.provider.IWorldGenProvider;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public final class PlayerExpansion extends PlaceholderExpansion {
|
||||
public String getIdentifier() {
|
||||
return "Player";
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return "HelpChat";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "1.0.5";
|
||||
}
|
||||
|
||||
public String onPlaceholderRequest(PlayerRef player, String identifier) {
|
||||
if (player == null)
|
||||
return "";
|
||||
|
||||
switch (identifier) {
|
||||
case "uuid":
|
||||
return player.getUuid().toString();
|
||||
case "username":
|
||||
return player.getUsername();
|
||||
case "language":
|
||||
return player.getLanguage();
|
||||
case "world_uuid":
|
||||
return player.getWorldUuid().toString();
|
||||
case "x":
|
||||
return String.valueOf(player.getTransform().getPosition().getX());
|
||||
case "y":
|
||||
return String.valueOf(player.getTransform().getPosition().getY());
|
||||
case "z":
|
||||
return String.valueOf(player.getTransform().getPosition().getZ());
|
||||
case "yaw":
|
||||
return String.valueOf(player.getHeadRotation().getYaw());
|
||||
case "pitch":
|
||||
return String.valueOf(player.getHeadRotation().getPitch());
|
||||
}
|
||||
|
||||
Ref<EntityStore> ref = player.getReference();
|
||||
|
||||
if (ref == null || !ref.isValid())
|
||||
return null;
|
||||
|
||||
Store<EntityStore> store = ref.getStore();
|
||||
Player p = (Player) store.getComponent(ref, Player.getComponentType());
|
||||
EntityStatMap stats = (EntityStatMap) store.getComponent(ref, EntityStatMap.getComponentType());
|
||||
|
||||
if (p == null)
|
||||
return null;
|
||||
|
||||
switch (identifier) {
|
||||
case "has_played_before":
|
||||
return bool(!p.isFirstSpawn());
|
||||
case "name":
|
||||
return p.getDisplayName();
|
||||
case "gamemode":
|
||||
return p.getGameMode().name();
|
||||
case "world":
|
||||
return p.getWorld().getName();
|
||||
case "world_displayname":
|
||||
String displayName = p.getWorld().getWorldConfig().getDisplayName();
|
||||
if (displayName == null) {
|
||||
return p.getWorld().getName();
|
||||
}
|
||||
return displayName;
|
||||
case "world_worldgen_type":
|
||||
return worldGenType(p.getWorld().getWorldConfig().getWorldGenProvider());
|
||||
case "world_worldgen_name":
|
||||
return worldGenName(p.getWorld().getWorldConfig().getWorldGenProvider());
|
||||
case "biome":
|
||||
return p.getWorldMapTracker().getCurrentBiomeName();
|
||||
case "item_in_hand":
|
||||
return String.valueOf(p.getInventory().getActiveHotbarItem().getItemId());
|
||||
case "item_in_hand_quantity":
|
||||
return String.valueOf(p.getInventory().getActiveHotbarItem().getQuantity());
|
||||
case "item_in_hand_durability":
|
||||
return String.valueOf(p.getInventory().getActiveHotbarItem().getDurability());
|
||||
case "item_in_hand_broken":
|
||||
return bool(p.getInventory().getActiveHotbarItem().isBroken());
|
||||
case "item_in_hand_unbreakable":
|
||||
return bool(p.getInventory().getActiveHotbarItem().isUnbreakable());
|
||||
case "current_fall_distance":
|
||||
return String.valueOf(p.getCurrentFallDistance());
|
||||
case "view_radius":
|
||||
return String.valueOf(p.getViewRadius());
|
||||
case "client_view_radius":
|
||||
return String.valueOf(p.getClientViewRadius());
|
||||
case "since_last_spawn_nanos":
|
||||
return String.valueOf(p.getSinceLastSpawnNanos());
|
||||
case "mount_entity_id":
|
||||
return String.valueOf(p.getMountEntityId());
|
||||
case "is_collidable":
|
||||
return bool(p.isCollidable());
|
||||
case "health":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getHealth()).get());
|
||||
case "health_max":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getHealth()).getMax());
|
||||
case "health_min":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getHealth()).getMin());
|
||||
case "ammo":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getAmmo()).get());
|
||||
case "ammo_max":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getAmmo()).getMax());
|
||||
case "ammo_min":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getAmmo()).getMin());
|
||||
case "stamina":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getStamina()).get());
|
||||
case "stamina_max":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getStamina()).getMax());
|
||||
case "stamina_min":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getStamina()).getMin());
|
||||
case "mana":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getMana()).get());
|
||||
case "mana_max":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getMana()).getMax());
|
||||
case "mana_min":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getMana()).getMin());
|
||||
case "oxygen":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getOxygen()).get());
|
||||
case "oxygen_max":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getOxygen()).getMax());
|
||||
case "oxygen_min":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getOxygen()).getMin());
|
||||
case "signature_energy":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getSignatureEnergy()).get());
|
||||
case "signature_energy_max":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getSignatureEnergy()).getMax());
|
||||
case "signature_energy_min":
|
||||
return String.valueOf(stats.get(DefaultEntityStatTypes.getSignatureEnergy()).getMin());
|
||||
}
|
||||
if (identifier.startsWith("has_permission_")) {
|
||||
if ((identifier.split("has_permission_")).length > 1) {
|
||||
String perm = identifier.split("has_permission_")[1];
|
||||
return bool(p.hasPermission(perm));
|
||||
}
|
||||
return bool(false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String bool(boolean b) {
|
||||
return b ? PlaceholderAPIPlugin.instance().configManager().config().booleanValue().trueValue()
|
||||
: PlaceholderAPIPlugin.instance().configManager().config().booleanValue().falseValue();
|
||||
}
|
||||
|
||||
private String worldGenType(IWorldGenProvider provider) {
|
||||
if (provider == null)
|
||||
return null;
|
||||
|
||||
try {
|
||||
Field idField = provider.getClass().getField("ID");
|
||||
Object id = idField.get(null);
|
||||
if (id instanceof String)
|
||||
return (String) id;
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
String simpleName = provider.getClass().getSimpleName();
|
||||
if (simpleName.endsWith("WorldGenProvider"))
|
||||
return simpleName.substring(0, simpleName.length() - "WorldGenProvider".length());
|
||||
|
||||
return simpleName;
|
||||
}
|
||||
|
||||
private String worldGenName(IWorldGenProvider provider) {
|
||||
if (provider == null)
|
||||
return null;
|
||||
|
||||
try {
|
||||
Method getName = provider.getClass().getMethod("getName");
|
||||
Object value = getName.invoke(provider);
|
||||
if (value instanceof String)
|
||||
return (String) value;
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
try {
|
||||
Field nameField = provider.getClass().getDeclaredField("name");
|
||||
nameField.setAccessible(true);
|
||||
Object value = nameField.get(provider);
|
||||
if (value instanceof String)
|
||||
return (String) value;
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,583 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Player-Expansion
|
||||
* Copyright (C) 2018 Ryan McCarthy
|
||||
*
|
||||
* 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 com.extendedclip.papi.expansion.player;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.expansion.Configurable;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.*;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.durability;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.format12;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.format24;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.getBiome;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.getCapitalizedBiome;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.getEmptySlots;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.getDirection;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.getTotalExperience;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.getXZDirection;
|
||||
import static com.extendedclip.papi.expansion.player.PlayerUtil.itemInHand;
|
||||
|
||||
public final class PlayerExpansion extends PlaceholderExpansion implements Configurable {
|
||||
|
||||
private String low;
|
||||
private String medium;
|
||||
private String high;
|
||||
|
||||
private int mediumValue;
|
||||
private int highValue;
|
||||
|
||||
private String north;
|
||||
private String northEast;
|
||||
private String east;
|
||||
private String southEast;
|
||||
private String south;
|
||||
private String southWest;
|
||||
private String west;
|
||||
private String northWest;
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
|
||||
return "player";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthor() {
|
||||
|
||||
return "clip";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
|
||||
return "2.0.9";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDefaults() {
|
||||
|
||||
Map<String, Object> defaults = new HashMap<>();
|
||||
defaults.put("ping_color.high", "&c");
|
||||
defaults.put("ping_color.medium", "&e");
|
||||
defaults.put("ping_color.low", "&a");
|
||||
defaults.put("ping_value.medium", 50);
|
||||
defaults.put("ping_value.high", 100);
|
||||
defaults.put("direction.north", "N");
|
||||
defaults.put("direction.north_east", "NE");
|
||||
defaults.put("direction.east", "E");
|
||||
defaults.put("direction.south_east", "SE");
|
||||
defaults.put("direction.south", "S");
|
||||
defaults.put("direction.south_west", "SW");
|
||||
defaults.put("direction.west", "W");
|
||||
defaults.put("direction.north_west", "NW");
|
||||
return defaults;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onRequest(OfflinePlayer player, String identifier) {
|
||||
|
||||
final boolean targetedPing = identifier.startsWith("ping_");
|
||||
final boolean targetedColoredPing = identifier.startsWith("colored_ping_");
|
||||
if (targetedPing || targetedColoredPing) {
|
||||
|
||||
final Player target = Bukkit.getPlayer(identifier.substring(targetedPing ? 5 : 13)); // yes, I know, magic
|
||||
// value
|
||||
|
||||
return target == null ? "0" : retrievePing(target, targetedColoredPing);
|
||||
|
||||
}
|
||||
|
||||
if (player == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
// offline placeholders
|
||||
switch (identifier) {
|
||||
|
||||
case "name":
|
||||
return player.getName();
|
||||
case "uuid":
|
||||
return player.getUniqueId().toString();
|
||||
case "has_played_before":
|
||||
return bool(player.hasPlayedBefore());
|
||||
case "online":
|
||||
return bool(player.isOnline());
|
||||
case "is_whitelisted":
|
||||
return bool(player.isWhitelisted());
|
||||
case "is_banned":
|
||||
return bool(player.isBanned());
|
||||
case "is_op":
|
||||
return bool(player.isOp());
|
||||
case "first_played":
|
||||
case "first_join":
|
||||
return String.valueOf(player.getFirstPlayed());
|
||||
case "first_played_formatted":
|
||||
case "first_join_date":
|
||||
return PlaceholderAPIPlugin.getDateFormat().format(new Date(player.getFirstPlayed()));
|
||||
case "last_played":
|
||||
case "last_join":
|
||||
return String.valueOf(player.getLastPlayed());
|
||||
case "last_played_formatted":
|
||||
case "last_join_date":
|
||||
return PlaceholderAPIPlugin.getDateFormat().format(new Date(player.getLastPlayed()));
|
||||
case "bed_x":
|
||||
return player.getBedSpawnLocation() != null ? String.valueOf(player.getBedSpawnLocation().getX()) : "";
|
||||
case "bed_y":
|
||||
return player.getBedSpawnLocation() != null ? String.valueOf(player.getBedSpawnLocation().getY()) : "";
|
||||
case "bed_z":
|
||||
return player.getBedSpawnLocation() != null ? String.valueOf(player.getBedSpawnLocation().getZ()) : "";
|
||||
case "bed_world":
|
||||
return player.getBedSpawnLocation() != null ? player.getBedSpawnLocation().getWorld().getName() : "";
|
||||
|
||||
}
|
||||
|
||||
// online placeholders
|
||||
if (!player.isOnline()) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
Player p = player.getPlayer();
|
||||
|
||||
// to get rid of IDE warnings
|
||||
if (p == null) {
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
if (identifier.startsWith("has_permission_")) {
|
||||
|
||||
if (identifier.split("has_permission_").length > 1) {
|
||||
|
||||
String perm = identifier.split("has_permission_")[1];
|
||||
return bool(p.hasPermission(perm));
|
||||
|
||||
}
|
||||
|
||||
return bool(false);
|
||||
|
||||
}
|
||||
|
||||
if (identifier.startsWith("has_potioneffect_")) {
|
||||
|
||||
if (identifier.split("has_potioneffect_").length > 1) {
|
||||
|
||||
String effect = identifier.split("has_potioneffect_")[1];
|
||||
PotionEffectType potion = PotionEffectType.getByName(effect);
|
||||
return bool(p.hasPotionEffect(potion));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (identifier.startsWith("item_in_hand_level_")) {
|
||||
|
||||
if (identifier.split("item_in_hand_level_").length > 1) {
|
||||
|
||||
String enchantment = identifier.split("item_in_hand_level_")[1];
|
||||
return String.valueOf(itemInHand(p).getEnchantmentLevel(Enchantment.getByName(enchantment)));
|
||||
|
||||
}
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
if (identifier.startsWith("item_in_offhand_level_")) {
|
||||
|
||||
if (identifier.split("item_in_offhand_level_").length > 1) {
|
||||
|
||||
String enchantment = identifier.split("item_in_offhand_level_")[1];
|
||||
return String.valueOf(
|
||||
p.getInventory().getItemInOffHand().getEnchantmentLevel(Enchantment.getByName(enchantment)));
|
||||
|
||||
}
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
if (identifier.startsWith("locale")) {
|
||||
|
||||
String localeStr = PlayerUtil.getLocale(p);
|
||||
String localeStrISO = localeStr.replace("_", "-");
|
||||
|
||||
switch (identifier) {
|
||||
|
||||
case "locale":
|
||||
return localeStr;
|
||||
case "locale_country":
|
||||
Locale locale = Locale.forLanguageTag(localeStrISO);
|
||||
if (locale == null)
|
||||
return "";
|
||||
return locale.getCountry();
|
||||
case "locale_display_country":
|
||||
locale = Locale.forLanguageTag(localeStrISO);
|
||||
if (locale == null)
|
||||
return "";
|
||||
return locale.getDisplayCountry();
|
||||
case "locale_display_name":
|
||||
locale = Locale.forLanguageTag(localeStrISO);
|
||||
if (locale == null)
|
||||
return "";
|
||||
return locale.getDisplayName();
|
||||
case "locale_short":
|
||||
return localeStr.substring(0, localeStr.indexOf("_"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch (identifier) {
|
||||
|
||||
case "absorption": {
|
||||
|
||||
if (VersionHelper.HAS_ABSORPTION_METHODS) {
|
||||
|
||||
return Integer.toString((int) p.getAbsorptionAmount());
|
||||
|
||||
} else {
|
||||
|
||||
return "-1";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
case "has_empty_slot":
|
||||
return bool(p.getInventory().firstEmpty() > -1);
|
||||
case "empty_slots":
|
||||
return String.valueOf(getEmptySlots(p));
|
||||
case "server":
|
||||
case "servername":
|
||||
return "now available in the server expansion";
|
||||
case "displayname":
|
||||
return p.getDisplayName();
|
||||
case "list_name":
|
||||
return p.getPlayerListName();
|
||||
case "gamemode":
|
||||
return p.getGameMode().name();
|
||||
case "direction":
|
||||
switch (getDirection(p)) {
|
||||
|
||||
case NORTH:
|
||||
return north;
|
||||
case NORTH_EAST:
|
||||
return northEast;
|
||||
case EAST:
|
||||
return east;
|
||||
case SOUTH_EAST:
|
||||
return southEast;
|
||||
case SOUTH:
|
||||
return south;
|
||||
case SOUTH_WEST:
|
||||
return southWest;
|
||||
case WEST:
|
||||
return west;
|
||||
case NORTH_WEST:
|
||||
return northWest;
|
||||
|
||||
}
|
||||
return "";
|
||||
case "direction_xz":
|
||||
return getXZDirection(p);
|
||||
case "world":
|
||||
return p.getWorld().getName();
|
||||
case "world_type":
|
||||
World.Environment environment = p.getWorld().getEnvironment();
|
||||
if (environment == World.Environment.NETHER) {
|
||||
|
||||
return "Nether";
|
||||
|
||||
} else if (environment == World.Environment.THE_END) {
|
||||
|
||||
return "The End";
|
||||
|
||||
} else if (environment == World.Environment.NORMAL) {
|
||||
|
||||
return "Overworld";
|
||||
|
||||
}
|
||||
return "";
|
||||
case "x":
|
||||
return String.valueOf(p.getLocation().getBlockX());
|
||||
case "x_long":
|
||||
return String.valueOf(p.getLocation().getX());
|
||||
case "y":
|
||||
return String.valueOf(p.getLocation().getBlockY());
|
||||
case "y_long":
|
||||
return String.valueOf(p.getLocation().getY());
|
||||
case "z":
|
||||
return String.valueOf(p.getLocation().getBlockZ());
|
||||
case "z_long":
|
||||
return String.valueOf(p.getLocation().getZ());
|
||||
case "yaw":
|
||||
return String.valueOf(p.getLocation().getYaw());
|
||||
case "pitch":
|
||||
return String.valueOf(p.getLocation().getPitch());
|
||||
case "biome":
|
||||
return getBiome(p);
|
||||
case "biome_capitalized":
|
||||
return getCapitalizedBiome(p);
|
||||
case "light_level":
|
||||
return String.valueOf(p.getLocation().getBlock().getLightLevel());
|
||||
case "ip":
|
||||
return p.getAddress().getAddress().getHostAddress();
|
||||
case "allow_flight":
|
||||
return bool(p.getAllowFlight());
|
||||
case "can_pickup_items":
|
||||
return bool(p.getCanPickupItems());
|
||||
case "compass_x":
|
||||
return p.getCompassTarget() != null ? String.valueOf(p.getCompassTarget().getBlockX()) : "";
|
||||
case "compass_y":
|
||||
return p.getCompassTarget() != null ? String.valueOf(p.getCompassTarget().getBlockY()) : "";
|
||||
case "compass_z":
|
||||
return p.getCompassTarget() != null ? String.valueOf(p.getCompassTarget().getBlockZ()) : "";
|
||||
case "compass_world":
|
||||
return p.getCompassTarget() != null ? p.getCompassTarget().getWorld().getName() : "";
|
||||
case "block_underneath":
|
||||
return String.valueOf(p.getLocation().clone().subtract(0, 1, 0).getBlock().getType());
|
||||
case "custom_name":
|
||||
return p.getCustomName() != null ? p.getCustomName() : p.getName();
|
||||
case "exp":
|
||||
return String.valueOf(p.getExp());
|
||||
case "current_exp":
|
||||
return String.valueOf(getTotalExperience(p));
|
||||
case "total_exp":
|
||||
return String.valueOf(p.getTotalExperience());
|
||||
case "exp_to_level":
|
||||
return String.valueOf(p.getExpToLevel());
|
||||
case "level":
|
||||
return String.valueOf(p.getLevel());
|
||||
case "fly_speed":
|
||||
return String.valueOf(p.getFlySpeed());
|
||||
case "food_level":
|
||||
return String.valueOf(p.getFoodLevel());
|
||||
case "health":
|
||||
return String.valueOf(p.getHealth());
|
||||
case "health_rounded":
|
||||
return String.valueOf(Math.round(p.getHealth()));
|
||||
case "health_scale":
|
||||
return String.valueOf(p.getHealthScale());
|
||||
case "has_health_boost":
|
||||
return bool(p.hasPotionEffect(PotionEffectType.HEALTH_BOOST));
|
||||
case "health_boost": {
|
||||
|
||||
if (p.getHealthScale() > 20) {
|
||||
|
||||
return Double.toString(p.getHealthScale() - 20);
|
||||
|
||||
} else {
|
||||
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
case "item_in_hand":
|
||||
return String.valueOf(itemInHand(p).getType());
|
||||
case "item_in_hand_name":
|
||||
return itemInHand(p).getType() != Material.AIR && itemInHand(p).getItemMeta().hasDisplayName()
|
||||
? itemInHand(p).getItemMeta().getDisplayName()
|
||||
: "";
|
||||
case "item_in_hand_data":
|
||||
return itemInHand(p).getType() != Material.AIR ? String.valueOf(itemInHand(p).getDurability()) : "0";
|
||||
case "item_in_hand_durability":
|
||||
return String.valueOf(durability(itemInHand(p)));
|
||||
case "item_in_offhand":
|
||||
return String.valueOf(p.getInventory().getItemInOffHand().getType());
|
||||
case "item_in_offhand_name":
|
||||
return p.getInventory().getItemInOffHand().getType() != Material.AIR
|
||||
&& p.getInventory().getItemInOffHand().getItemMeta().hasDisplayName()
|
||||
? p.getInventory().getItemInOffHand().getItemMeta().getDisplayName()
|
||||
: "";
|
||||
case "item_in_offhand_data":
|
||||
return p.getInventory().getItemInOffHand().getType() != Material.AIR
|
||||
? String.valueOf(p.getInventory().getItemInOffHand().getDurability())
|
||||
: "0";
|
||||
case "item_in_offhand_durability":
|
||||
return String.valueOf(durability(p.getInventory().getItemInOffHand()));
|
||||
case "last_damage":
|
||||
return String.valueOf(p.getLastDamage());
|
||||
case "max_health":
|
||||
return String.valueOf(p.getMaxHealth());
|
||||
case "max_health_rounded":
|
||||
return String.valueOf(Math.round(p.getMaxHealth()));
|
||||
case "max_air":
|
||||
return String.valueOf(p.getMaximumAir());
|
||||
case "max_no_damage_ticks":
|
||||
return String.valueOf(p.getMaximumNoDamageTicks());
|
||||
case "no_damage_ticks":
|
||||
return String.valueOf(p.getNoDamageTicks());
|
||||
case "armor_helmet_name":
|
||||
return Optional.ofNullable(p.getInventory().getHelmet())
|
||||
.flatMap(item -> Optional.ofNullable(item.getItemMeta())).map(meta -> meta.getDisplayName())
|
||||
.orElse("");
|
||||
case "armor_helmet_data":
|
||||
return p.getInventory().getHelmet() != null
|
||||
? String.valueOf(p.getInventory().getHelmet().getDurability())
|
||||
: "0";
|
||||
case "armor_helmet_durability":
|
||||
return String.valueOf(durability(p.getInventory().getHelmet()));
|
||||
case "armor_chestplate_name":
|
||||
return Optional.ofNullable(p.getInventory().getChestplate())
|
||||
.flatMap(item -> Optional.ofNullable(item.getItemMeta())).map(meta -> meta.getDisplayName())
|
||||
.orElse("");
|
||||
case "armor_chestplate_data":
|
||||
return p.getInventory().getChestplate() != null
|
||||
? String.valueOf(p.getInventory().getChestplate().getDurability())
|
||||
: "0";
|
||||
case "armor_chestplate_durability":
|
||||
return String.valueOf(durability(p.getInventory().getChestplate()));
|
||||
case "armor_leggings_name":
|
||||
return Optional.ofNullable(p.getInventory().getLeggings())
|
||||
.flatMap(item -> Optional.ofNullable(item.getItemMeta())).map(meta -> meta.getDisplayName())
|
||||
.orElse("");
|
||||
case "armor_leggings_data":
|
||||
return p.getInventory().getLeggings() != null
|
||||
? String.valueOf(p.getInventory().getLeggings().getDurability())
|
||||
: "0";
|
||||
case "armor_leggings_durability":
|
||||
return String.valueOf(durability(p.getInventory().getLeggings()));
|
||||
case "armor_boots_name":
|
||||
return Optional.ofNullable(p.getInventory().getBoots())
|
||||
.flatMap(item -> Optional.ofNullable(item.getItemMeta())).map(meta -> meta.getDisplayName())
|
||||
.orElse("");
|
||||
case "armor_boots_data":
|
||||
return p.getInventory().getBoots() != null ? String.valueOf(p.getInventory().getBoots().getDurability())
|
||||
: "0";
|
||||
case "armor_boots_durability":
|
||||
return String.valueOf(durability(p.getInventory().getBoots()));
|
||||
case "ping":
|
||||
return retrievePing(p, false);
|
||||
case "colored_ping":
|
||||
return retrievePing(p, true);
|
||||
case "time":
|
||||
return String.valueOf(p.getPlayerTime());
|
||||
case "time_offset":
|
||||
return String.valueOf(p.getPlayerTimeOffset());
|
||||
case "remaining_air":
|
||||
return String.valueOf(p.getRemainingAir());
|
||||
case "saturation":
|
||||
return String.valueOf(p.getSaturation());
|
||||
case "sleep_ticks":
|
||||
return String.valueOf(p.getSleepTicks());
|
||||
case "thunder_duration":
|
||||
return String.valueOf(p.getWorld().getThunderDuration());
|
||||
case "ticks_lived":
|
||||
return String.valueOf(p.getTicksLived());
|
||||
case "seconds_lived":
|
||||
return String.valueOf(p.getTicksLived() / 20);
|
||||
case "minutes_lived":
|
||||
return String.valueOf((p.getTicksLived() / 20) / 60);
|
||||
case "walk_speed":
|
||||
return String.valueOf(p.getWalkSpeed());
|
||||
case "weather_duration":
|
||||
return String.valueOf(p.getWorld().getWeatherDuration());
|
||||
case "world_time":
|
||||
return String.valueOf(p.getWorld().getTime());
|
||||
case "world_time_12":
|
||||
return format12(p.getWorld().getTime());
|
||||
case "world_time_24":
|
||||
return format24(p.getWorld().getTime());
|
||||
case "is_flying":
|
||||
return bool(p.isFlying());
|
||||
case "is_sleeping":
|
||||
return bool(p.isSleeping());
|
||||
case "is_conversing":
|
||||
return bool(p.isConversing());
|
||||
case "is_dead":
|
||||
return bool(p.isDead());
|
||||
case "is_sneaking":
|
||||
return bool(p.isSneaking());
|
||||
case "is_sprinting":
|
||||
return bool(p.isSprinting());
|
||||
case "is_leashed":
|
||||
return bool(p.isLeashed());
|
||||
case "is_inside_vehicle":
|
||||
return bool(p.isInsideVehicle());
|
||||
|
||||
}
|
||||
|
||||
// return null for unknown placeholders
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean register() {
|
||||
|
||||
low = this.getString("ping_color.low", "&a");
|
||||
medium = this.getString("ping_color.medium", "&e");
|
||||
high = this.getString("ping_color.high", "&c");
|
||||
mediumValue = this.getInt("ping_value.medium", 50);
|
||||
highValue = this.getInt("ping_value.high", 100);
|
||||
north = this.getString("direction.north", "N");
|
||||
northEast = this.getString("direction.north_east", "NE");
|
||||
east = this.getString("direction.east", "E");
|
||||
southEast = this.getString("direction.south_east", "SE");
|
||||
south = this.getString("direction.south", "S");
|
||||
southWest = this.getString("direction.south_west", "SW");
|
||||
west = this.getString("direction.west", "W");
|
||||
northWest = this.getString("direction.north_west", "NW");
|
||||
|
||||
return super.register();
|
||||
|
||||
}
|
||||
|
||||
public String bool(boolean b) {
|
||||
|
||||
return b ? PlaceholderAPIPlugin.booleanTrue() : PlaceholderAPIPlugin.booleanFalse();
|
||||
|
||||
}
|
||||
|
||||
private String retrievePing(final Player player, final boolean colored) {
|
||||
|
||||
final int ping = PlayerUtil.getPing(player);
|
||||
if (!colored) {
|
||||
|
||||
return String.valueOf(ping);
|
||||
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', ping > highValue ? high : ping > mediumValue ? medium : low)
|
||||
+ ping;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,383 +0,0 @@
|
||||
package com.extendedclip.papi.expansion.player;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/*
|
||||
*
|
||||
* Player-Expansion
|
||||
* Copyright (C) 2018 Ryan McCarthy
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class PlayerUtil {
|
||||
|
||||
public static final int ticksAtMidnight = 18000;
|
||||
public static final int ticksPerDay = 24000;
|
||||
public static final int ticksPerHour = 1000;
|
||||
public static final double ticksPerMinute = 1000d / 60d;
|
||||
private static final SimpleDateFormat twentyFour = new SimpleDateFormat("HH:mm", Locale.ENGLISH);
|
||||
private static final SimpleDateFormat twelve = new SimpleDateFormat("h:mm aa", Locale.ENGLISH);
|
||||
private static final BlockFace[] radial = { BlockFace.NORTH, BlockFace.NORTH_EAST, BlockFace.EAST,
|
||||
BlockFace.SOUTH_EAST, BlockFace.SOUTH, BlockFace.SOUTH_WEST, BlockFace.WEST, BlockFace.NORTH_WEST };
|
||||
|
||||
private PlayerUtil() {
|
||||
|
||||
}
|
||||
|
||||
private static final Function<Player, Integer> PLAYER_GET_PING = new Function<Player, Integer>() {
|
||||
|
||||
private Field ping;
|
||||
private Method getHandle;
|
||||
|
||||
@Override
|
||||
public Integer apply(final Player player) {
|
||||
|
||||
// 1.17 added Player#getPing, and we can use that directly
|
||||
if (VersionHelper.IS_1_17_OR_NEWER) {
|
||||
|
||||
return player.getPing();
|
||||
|
||||
}
|
||||
|
||||
// For versions before 1.17 we need to use reflection
|
||||
if (ping == null) {
|
||||
|
||||
try {
|
||||
|
||||
cacheReflection(player);
|
||||
|
||||
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException
|
||||
| NoSuchFieldException ex)
|
||||
{
|
||||
|
||||
ex.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
return ping.getInt(getHandle.invoke(player));
|
||||
|
||||
} catch (final IllegalAccessException | InvocationTargetException ex) {
|
||||
|
||||
PlaceholderAPIPlugin.getInstance().getLogger().log(Level.SEVERE,
|
||||
"Could not get the ping of " + player.getName() + ", using -1 as fallback value", ex);
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
private void cacheReflection(final Player player)
|
||||
throws NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException
|
||||
{
|
||||
|
||||
getHandle = player.getClass().getDeclaredMethod("getHandle");
|
||||
getHandle.setAccessible(true);
|
||||
|
||||
final Object entityPlayer = getHandle.invoke(player);
|
||||
ping = entityPlayer.getClass().getDeclaredField("ping");
|
||||
ping.setAccessible(true);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private static final Function<Player, String> PLAYER_GET_LOCALE = new Function<Player, String>() {
|
||||
|
||||
private Field locale;
|
||||
private Method getHandle;
|
||||
|
||||
@Override
|
||||
public String apply(final Player player) {
|
||||
|
||||
if (locale == null) {
|
||||
|
||||
try {
|
||||
|
||||
cacheReflection(player);
|
||||
|
||||
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException
|
||||
| NoSuchFieldException ex)
|
||||
{
|
||||
|
||||
ex.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
final Object entityPlayer = getHandle.invoke(player);
|
||||
return (String) locale.get(entityPlayer);
|
||||
|
||||
} catch (final IllegalAccessException | InvocationTargetException ex) {
|
||||
|
||||
PlaceholderAPIPlugin.getInstance().getLogger().log(Level.SEVERE,
|
||||
"Could not get the locale of " + player.getName() + ", using 'en_US' as fallback value", ex);
|
||||
|
||||
}
|
||||
|
||||
return "en_US";
|
||||
|
||||
}
|
||||
|
||||
private void cacheReflection(final Player player)
|
||||
throws NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException
|
||||
{
|
||||
|
||||
getHandle = player.getClass().getDeclaredMethod("getHandle");
|
||||
getHandle.setAccessible(true);
|
||||
|
||||
final Object entityPlayer = getHandle.invoke(player);
|
||||
|
||||
if (VersionHelper.IS_1_20_4_OR_NEWER) {
|
||||
|
||||
locale = entityPlayer.getClass().getField("cO");
|
||||
|
||||
} else if (VersionHelper.IS_1_20_2_OR_NEWER) {
|
||||
|
||||
locale = entityPlayer.getClass().getField("cM");
|
||||
|
||||
} else {
|
||||
|
||||
locale = entityPlayer.getClass().getField("locale");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public static int getPing(final Player player) {
|
||||
|
||||
return PLAYER_GET_PING.apply(player);
|
||||
|
||||
}
|
||||
|
||||
public static String getLocale(final Player player) {
|
||||
|
||||
return PLAYER_GET_LOCALE.apply(player);
|
||||
|
||||
}
|
||||
|
||||
public static String format12(long ticks) {
|
||||
|
||||
try {
|
||||
|
||||
return twelve.format(twentyFour.parse(ticksToTime(ticks)));
|
||||
|
||||
} catch (ParseException e) {
|
||||
|
||||
return ticksToTime(ticks);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String format24(long ticks) {
|
||||
|
||||
return ticksToTime(ticks);
|
||||
|
||||
}
|
||||
|
||||
private static String ticksToTime(long ticks) {
|
||||
|
||||
ticks = ticks - ticksAtMidnight + ticksPerDay;
|
||||
long hours = ticks / ticksPerHour;
|
||||
ticks -= hours * ticksPerHour;
|
||||
long mins = (long) Math.floor(ticks / ticksPerMinute);
|
||||
if (hours >= 24) {
|
||||
|
||||
hours = hours - 24;
|
||||
|
||||
}
|
||||
|
||||
return (hours < 10 ? "0" + hours : hours) + ":" + (mins < 10 ? "0" + mins : mins);
|
||||
|
||||
}
|
||||
|
||||
public static BlockFace getDirection(Player player) {
|
||||
|
||||
return radial[Math.round(player.getLocation().getYaw() / 45f) & 0x7].getOppositeFace();
|
||||
|
||||
}
|
||||
|
||||
public static String getXZDirection(Player player) {
|
||||
|
||||
double rotation = player.getLocation().getYaw();
|
||||
if (rotation < 0.0D) {
|
||||
|
||||
rotation += 360.0D;
|
||||
|
||||
}
|
||||
|
||||
if (Math.abs(rotation) <= 45 || Math.abs(rotation - 360) <= 45) {
|
||||
|
||||
return "+Z";
|
||||
|
||||
} else if (Math.abs(rotation - 90) <= 45) {
|
||||
|
||||
return "-X";
|
||||
|
||||
} else if (Math.abs(rotation - 180) <= 45) {
|
||||
|
||||
return "-Z";
|
||||
|
||||
} else if (Math.abs(rotation - 270) <= 45) {
|
||||
|
||||
return "+X";
|
||||
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
public static ItemStack itemInHand(Player p) {
|
||||
|
||||
try {
|
||||
|
||||
return p.getInventory().getItemInMainHand();
|
||||
|
||||
} catch (NoSuchMethodError e) {
|
||||
|
||||
return p.getInventory().getItemInHand();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static int durability(ItemStack item) {
|
||||
|
||||
return item != null ? item.getType().getMaxDurability() - item.getDurability() : 0;
|
||||
|
||||
}
|
||||
|
||||
public static int getEmptySlots(Player p) {
|
||||
|
||||
int slots = 0;
|
||||
PlayerInventory inv = p.getInventory();
|
||||
for (ItemStack is : inv.getContents()) {
|
||||
|
||||
if (is == null)
|
||||
slots++;
|
||||
|
||||
}
|
||||
|
||||
if (!Bukkit.getBukkitVersion().contains("1.7") && !Bukkit.getBukkitVersion().contains("1.8")) {
|
||||
|
||||
if (inv.getItemInOffHand() == null || inv.getItemInOffHand().getType() == Material.AIR)
|
||||
slots--;
|
||||
if (inv.getHelmet() == null)
|
||||
slots--;
|
||||
if (inv.getChestplate() == null)
|
||||
slots--;
|
||||
if (inv.getLeggings() == null)
|
||||
slots--;
|
||||
if (inv.getBoots() == null)
|
||||
slots--;
|
||||
|
||||
}
|
||||
|
||||
return slots;
|
||||
|
||||
}
|
||||
|
||||
private static int getExperienceAtLevel(int level) {
|
||||
|
||||
if (level <= 15) {
|
||||
|
||||
return (level << 1) + 7;
|
||||
|
||||
}
|
||||
|
||||
if (level <= 30) {
|
||||
|
||||
return (level * 5) - 38;
|
||||
|
||||
}
|
||||
|
||||
return (level * 9) - 158;
|
||||
|
||||
}
|
||||
|
||||
public static int getTotalExperience(Player player) {
|
||||
|
||||
int experience = Math.round(getExperienceAtLevel(player.getLevel()) * player.getExp());
|
||||
int currentLevel = player.getLevel();
|
||||
while (currentLevel > 0) {
|
||||
|
||||
currentLevel--;
|
||||
experience += getExperienceAtLevel(currentLevel);
|
||||
|
||||
}
|
||||
|
||||
if (experience < 0) {
|
||||
|
||||
experience = 0;
|
||||
|
||||
}
|
||||
|
||||
return experience;
|
||||
|
||||
}
|
||||
|
||||
public static String getBiome(Player p) {
|
||||
|
||||
if (VersionHelper.IS_1_21_3_OR_NEWER) {
|
||||
|
||||
return p.getLocation().getBlock().getBiome().name();
|
||||
|
||||
}
|
||||
|
||||
return String.valueOf(p.getLocation().getBlock().getBiome());
|
||||
|
||||
}
|
||||
|
||||
public static String getCapitalizedBiome(Player p) {
|
||||
|
||||
String[] biomeWords = getBiome(p).split("_");
|
||||
for (int i = 0; i < biomeWords.length; i++) {
|
||||
|
||||
biomeWords[i] = biomeWords[i].substring(0, 1).toUpperCase() + biomeWords[i].substring(1).toLowerCase();
|
||||
|
||||
}
|
||||
|
||||
return String.join(" ", biomeWords);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.extendedclip.papi.expansion.player;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Damageable;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author Matt (<a href="https://github.com/ipsk">@ipsk</a>)
|
||||
*/
|
||||
public final class VersionHelper {
|
||||
|
||||
private static final int VERSION = getCurrentVersion();
|
||||
|
||||
/**
|
||||
* @see Damageable#getAbsorptionAmount()
|
||||
*/
|
||||
public static final boolean HAS_ABSORPTION_METHODS = VERSION >= 1_15_0;
|
||||
|
||||
/**
|
||||
* @see Player#getPing()
|
||||
*/
|
||||
public static final boolean IS_1_17_OR_NEWER = VERSION >= 1_17_0;
|
||||
|
||||
/**
|
||||
* @see Player#getLocale()
|
||||
*/
|
||||
public static final boolean IS_1_20_2_OR_NEWER = VERSION >= 1_20_2;
|
||||
|
||||
/**
|
||||
* @see Player#getLocale()
|
||||
*/
|
||||
public static final boolean IS_1_20_4_OR_NEWER = VERSION >= 1_20_4;
|
||||
|
||||
public static final boolean IS_1_21_3_OR_NEWER = VERSION >= 1_21_3;
|
||||
|
||||
private VersionHelper() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current server version
|
||||
*
|
||||
* @return A protocol like number representing the version, for example 1.16.5 -
|
||||
* 1165
|
||||
*/
|
||||
private static int getCurrentVersion() {
|
||||
|
||||
// No need to cache since will only run once
|
||||
final Matcher matcher = Pattern.compile("(?<version>\\d+\\.\\d+)(?<patch>\\.\\d+)?")
|
||||
.matcher(Bukkit.getBukkitVersion());
|
||||
final StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
if (matcher.find()) {
|
||||
|
||||
final String patch = matcher.group("patch");
|
||||
|
||||
stringBuilder.append(matcher.group("version").replace(".", ""))
|
||||
.append((patch == null) ? "0" : patch.replace(".", ""));
|
||||
|
||||
}
|
||||
|
||||
final Integer version = Ints.tryParse(stringBuilder.toString());
|
||||
|
||||
// Should never fail
|
||||
if (version == null) {
|
||||
|
||||
throw new IllegalArgumentException("Could not retrieve server version!");
|
||||
|
||||
}
|
||||
|
||||
return version;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user