Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ec1668fa9
|
||
|
|
445dc8fecf
|
||
|
|
3a57cba63d
|
||
|
|
e78281fb1a | ||
|
|
4355eb072d | ||
|
|
321883174a | ||
|
|
97ed8ad6e2 | ||
|
|
cbcd7f5855 | ||
|
|
cf4416d562 | ||
|
|
f214bf44b3 | ||
|
|
e9d941e872 | ||
|
|
532fda45f3 | ||
|
|
2a4dd534a5 | ||
|
|
39d0e36e72 |
No files matched your search
@@ -0,0 +1 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -0,0 +1,3 @@
|
||||
# Pull requests request review from the eligible staff team(s).
|
||||
# One approval from either an Admin or Developer satisfies branch protection.
|
||||
* @trueog/Admins @trueog/Developers
|
||||
@@ -18,12 +18,14 @@ out/
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.checkstyle
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
.kotlin
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
}
|
||||
|
||||
group = 'com.artillexstudios.axsmithing'
|
||||
version = '1.6'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.alessiodp.com/releases/')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.viaversion.com')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.artillex-studios.com/releases')
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'net.byteflux:libby-bukkit:1.2.0'
|
||||
implementation 'com.artillexstudios.axapi:axapi:1.4.39'
|
||||
implementation 'org.bstats:bstats-bukkit:3.0.2'
|
||||
compileOnly 'com.google.code.gson:gson:2.10.1'
|
||||
compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.viaversion:viaversion-api:4.7.0'
|
||||
}
|
||||
|
||||
compileJava {
|
||||
dependsOn(clean)
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
processResources {
|
||||
filesMatching("plugin.yml") {
|
||||
expand(version: version)
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate("net.byteflux.libby", "com.artillexstudios.axsmithing.libs.libby")
|
||||
relocate("org.bstats", "com.artillexstudios.axsmithing.libs.bstats")
|
||||
relocate("com.artillexstudios.axapi", "com.artillexstudios.axsmithing.libs.axapi")
|
||||
minimize()
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/* ------------------------------ 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("com.gradleup.shadow") version "8.3.9" // Import Shadow 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.artillexstudios.axsmithing" // Declare bundle identifier.
|
||||
|
||||
version = "1.9" // Declare plugin version (will be in .jar).
|
||||
|
||||
/* ----------------------------- Resources ----------------------------- */
|
||||
tasks.named<ProcessResources>("processResources") {
|
||||
val props = mapOf("version" to version)
|
||||
inputs.properties(props) // Indicates to rerun if version changes.
|
||||
filesMatching("plugin.yml") { expand(props) }
|
||||
from("LICENSE") { into("/") } // Bundle license into jarfile.
|
||||
}
|
||||
|
||||
/* ---------------------------- Repos ---------------------------------- */
|
||||
repositories {
|
||||
mavenCentral() // Import the Maven Central Maven Repository.
|
||||
maven { url = uri("https://repo.alessiodp.com/releases/") } // Import the AlessioDP Maven Repository.
|
||||
maven {
|
||||
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
} // Import the SpigotMC Maven Repository.
|
||||
maven { url = uri("https://repo.viaversion.com") } // Import the ViaVersion Maven Repository.
|
||||
maven { url = uri("https://repo.artillex-studios.com/releases") } // Import the Artillex Studios Maven Repository.
|
||||
}
|
||||
|
||||
/* ---------------------- Java project deps ---------------------------- */
|
||||
dependencies {
|
||||
implementation("net.byteflux:libby-bukkit:1.2.0") // Import the Libby runtime dependency loader.
|
||||
implementation("com.artillexstudios.axapi:axapi:1.4.190:all") // Import the AxAPI library.
|
||||
compileOnly("com.google.code.gson:gson:2.10.1") // Import Gson (provided by the server at runtime).
|
||||
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT") // Import the Spigot API.
|
||||
compileOnly(
|
||||
"com.viaversion:viaversion-api:5.9.1"
|
||||
) // Import the ViaVersion API (closest official to trueog/ViaVersion 5.9.2-SNAPSHOT).
|
||||
}
|
||||
|
||||
apply(from = "eclipse.gradle.kts") // Import eclipse classpath support script.
|
||||
|
||||
/* ---------------------- Reproducible jars ---------------------------- */
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
/* ----------------------------- Shadow -------------------------------- */
|
||||
tasks.shadowJar {
|
||||
relocate("net.byteflux.libby", "com.artillexstudios.axsmithing.libs.libby") // Relocate Libby.
|
||||
relocate("com.artillexstudios.axapi", "com.artillexstudios.axsmithing.libs.axapi") // Relocate AxAPI.
|
||||
archiveClassifier.set("") // Use empty string instead of "all".
|
||||
}
|
||||
|
||||
tasks.jar { archiveClassifier.set("part") } // Applies to root jarfile only.
|
||||
|
||||
tasks.build { dependsOn(tasks.spotlessApply, tasks.shadowJar) } // Build depends on spotless and shadow.
|
||||
|
||||
/* --------------------------- 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", "eclipse.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.
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
<module name="Checker">
|
||||
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
<property name="severity" value="error"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="FinalLocalVariable"/>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="Indentation">
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
</module>
|
||||
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\borg\.junit\.jupiter\.api\.Assertions\.fail\s*\(\s*"Not yet implemented"\s*\)\s*;"/>
|
||||
<property name="message" value="Remove placeholder fail() and implement the test."/>
|
||||
<property name="ignoreCase" value="true"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="(?<!\w)fail\s*\(\s*"Not yet implemented"\s*\)\s*;"/>
|
||||
<property name="message" value="Remove placeholder fail() and implement the test."/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="23">
|
||||
<profile kind="CodeFormatterProfile" name="TrueOG Network Formatting" version="23">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.javadoc_do_not_separate_block_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case_after_arrow" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_arrows_in_switch_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow" value="20"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line_on_wrap"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -0,0 +1,27 @@
|
||||
/* This is free and unencumbered software released into the public domain */
|
||||
|
||||
import org.gradle.api.attributes.LibraryElements
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.gradle.plugins.ide.eclipse.model.EclipseModel
|
||||
|
||||
val eclipseModel = extensions.getByType<EclipseModel>()
|
||||
|
||||
eclipseModel.project.name = "${rootProject.name}-Plugin"
|
||||
|
||||
/* Expose compileOnly dependencies to the Eclipse classpath so the IDE resolves them. */
|
||||
fun Project.addResolvableEclipseConfigs() {
|
||||
val jarAttr = objects.named(LibraryElements::class, LibraryElements.JAR)
|
||||
val apiAttr = objects.named(Usage::class, Usage.JAVA_API)
|
||||
|
||||
val compileOnlyRes =
|
||||
configurations.create("eclipseCompileOnly") {
|
||||
extendsFrom(configurations.getByName("compileOnly"))
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
attributes.attribute(Usage.USAGE_ATTRIBUTE, apiAttr)
|
||||
attributes.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, jarAttr)
|
||||
}
|
||||
eclipseModel.classpath.plusConfigurations.add(compileOnlyRes)
|
||||
}
|
||||
|
||||
addResolvableEclipseConfigs()
|
||||
Vendored
BIN
Binary file not shown.
+3
-2
@@ -1,6 +1,7 @@
|
||||
#Sat Aug 19 14:47:24 CEST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -80,13 +82,11 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# 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"'
|
||||
# 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
|
||||
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -133,22 +133,29 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
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
|
||||
@@ -193,18 +200,28 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# 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" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-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.
|
||||
|
||||
Vendored
+94
-89
@@ -1,89 +1,94 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@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=.
|
||||
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%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="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!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,2 +0,0 @@
|
||||
rootProject.name = 'AxSmithing'
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
/* This is free and unencumbered software released into the public domain */
|
||||
|
||||
rootProject.name = "AxSmithing"
|
||||
@@ -7,7 +7,6 @@ import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.dumper.Du
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.general.GeneralSettings;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.loader.LoaderSettings;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.updater.UpdaterSettings;
|
||||
import com.artillexstudios.axapi.utils.Version;
|
||||
import com.artillexstudios.axsmithing.command.AxSmithingCommand;
|
||||
import com.artillexstudios.axsmithing.command.AxSmithingTabComplete;
|
||||
import com.artillexstudios.axsmithing.gui.SmithingTable;
|
||||
@@ -15,7 +14,6 @@ import com.artillexstudios.axsmithing.gui.impl.SmithingTable_V1_16;
|
||||
import com.artillexstudios.axsmithing.gui.impl.SmithingTable_V1_20;
|
||||
import com.artillexstudios.axsmithing.listener.InteractListener;
|
||||
import com.artillexstudios.axsmithing.listener.InventoryListener;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,26 +21,35 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class AxSmithingPlugin extends AxPlugin {
|
||||
|
||||
private static YamlDocument config;
|
||||
private static SmithingTable smithingTableImpl;
|
||||
private static AxSmithingPlugin instance;
|
||||
private static boolean v1_20 = false;
|
||||
|
||||
public static SmithingTable getSmithingTableImpl() {
|
||||
|
||||
return smithingTableImpl;
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static YamlDocument getConfiguration() {
|
||||
|
||||
return config;
|
||||
|
||||
}
|
||||
|
||||
public static AxSmithingPlugin getInstance() {
|
||||
|
||||
return instance;
|
||||
|
||||
}
|
||||
|
||||
public static boolean is1_20() {
|
||||
|
||||
return v1_20;
|
||||
|
||||
}
|
||||
|
||||
// TODO: Fix dependencies
|
||||
@@ -54,12 +61,20 @@ public class AxSmithingPlugin extends AxPlugin {
|
||||
|
||||
@Override
|
||||
public void enable() {
|
||||
|
||||
instance = this;
|
||||
new Metrics(this, 19575);
|
||||
try {
|
||||
config = YamlDocument.create(new File(this.getDataFolder(), "config.yml"), getResource("config.yml"), GeneralSettings.builder().setUseDefaults(false).build(), LoaderSettings.builder().setAutoUpdate(true).setDetailedErrors(true).build(), DumperSettings.DEFAULT, UpdaterSettings.builder().setVersioning(new BasicVersioning("config-version")).build());
|
||||
|
||||
config = YamlDocument.create(new File(this.getDataFolder(), "config.yml"), getResource("config.yml"),
|
||||
GeneralSettings.builder().setUseDefaults(false).build(),
|
||||
LoaderSettings.builder().setAutoUpdate(true).setDetailedErrors(true).build(),
|
||||
DumperSettings.DEFAULT,
|
||||
UpdaterSettings.builder().setVersioning(new BasicVersioning("config-version")).build());
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
initializeSmithingTableImpl();
|
||||
@@ -67,24 +82,38 @@ public class AxSmithingPlugin extends AxPlugin {
|
||||
Bukkit.getPluginManager().registerEvents(new InventoryListener(), this);
|
||||
Bukkit.getPluginCommand("axsmithing").setExecutor(new AxSmithingCommand());
|
||||
Bukkit.getPluginCommand("axsmithing").setTabCompleter(new AxSmithingTabComplete());
|
||||
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
|
||||
try {
|
||||
|
||||
config.reload();
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
initializeSmithingTableImpl();
|
||||
|
||||
}
|
||||
|
||||
private void initializeSmithingTableImpl() {
|
||||
if (Version.getServerVersion().isNewerThanOrEqualTo(Version.v1_20_1)) {
|
||||
|
||||
if (Bukkit.getBukkitVersion().startsWith("1.2")) {
|
||||
|
||||
v1_20 = true;
|
||||
smithingTableImpl = new SmithingTable_V1_20();
|
||||
|
||||
} else {
|
||||
|
||||
smithingTableImpl = new SmithingTable_V1_16();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,14 +10,23 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class AxSmithingCommand implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label,
|
||||
@NotNull String[] args)
|
||||
{
|
||||
|
||||
if (!sender.hasPermission("axsmithing.reload")) {
|
||||
sender.sendMessage(StringUtils.format(AxSmithingPlugin.getConfiguration().getString("messages.prefix") + AxSmithingPlugin.getConfiguration().getString("messages.no-permission")));
|
||||
|
||||
sender.sendMessage(StringUtils.format(AxSmithingPlugin.getConfiguration().getString("messages.prefix")
|
||||
+ AxSmithingPlugin.getConfiguration().getString("messages.no-permission")));
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
String took = String.valueOf(AxSmithingPlugin.getInstance().reloadWithTime());
|
||||
sender.sendMessage(StringUtils.format(AxSmithingPlugin.getConfiguration().getString("messages.prefix") + AxSmithingPlugin.getConfiguration().getString("messages.reload").replace("%time%", took)));
|
||||
sender.sendMessage(StringUtils.format(AxSmithingPlugin.getConfiguration().getString("messages.prefix")
|
||||
+ AxSmithingPlugin.getConfiguration().getString("messages.reload").replace("%time%", took)));
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,12 @@ public class AxSmithingTabComplete implements TabCompleter {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label,
|
||||
@NotNull String[] args)
|
||||
{
|
||||
|
||||
return List.of("reload");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import java.util.Map;
|
||||
public class DependencyManager {
|
||||
|
||||
public void load(JavaPlugin plugin, InputStream stream) {
|
||||
|
||||
BukkitLibraryManager manager = new BukkitLibraryManager(plugin, "libraries");
|
||||
manager.addMavenCentral();
|
||||
manager.addMavenLocal();
|
||||
@@ -29,17 +30,26 @@ public class DependencyManager {
|
||||
Object dep = read.get("dependencies");
|
||||
|
||||
if (rep instanceof ArrayList<?> repositories) {
|
||||
|
||||
for (Object repository : repositories) {
|
||||
if (repository instanceof LinkedTreeMap<?,?> repos) {
|
||||
|
||||
if (repository instanceof LinkedTreeMap<?, ?> repos) {
|
||||
|
||||
String url = (String) repos.get("url");
|
||||
manager.addRepository(url);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (dep instanceof ArrayList<?> libraries) {
|
||||
|
||||
for (Object o : libraries) {
|
||||
if (o instanceof LinkedTreeMap<?,?> map) {
|
||||
|
||||
if (o instanceof LinkedTreeMap<?, ?> map) {
|
||||
|
||||
String group = (String) map.get("group");
|
||||
String artifact = (String) map.get("artifact");
|
||||
String version = (String) map.get("version");
|
||||
@@ -47,17 +57,26 @@ public class DependencyManager {
|
||||
Library.Builder builder = Library.builder().groupId(group).artifactId(artifact).version(version);
|
||||
|
||||
if (map.containsKey("relocate")) {
|
||||
LinkedTreeMap<?, ?> relocate = (LinkedTreeMap<?,?>) map.get("relocate");
|
||||
|
||||
LinkedTreeMap<?, ?> relocate = (LinkedTreeMap<?, ?>) map.get("relocate");
|
||||
builder.relocate((String) relocate.get("from"), (String) relocate.get("to"));
|
||||
|
||||
}
|
||||
|
||||
if (map.containsKey("isolated")) {
|
||||
|
||||
builder.isolatedLoad((Boolean) map.get("isolated"));
|
||||
|
||||
}
|
||||
|
||||
manager.loadLibrary(builder.build());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,5 @@ public interface SmithingTable {
|
||||
void handleClose(InventoryCloseEvent event);
|
||||
|
||||
void handleDrag(InventoryDragEvent event);
|
||||
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import com.artillexstudios.axsmithing.utils.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
@@ -31,6 +30,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
|
||||
private final int outputSlot;
|
||||
private final int upgradeSlot;
|
||||
private final int itemSlot;
|
||||
@@ -40,6 +40,7 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
private final Field resultField;
|
||||
|
||||
public SmithingTable_V1_16() {
|
||||
|
||||
YamlDocument config = AxSmithingPlugin.getConfiguration();
|
||||
outputSlot = config.getInt("menu.1_16.output-slot");
|
||||
upgradeSlot = config.getInt("menu.1_16.upgrade-slot");
|
||||
@@ -47,261 +48,394 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
dontConvertWithModelData = config.getBoolean("menu.1_16.dont-convert-with-modeldata");
|
||||
|
||||
try {
|
||||
|
||||
baseField = SmithingRecipe.class.getDeclaredField("base");
|
||||
baseField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
additionField = SmithingRecipe.class.getDeclaredField("addition");
|
||||
additionField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
resultField = SmithingRecipe.class.getDeclaredField("result");
|
||||
resultField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(Player player) {
|
||||
Inventory inventory = Bukkit.createInventory(this, AxSmithingPlugin.getConfiguration().getInt("menu.1_16.rows") * 9, StringUtils.format(AxSmithingPlugin.getConfiguration().getString("menu.1_16.title")));
|
||||
|
||||
Inventory inventory = Bukkit.createInventory(this,
|
||||
AxSmithingPlugin.getConfiguration().getInt("menu.1_16.rows") * 9,
|
||||
StringUtils.format(AxSmithingPlugin.getConfiguration().getString("menu.1_16.title")));
|
||||
Set<Object> items = AxSmithingPlugin.getConfiguration().getSection("menu.1_16.items").getKeys();
|
||||
|
||||
for (Object item : items) {
|
||||
Section section = AxSmithingPlugin.getConfiguration().getSection("menu.1_16.items").getSection(item.toString());
|
||||
|
||||
Section section = AxSmithingPlugin.getConfiguration().getSection("menu.1_16.items")
|
||||
.getSection(item.toString());
|
||||
List<String> slots = section.getStringList("slots");
|
||||
ItemStack itemStack = new ItemBuilder(section, Map.of()).getItem();
|
||||
|
||||
for (Integer slot : slots(slots)) {
|
||||
|
||||
inventory.setItem(slot, itemStack);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
player.openInventory(inventory);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClick(InventoryClickEvent event) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16)) return;
|
||||
|
||||
if ((event.getSlot() == upgradeSlot || event.getSlot() == itemSlot) && event.getInventory().getItem(outputSlot) != null) {
|
||||
if (checkRecipes(event.getInventory(), event.getInventory().getItem(itemSlot), event.getInventory().getItem(upgradeSlot))) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16))
|
||||
return;
|
||||
|
||||
if ((event.getSlot() == upgradeSlot || event.getSlot() == itemSlot)
|
||||
&& event.getInventory().getItem(outputSlot) != null)
|
||||
{
|
||||
|
||||
if (checkRecipes(event.getInventory(), event.getInventory().getItem(itemSlot),
|
||||
event.getInventory().getItem(upgradeSlot)))
|
||||
{
|
||||
|
||||
event.getInventory().setItem(outputSlot, null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (event.getClickedInventory() == event.getView().getTopInventory()) {
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
|
||||
if (event.getSlot() == itemSlot || event.getSlot() == upgradeSlot) {
|
||||
|
||||
event.setCancelled(false);
|
||||
|
||||
}
|
||||
|
||||
if (event.getSlot() == outputSlot && event.getCurrentItem() != null && (event.getCursor() == null || (event.getCursor() != null && event.getCursor().getType().equals(Material.AIR)))) {
|
||||
if (event.getSlot() == outputSlot && event.getCurrentItem() != null && (event.getCursor() == null
|
||||
|| (event.getCursor() != null && event.getCursor().getType().equals(Material.AIR))))
|
||||
{
|
||||
|
||||
event.setCancelled(false);
|
||||
|
||||
}
|
||||
|
||||
if (event.getSlot() == outputSlot && event.getView().getTopInventory().getItem(outputSlot) != null && event.getView().getTopInventory().getItem(outputSlot).getType() != Material.AIR) {
|
||||
if (event.getSlot() == outputSlot && event.getView().getTopInventory().getItem(outputSlot) != null
|
||||
&& event.getView().getTopInventory().getItem(outputSlot).getType() != Material.AIR)
|
||||
{
|
||||
|
||||
int amount;
|
||||
if (event.getInventory().getItem(itemSlot) != null) {
|
||||
|
||||
amount = event.getInventory().getItem(itemSlot).getAmount() - 1;
|
||||
ItemStack item = event.getInventory().getItem(itemSlot);
|
||||
item.setAmount(amount);
|
||||
event.getInventory().setItem(itemSlot, item);
|
||||
((Player) event.getWhoClicked()).updateInventory();
|
||||
|
||||
}
|
||||
|
||||
if (event.getInventory().getItem(upgradeSlot) != null) {
|
||||
|
||||
amount = event.getInventory().getItem(upgradeSlot).getAmount() - 1;
|
||||
ItemStack item = event.getInventory().getItem(upgradeSlot);
|
||||
item.setAmount(amount);
|
||||
event.getInventory().setItem(upgradeSlot, item);
|
||||
((Player) event.getWhoClicked()).updateInventory();
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
updateGui(event.getInventory());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClose(InventoryCloseEvent event) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16)) return;
|
||||
|
||||
if (event.getInventory().getItem(itemSlot) != null && event.getInventory().getItem(itemSlot).getType() != Material.AIR)
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16))
|
||||
return;
|
||||
|
||||
if (event.getInventory().getItem(itemSlot) != null
|
||||
&& event.getInventory().getItem(itemSlot).getType() != Material.AIR)
|
||||
event.getPlayer().getInventory().addItem(event.getInventory().getItem(itemSlot));
|
||||
if (event.getInventory().getItem(upgradeSlot) != null && event.getInventory().getItem(upgradeSlot).getType() != Material.AIR)
|
||||
if (event.getInventory().getItem(upgradeSlot) != null
|
||||
&& event.getInventory().getItem(upgradeSlot).getType() != Material.AIR)
|
||||
event.getPlayer().getInventory().addItem(event.getInventory().getItem(upgradeSlot));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDrag(InventoryDragEvent event) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16)) return;
|
||||
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16))
|
||||
return;
|
||||
|
||||
ItemStack outputItem = event.getInventory().getItem(outputSlot);
|
||||
if (event.getRawSlots().contains(outputSlot) && (outputItem == null || outputItem.getType().isAir()) && !event.getOldCursor().getType().isAir()) {
|
||||
if (event.getRawSlots().contains(outputSlot) && (outputItem == null || outputItem.getType().isAir())
|
||||
&& !event.getOldCursor().getType().isAir())
|
||||
{
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (event.getInventory().getItem(outputSlot) != null && event.getInventory().getItem(outputSlot).getType() != Material.AIR) {
|
||||
if (event.getInventory().getItem(outputSlot) != null
|
||||
&& event.getInventory().getItem(outputSlot).getType() != Material.AIR)
|
||||
{
|
||||
|
||||
event.getInventory().getItem(outputSlot).setAmount(0);
|
||||
|
||||
}
|
||||
|
||||
updateGui(event.getInventory());
|
||||
|
||||
}
|
||||
|
||||
public List<Integer> slots(@NotNull List<String> strings) {
|
||||
|
||||
List<Integer> returnedSlots = new ArrayList<>();
|
||||
|
||||
for (String s : strings) {
|
||||
|
||||
if (s.contains("-")) {
|
||||
|
||||
String[] splitS = s.split("-");
|
||||
returnedSlots.addAll(getSlots(Integer.parseInt(splitS[0]), Integer.parseInt(splitS[1])));
|
||||
|
||||
} else {
|
||||
|
||||
returnedSlots.add(Integer.parseInt(s));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return returnedSlots;
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<Integer> getSlots(int small, int max) {
|
||||
|
||||
List<Integer> slots = new ArrayList<>();
|
||||
|
||||
for (int i = small; i <= max; i++) slots.add(i);
|
||||
for (int i = small; i <= max; i++)
|
||||
slots.add(i);
|
||||
return slots;
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
private void updateGui(Inventory inv) {
|
||||
|
||||
Scheduler.get().runLater(t -> {
|
||||
|
||||
ItemStack base = inv.getItem(itemSlot);
|
||||
ItemStack addition = inv.getItem(upgradeSlot);
|
||||
if (addition == null || addition.getType().isAir()) {
|
||||
|
||||
addition = new ItemStack(Material.AIR);
|
||||
|
||||
}
|
||||
|
||||
if (base == null || base.getType().isAir()) {
|
||||
|
||||
base = new ItemStack(Material.AIR);
|
||||
|
||||
}
|
||||
|
||||
ItemStack finalAddition = addition;
|
||||
ItemStack finalBase = base;
|
||||
|
||||
checkRecipes(inv, finalBase, finalAddition);
|
||||
|
||||
}, 1L);
|
||||
|
||||
}
|
||||
|
||||
private boolean checkRecipes(Inventory inv, ItemStack finalBase, ItemStack finalAddition) {
|
||||
|
||||
boolean successful = checkRecipe(inv, finalBase, finalAddition);
|
||||
|
||||
if (!successful) {
|
||||
|
||||
successful = checkRecipe(inv, finalAddition, finalBase);
|
||||
|
||||
}
|
||||
|
||||
return successful;
|
||||
|
||||
}
|
||||
|
||||
private boolean checkRecipe(Inventory inventory, ItemStack finalBase, ItemStack finalAddition) {
|
||||
|
||||
Iterator<Recipe> recipeIterator = Bukkit.getServer().recipeIterator();
|
||||
while (recipeIterator.hasNext()) {
|
||||
|
||||
inventory.setItem(outputSlot, new ItemStack(Material.AIR));
|
||||
Recipe recipe = recipeIterator.next();
|
||||
|
||||
if (recipe instanceof SmithingRecipe smithingRecipe) {
|
||||
|
||||
RecipeChoice base = getBase(smithingRecipe);
|
||||
RecipeChoice addition = getAddition(smithingRecipe);
|
||||
if (base == null || addition == null) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
boolean test1 = base.test(finalBase);
|
||||
ItemMeta baseItemMeta = finalBase.getItemMeta();
|
||||
if (baseItemMeta == null) return false;
|
||||
if (baseItemMeta == null)
|
||||
return false;
|
||||
boolean test2 = addition.test(finalAddition);
|
||||
|
||||
if (dontConvertWithModelData && baseItemMeta.hasCustomModelData()) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (test1 && test2) {
|
||||
|
||||
ItemStack item = getResult(smithingRecipe);
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
ItemStack it;
|
||||
if ((it = inventory.getItem(outputSlot)) != null && it.getType() == item.getType()) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
item.setItemMeta(baseItemMeta);
|
||||
inventory.setItem(outputSlot, item);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
inventory.setItem(outputSlot, new ItemStack(Material.AIR));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public RecipeChoice getBase(SmithingRecipe recipe) {
|
||||
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
|
||||
recipeChoice = (RecipeChoice) baseField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
|
||||
}
|
||||
|
||||
public RecipeChoice getAddition(SmithingRecipe recipe) {
|
||||
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
|
||||
recipeChoice = (RecipeChoice) additionField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
|
||||
}
|
||||
|
||||
public ItemStack getResult(SmithingRecipe recipe) {
|
||||
|
||||
ItemStack result;
|
||||
try {
|
||||
|
||||
result = (ItemStack) resultField.get(recipe);
|
||||
if (result == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return result.clone();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import com.artillexstudios.axsmithing.utils.ItemBuilder;
|
||||
import com.artillexstudios.axsmithing.utils.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
@@ -33,10 +35,12 @@ import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
|
||||
private final int outputSlot;
|
||||
private final int upgradeSlot;
|
||||
private final int itemSlot;
|
||||
@@ -49,6 +53,7 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
private final Field resultField;
|
||||
|
||||
public SmithingTable_V1_20() {
|
||||
|
||||
YamlDocument config = AxSmithingPlugin.getConfiguration();
|
||||
outputSlot = config.getInt("menu.1_20.output-slot");
|
||||
upgradeSlot = config.getInt("menu.1_20.upgrade-slot");
|
||||
@@ -57,198 +62,309 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
needNetheriteTemplate = config.getBoolean("menu.1_20.need-netherite-template");
|
||||
dontConvertWithModelData = config.getBoolean("menu.1_20.dont-convert-with-modeldata");
|
||||
try {
|
||||
|
||||
templateField = SmithingTransformRecipe.class.getDeclaredField("template");
|
||||
templateField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
baseField = SmithingRecipe.class.getDeclaredField("base");
|
||||
baseField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
additionField = SmithingRecipe.class.getDeclaredField("addition");
|
||||
additionField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
resultField = SmithingRecipe.class.getDeclaredField("result");
|
||||
resultField.setAccessible(true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(Player player) {
|
||||
Inventory inventory = Bukkit.createInventory(this, AxSmithingPlugin.getConfiguration().getInt("menu.1_20.rows") * 9, StringUtils.format(AxSmithingPlugin.getConfiguration().getString("menu.1_20.title")));
|
||||
|
||||
Inventory inventory = Bukkit.createInventory(this,
|
||||
AxSmithingPlugin.getConfiguration().getInt("menu.1_20.rows") * 9,
|
||||
StringUtils.format(AxSmithingPlugin.getConfiguration().getString("menu.1_20.title")));
|
||||
Set<Object> items = AxSmithingPlugin.getConfiguration().getSection("menu.1_20.items").getKeys();
|
||||
|
||||
for (Object item : items) {
|
||||
Section section = AxSmithingPlugin.getConfiguration().getSection("menu.1_20.items").getSection(item.toString());
|
||||
|
||||
Section section = AxSmithingPlugin.getConfiguration().getSection("menu.1_20.items")
|
||||
.getSection(item.toString());
|
||||
List<String> slots = section.getStringList("slots");
|
||||
ItemStack itemStack = new ItemBuilder(section, Map.of()).getItem();
|
||||
|
||||
for (Integer slot : slots(slots)) {
|
||||
|
||||
inventory.setItem(slot, itemStack);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
player.openInventory(inventory);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClick(InventoryClickEvent event) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20)) return;
|
||||
|
||||
if ((event.getSlot() == upgradeSlot || event.getSlot() == itemSlot || event.getSlot() == templateSlot) && event.getInventory().getItem(outputSlot) != null) {
|
||||
if (checkRecipes(event.getInventory(), event.getInventory().getItem(templateSlot), event.getInventory().getItem(itemSlot), event.getInventory().getItem(upgradeSlot))) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20))
|
||||
return;
|
||||
|
||||
if ((event.getSlot() == upgradeSlot || event.getSlot() == itemSlot || event.getSlot() == templateSlot)
|
||||
&& event.getInventory().getItem(outputSlot) != null)
|
||||
{
|
||||
|
||||
if (checkRecipes(event.getInventory(), event.getInventory().getItem(templateSlot),
|
||||
event.getInventory().getItem(itemSlot), event.getInventory().getItem(upgradeSlot)))
|
||||
{
|
||||
|
||||
event.getInventory().setItem(outputSlot, null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (event.getClickedInventory() == event.getView().getTopInventory()) {
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
|
||||
if (event.getSlot() == itemSlot || event.getSlot() == upgradeSlot || event.getSlot() == templateSlot) {
|
||||
|
||||
event.setCancelled(false);
|
||||
|
||||
}
|
||||
|
||||
if (event.getSlot() == outputSlot && event.getCurrentItem() != null && (event.getCursor() == null || (event.getCursor() != null && event.getCursor().getType().equals(Material.AIR)))) {
|
||||
if (event.getSlot() == outputSlot && event.getCurrentItem() != null && (event.getCursor() == null
|
||||
|| (event.getCursor() != null && event.getCursor().getType().equals(Material.AIR))))
|
||||
{
|
||||
|
||||
event.setCancelled(false);
|
||||
|
||||
}
|
||||
|
||||
if (event.getSlot() == outputSlot && event.getView().getTopInventory().getItem(outputSlot) != null && event.getView().getTopInventory().getItem(outputSlot).getType() != Material.AIR) {
|
||||
if (event.getSlot() == outputSlot && event.getView().getTopInventory().getItem(outputSlot) != null
|
||||
&& event.getView().getTopInventory().getItem(outputSlot).getType() != Material.AIR)
|
||||
{
|
||||
|
||||
int amount;
|
||||
if (event.getInventory().getItem(templateSlot) != null) {
|
||||
|
||||
amount = event.getInventory().getItem(templateSlot).getAmount() - 1;
|
||||
if (amount == 0) {
|
||||
|
||||
event.getInventory().setItem(templateSlot, null);
|
||||
|
||||
} else {
|
||||
|
||||
event.getInventory().getItem(templateSlot).setAmount(amount);
|
||||
|
||||
}
|
||||
|
||||
((Player) event.getWhoClicked()).updateInventory();
|
||||
|
||||
}
|
||||
|
||||
if (event.getInventory().getItem(itemSlot) != null) {
|
||||
|
||||
amount = event.getInventory().getItem(itemSlot).getAmount() - 1;
|
||||
if (amount == 0) {
|
||||
|
||||
event.getInventory().setItem(itemSlot, null);
|
||||
|
||||
} else {
|
||||
|
||||
event.getInventory().getItem(itemSlot).setAmount(amount);
|
||||
|
||||
}
|
||||
|
||||
((Player) event.getWhoClicked()).updateInventory();
|
||||
|
||||
}
|
||||
|
||||
if (event.getInventory().getItem(upgradeSlot) != null) {
|
||||
|
||||
amount = event.getInventory().getItem(upgradeSlot).getAmount() - 1;
|
||||
if (amount == 0) {
|
||||
|
||||
event.getInventory().setItem(upgradeSlot, null);
|
||||
|
||||
} else {
|
||||
|
||||
event.getInventory().getItem(upgradeSlot).setAmount(amount);
|
||||
|
||||
}
|
||||
|
||||
((Player) event.getWhoClicked()).updateInventory();
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
updateGui(event.getInventory());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClose(InventoryCloseEvent event) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20)) return;
|
||||
|
||||
if (event.getInventory().getItem(templateSlot) != null && event.getInventory().getItem(templateSlot).getType() != Material.AIR)
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20))
|
||||
return;
|
||||
|
||||
if (event.getInventory().getItem(templateSlot) != null
|
||||
&& event.getInventory().getItem(templateSlot).getType() != Material.AIR)
|
||||
event.getPlayer().getInventory().addItem(event.getInventory().getItem(templateSlot));
|
||||
if (event.getInventory().getItem(itemSlot) != null && event.getInventory().getItem(itemSlot).getType() != Material.AIR)
|
||||
if (event.getInventory().getItem(itemSlot) != null
|
||||
&& event.getInventory().getItem(itemSlot).getType() != Material.AIR)
|
||||
event.getPlayer().getInventory().addItem(event.getInventory().getItem(itemSlot));
|
||||
if (event.getInventory().getItem(upgradeSlot) != null && event.getInventory().getItem(upgradeSlot).getType() != Material.AIR)
|
||||
if (event.getInventory().getItem(upgradeSlot) != null
|
||||
&& event.getInventory().getItem(upgradeSlot).getType() != Material.AIR)
|
||||
event.getPlayer().getInventory().addItem(event.getInventory().getItem(upgradeSlot));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDrag(InventoryDragEvent event) {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20)) return;
|
||||
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20))
|
||||
return;
|
||||
|
||||
ItemStack outputItem = event.getInventory().getItem(outputSlot);
|
||||
if (event.getRawSlots().contains(outputSlot) && (outputItem == null || outputItem.getType().isAir()) && !event.getOldCursor().getType().isAir()) {
|
||||
if (event.getRawSlots().contains(outputSlot) && (outputItem == null || outputItem.getType().isAir())
|
||||
&& !event.getOldCursor().getType().isAir())
|
||||
{
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (event.getInventory().getItem(outputSlot) != null) {
|
||||
|
||||
event.getInventory().getItem(outputSlot).setAmount(0);
|
||||
|
||||
}
|
||||
|
||||
updateGui(event.getInventory());
|
||||
|
||||
}
|
||||
|
||||
public List<Integer> slots(@NotNull List<String> strings) {
|
||||
|
||||
List<Integer> returnedSlots = new ArrayList<>();
|
||||
|
||||
for (String s : strings) {
|
||||
|
||||
if (s.contains("-")) {
|
||||
|
||||
String[] splitS = s.split("-");
|
||||
returnedSlots.addAll(getSlots(Integer.parseInt(splitS[0]), Integer.parseInt(splitS[1])));
|
||||
|
||||
} else {
|
||||
|
||||
returnedSlots.add(Integer.parseInt(s));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return returnedSlots;
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<Integer> getSlots(int small, int max) {
|
||||
|
||||
List<Integer> slots = new ArrayList<>();
|
||||
|
||||
for (int i = small; i <= max; i++) slots.add(i);
|
||||
for (int i = small; i <= max; i++)
|
||||
slots.add(i);
|
||||
return slots;
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
private void updateGui(Inventory inv) {
|
||||
|
||||
Scheduler.get().runLater(t -> {
|
||||
|
||||
ItemStack template = inv.getItem(templateSlot);
|
||||
ItemStack base = inv.getItem(itemSlot);
|
||||
ItemStack addition = inv.getItem(upgradeSlot);
|
||||
if (addition == null || addition.getType().isAir()) {
|
||||
|
||||
addition = new ItemStack(Material.AIR);
|
||||
|
||||
}
|
||||
|
||||
if (base == null || base.getType().isAir()) {
|
||||
|
||||
base = new ItemStack(Material.AIR);
|
||||
|
||||
}
|
||||
|
||||
if (template == null || template.getType().isAir()) {
|
||||
|
||||
template = new ItemStack(Material.AIR);
|
||||
|
||||
}
|
||||
|
||||
if (!needNetheriteTemplate && !hasTemplate(addition, base, template)) {
|
||||
|
||||
if (template.getType().isAir()) {
|
||||
|
||||
template = new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
|
||||
} else if (base.getType().isAir()) {
|
||||
|
||||
base = new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
|
||||
} else if (addition.getType().isAir()) {
|
||||
|
||||
addition = new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ItemStack finalTemplate = template;
|
||||
@@ -257,190 +373,274 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
|
||||
// Very very very ugly solution, but I guess, it works!
|
||||
checkRecipes(inv, finalTemplate, finalBase, finalAddition);
|
||||
|
||||
}, 1L);
|
||||
|
||||
}
|
||||
|
||||
private boolean checkRecipes(Inventory inv, ItemStack finalTemplate, ItemStack finalBase, ItemStack finalAddition) {
|
||||
|
||||
boolean successful = checkRecipe(inv, finalBase, finalAddition, finalTemplate);
|
||||
if (!successful) {
|
||||
|
||||
successful = checkRecipe(inv, finalBase, finalTemplate, finalAddition);
|
||||
|
||||
}
|
||||
|
||||
if (!successful) {
|
||||
|
||||
successful = checkRecipe(inv, finalTemplate, finalBase, finalAddition);
|
||||
|
||||
}
|
||||
|
||||
if (!successful) {
|
||||
|
||||
successful = checkRecipe(inv, finalTemplate, finalAddition, finalBase);
|
||||
|
||||
}
|
||||
|
||||
if (!successful) {
|
||||
|
||||
successful = checkRecipe(inv, finalAddition, finalBase, finalTemplate);
|
||||
|
||||
}
|
||||
|
||||
if (!successful) {
|
||||
|
||||
successful = checkRecipe(inv, finalAddition, finalTemplate, finalBase);
|
||||
|
||||
}
|
||||
|
||||
return successful;
|
||||
|
||||
}
|
||||
|
||||
private boolean hasTemplate(ItemStack item1, ItemStack item2, ItemStack item3) {
|
||||
|
||||
if (isTemplate(item1)) {
|
||||
|
||||
return true;
|
||||
|
||||
} else if (isTemplate(item2)) {
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return isTemplate(item3);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean isTemplate(ItemStack item) {
|
||||
return switch (item.getType()) {
|
||||
case COAST_ARMOR_TRIM_SMITHING_TEMPLATE, SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, EYE_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, HOST_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
RIB_ARMOR_TRIM_SMITHING_TEMPLATE, SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, TIDE_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
VEX_ARMOR_TRIM_SMITHING_TEMPLATE, WARD_ARMOR_TRIM_SMITHING_TEMPLATE,
|
||||
WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, NETHERITE_UPGRADE_SMITHING_TEMPLATE -> true;
|
||||
default -> false;
|
||||
};
|
||||
|
||||
return item.getType().name().contains("SMITHING_TEMPLATE");
|
||||
|
||||
}
|
||||
|
||||
private boolean checkRecipe(Inventory inventory, ItemStack finalTemplate, ItemStack finalBase, ItemStack finalAddition) {
|
||||
private boolean checkRecipe(Inventory inventory, ItemStack finalTemplate, ItemStack finalBase,
|
||||
ItemStack finalAddition)
|
||||
{
|
||||
|
||||
Iterator<Recipe> recipeIterator = Bukkit.getServer().recipeIterator();
|
||||
while (recipeIterator.hasNext()) {
|
||||
|
||||
Recipe recipe = recipeIterator.next();
|
||||
|
||||
if (recipe instanceof SmithingTrimRecipe trimRecipe) {
|
||||
if (finalBase == null || finalAddition == null || finalTemplate == null) return false;
|
||||
|
||||
if (finalBase == null || finalAddition == null || finalTemplate == null)
|
||||
return false;
|
||||
boolean test1 = trimRecipe.getTemplate().test(finalTemplate);
|
||||
boolean test2 = trimRecipe.getBase().test(finalBase);
|
||||
boolean test3 = trimRecipe.getAddition().test(finalAddition);
|
||||
|
||||
if (test1 && test2 && test3) {
|
||||
|
||||
ItemStack clone = finalBase.clone();
|
||||
ItemMeta meta = clone.getItemMeta();
|
||||
if (meta instanceof ArmorMeta armorMeta) {
|
||||
|
||||
ArmorTrim trim = armorTrim(finalAddition, finalTemplate);
|
||||
|
||||
armorMeta.setTrim(trim);
|
||||
clone.setItemMeta(armorMeta);
|
||||
|
||||
}
|
||||
|
||||
ItemStack it;
|
||||
if ((it = inventory.getItem(outputSlot)) != null && it.getType() == clone.getType()) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
inventory.setItem(outputSlot, clone);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
inventory.setItem(outputSlot, new ItemStack(Material.AIR));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (recipe instanceof SmithingTransformRecipe transformRecipe) {
|
||||
|
||||
RecipeChoice template = getTemplate(transformRecipe);
|
||||
RecipeChoice base = getBase(transformRecipe);
|
||||
RecipeChoice addition = getAddition(transformRecipe);
|
||||
if (template == null || base == null || addition == null) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
boolean test1 = template.test(finalTemplate);
|
||||
boolean test2 = base.test(finalBase);
|
||||
ItemMeta baseItemMeta = finalBase.getItemMeta();
|
||||
if (baseItemMeta == null) return false;
|
||||
if (baseItemMeta == null)
|
||||
return false;
|
||||
boolean test3 = addition.test(finalAddition);
|
||||
|
||||
if (dontConvertWithModelData && baseItemMeta.hasCustomModelData()) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (test1 && test2 && test3) {
|
||||
|
||||
ItemStack item = getResult(transformRecipe);
|
||||
if (item == null) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
ItemStack it;
|
||||
if ((it = inventory.getItem(outputSlot)) != null && it.getType() == item.getType()) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
item.setItemMeta(baseItemMeta);
|
||||
inventory.setItem(outputSlot, item);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
inventory.setItem(outputSlot, new ItemStack(Material.AIR));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public RecipeChoice getTemplate(SmithingTransformRecipe recipe) {
|
||||
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
|
||||
recipeChoice = (RecipeChoice) templateField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
|
||||
}
|
||||
|
||||
public RecipeChoice getBase(SmithingTransformRecipe recipe) {
|
||||
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
|
||||
recipeChoice = (RecipeChoice) baseField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
|
||||
}
|
||||
|
||||
public RecipeChoice getAddition(SmithingTransformRecipe recipe) {
|
||||
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
|
||||
recipeChoice = (RecipeChoice) additionField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
|
||||
}
|
||||
|
||||
public ItemStack getResult(SmithingTransformRecipe recipe) {
|
||||
|
||||
ItemStack result;
|
||||
try {
|
||||
|
||||
result = (ItemStack) resultField.get(recipe);
|
||||
if (result == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
return result.clone();
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ArmorTrim armorTrim(@NotNull ItemStack finalAddition, @NotNull ItemStack finalTemplate) {
|
||||
|
||||
TrimMaterial material;
|
||||
TrimPattern pattern;
|
||||
|
||||
switch (finalAddition.getType()) {
|
||||
|
||||
case DIAMOND -> material = TrimMaterial.DIAMOND;
|
||||
case GOLD_INGOT -> material = TrimMaterial.GOLD;
|
||||
case EMERALD -> material = TrimMaterial.EMERALD;
|
||||
@@ -452,31 +652,20 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
case COPPER_INGOT -> material = TrimMaterial.COPPER;
|
||||
case NETHERITE_INGOT -> material = TrimMaterial.NETHERITE;
|
||||
default -> material = null;
|
||||
|
||||
}
|
||||
|
||||
switch (finalTemplate.getType()) {
|
||||
case COAST_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.COAST;
|
||||
case DUNE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.DUNE;
|
||||
case EYE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.EYE;
|
||||
case SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SENTRY;
|
||||
case HOST_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.HOST;
|
||||
case SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SHAPER;
|
||||
case SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SILENCE;
|
||||
case RAISER_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.RAISER;
|
||||
case RIB_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.RIB;
|
||||
case SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SNOUT;
|
||||
case SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SPIRE;
|
||||
case TIDE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.TIDE;
|
||||
case VEX_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.VEX;
|
||||
case WARD_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.WARD;
|
||||
case WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.WAYFINDER;
|
||||
default -> pattern = null;
|
||||
}
|
||||
pattern = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft(finalTemplate.getType().name()
|
||||
.replace("_ARMOR_TRIM_SMITHING_TEMPLATE", "").toLowerCase(Locale.ENGLISH)));
|
||||
|
||||
if (pattern == null || material == null) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
return new ArmorTrim(material, pattern);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.artillexstudios.axsmithing.listener;
|
||||
|
||||
import com.artillexstudios.axapi.scheduler.Scheduler;
|
||||
import com.artillexstudios.axapi.utils.Version;
|
||||
import com.artillexstudios.axsmithing.AxSmithingPlugin;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import org.bukkit.Material;
|
||||
@@ -19,19 +18,34 @@ public class InteractListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteractEvent(@NotNull final PlayerInteractEvent event) {
|
||||
if (event.getClickedBlock() == null) return;
|
||||
if (event.getClickedBlock().getType() != Material.SMITHING_TABLE) return;
|
||||
if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)) return;
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("listen-to-interact-event")) return;
|
||||
|
||||
if (event.getClickedBlock() == null)
|
||||
return;
|
||||
if (event.getClickedBlock().getType() != Material.SMITHING_TABLE)
|
||||
return;
|
||||
if (event.getAction().equals(Action.LEFT_CLICK_BLOCK))
|
||||
return;
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("listen-to-interact-event"))
|
||||
return;
|
||||
|
||||
if (AxSmithingPlugin.is1_20()) {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= Version.v1_20_1.protocolId && !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients")) {
|
||||
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= 762
|
||||
&& !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients"))
|
||||
{
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) != Version.v1_20_1.protocolId && Via.getAPI().getPlayerVersion(event.getPlayer()) != Version.v1_20_2.protocolId) {
|
||||
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("menu.1_16.force")) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
@@ -39,25 +53,42 @@ public class InteractListener implements Listener {
|
||||
event.setUseItemInHand(Event.Result.DENY);
|
||||
event.getPlayer().closeInventory();
|
||||
AxSmithingPlugin.getSmithingTableImpl().open(event.getPlayer());
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryOpenEvent(@NotNull final InventoryOpenEvent event) {
|
||||
if (event.getInventory().getType() != InventoryType.SMITHING) return;
|
||||
|
||||
if (event.getInventory().getType() != InventoryType.SMITHING)
|
||||
return;
|
||||
|
||||
if (AxSmithingPlugin.is1_20()) {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= Version.v1_20_1.protocolId && !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients")) {
|
||||
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= 762
|
||||
&& !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients"))
|
||||
{
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) != Version.v1_20_1.protocolId && Via.getAPI().getPlayerVersion(event.getPlayer()) != Version.v1_20_2.protocolId) {
|
||||
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("menu.1_16.force")) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
event.getPlayer().closeInventory();
|
||||
Scheduler.get().runLater(t -> {
|
||||
|
||||
AxSmithingPlugin.getSmithingTableImpl().open((Player) event.getPlayer());
|
||||
|
||||
}, 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,16 +12,23 @@ public class InventoryListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClickEvent(@NotNull final InventoryClickEvent event) {
|
||||
|
||||
AxSmithingPlugin.getSmithingTableImpl().handleClick(event);
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryDragEvent(@NotNull final InventoryDragEvent event) {
|
||||
|
||||
AxSmithingPlugin.getSmithingTableImpl().handleDrag(event);
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryCloseEvent(@NotNull final InventoryCloseEvent event) {
|
||||
|
||||
AxSmithingPlugin.getSmithingTableImpl().handleClose(event);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,23 +16,29 @@ import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class ItemBuilder {
|
||||
|
||||
private final Section section;
|
||||
private final Map<String, String> replacements;
|
||||
private @NotNull ItemStack item = new ItemStack(Material.RED_BANNER);
|
||||
|
||||
public ItemBuilder(Section section, Map<String, String> replacements) {
|
||||
|
||||
this.section = section;
|
||||
this.replacements = replacements;
|
||||
|
||||
createItem();
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ItemStack getItem() {
|
||||
|
||||
return item.clone();
|
||||
|
||||
}
|
||||
|
||||
private void createItem() {
|
||||
|
||||
setMaterial();
|
||||
setName();
|
||||
setLore();
|
||||
@@ -41,10 +47,13 @@ public class ItemBuilder {
|
||||
setGlow();
|
||||
setCustomModelData();
|
||||
setEnchantments();
|
||||
|
||||
}
|
||||
|
||||
private void setName() {
|
||||
if (!section.isString("name")) return;
|
||||
|
||||
if (!section.isString("name"))
|
||||
return;
|
||||
|
||||
AtomicReference<String> message = new AtomicReference<>(section.getString("name"));
|
||||
replacements.forEach((key, value) -> message.set(message.get().replace(key, value)));
|
||||
@@ -53,97 +62,137 @@ public class ItemBuilder {
|
||||
meta.setDisplayName(StringUtils.format(message.get()));
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
}
|
||||
|
||||
private void setLore() {
|
||||
if (section.getStringList("lore") == null) return;
|
||||
if (!item.hasItemMeta()) return;
|
||||
|
||||
if (section.getStringList("lore") == null)
|
||||
return;
|
||||
if (!item.hasItemMeta())
|
||||
return;
|
||||
|
||||
ArrayList<String> lore = new ArrayList<>();
|
||||
|
||||
for (String txt : section.getStringList("lore")) {
|
||||
|
||||
AtomicReference<String> message = new AtomicReference<>(txt);
|
||||
replacements.forEach((key, value) -> message.set(message.get().replace(key, value)));
|
||||
lore.add(StringUtils.format(String.valueOf(message)));
|
||||
|
||||
}
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(lore);
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
}
|
||||
|
||||
private void setMaterial() {
|
||||
if (!section.isString("material")) return;
|
||||
|
||||
if (!section.isString("material"))
|
||||
return;
|
||||
|
||||
Material material = Material.matchMaterial(section.getString("material"));
|
||||
if (material == null) {
|
||||
Bukkit.getLogger().warning("Error while creating item: " + section.getNameAsString() + ". Invalid material. Defaulting to RED_BANNER");
|
||||
|
||||
Bukkit.getLogger().warning("Error while creating item: " + section.getNameAsString()
|
||||
+ ". Invalid material. Defaulting to RED_BANNER");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
item = new ItemStack(material);
|
||||
|
||||
}
|
||||
|
||||
private void setAmount() {
|
||||
if (!section.isInt("amount")) return;
|
||||
|
||||
if (!section.isInt("amount"))
|
||||
return;
|
||||
|
||||
int amount = section.getInt("amount");
|
||||
|
||||
item.setAmount(amount);
|
||||
|
||||
}
|
||||
|
||||
private void setColor() {
|
||||
if (!item.getType().toString().startsWith("LEATHER_")) return;
|
||||
if (!section.isString("color")) return;
|
||||
|
||||
if (!item.getType().toString().startsWith("LEATHER_"))
|
||||
return;
|
||||
if (!section.isString("color"))
|
||||
return;
|
||||
|
||||
LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) item.getItemMeta();
|
||||
String[] rgb = section.getString("color").replace(" ", "").split(",");
|
||||
leatherArmorMeta.setColor(Color.fromRGB(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2])));
|
||||
leatherArmorMeta
|
||||
.setColor(Color.fromRGB(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2])));
|
||||
|
||||
item.setItemMeta(leatherArmorMeta);
|
||||
|
||||
}
|
||||
|
||||
private void setGlow() {
|
||||
if (!section.isBoolean("glow")) return;
|
||||
|
||||
if (!section.isBoolean("glow"))
|
||||
return;
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addEnchant(Enchantment.DAMAGE_ARTHROPODS, 1, true);
|
||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
}
|
||||
|
||||
private void setCustomModelData() {
|
||||
if (!section.isInt("custommodeldata")) return;
|
||||
|
||||
if (!section.isInt("custommodeldata"))
|
||||
return;
|
||||
|
||||
int data = section.getInt("custommodeldata");
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setCustomModelData(data);
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
}
|
||||
|
||||
private void setEnchantments() {
|
||||
if (!section.isList("enchantments")) return;
|
||||
|
||||
if (!section.isList("enchantments"))
|
||||
return;
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
for (String ench : section.getStringList("enchantments")) {
|
||||
|
||||
String[] ench2 = ench.split(":");
|
||||
Enchantment ench3 = null;
|
||||
for (Enchantment str : Enchantment.values()) {
|
||||
|
||||
if (("minecraft:" + ench2[0]).equalsIgnoreCase(str.getKey().toString())) {
|
||||
|
||||
ench3 = str;
|
||||
meta.addEnchant(str, Integer.parseInt(ench2[1]), true);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ench3 == null) {
|
||||
|
||||
Bukkit.getLogger().warning("Invalid enchantment: " + ench2[0]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,30 +8,43 @@ import net.md_5.bungee.api.ChatColor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class StringUtils {
|
||||
private static final LegacyComponentSerializer LEGACY_COMPONENT_SERIALIZER = LegacyComponentSerializer.builder().character('\u00a7').useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
private static final LegacyComponentSerializer LEGACY_FORMATTER = LegacyComponentSerializer.legacyAmpersand().toBuilder().useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
|
||||
private static final LegacyComponentSerializer LEGACY_COMPONENT_SERIALIZER = LegacyComponentSerializer.builder()
|
||||
.character('\u00a7').useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
private static final LegacyComponentSerializer LEGACY_FORMATTER = LegacyComponentSerializer.legacyAmpersand()
|
||||
.toBuilder().useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();
|
||||
|
||||
@NotNull
|
||||
public static String format(@NotNull String message) {
|
||||
|
||||
message = message.replace('\u00a7', '&');
|
||||
message = toLegacy(MINI_MESSAGE.deserialize(message).applyFallbackStyle(TextDecoration.ITALIC.withState(false)));
|
||||
message = toLegacy(
|
||||
MINI_MESSAGE.deserialize(message).applyFallbackStyle(TextDecoration.ITALIC.withState(false)));
|
||||
message = LEGACY_FORMATTER.serialize(LEGACY_FORMATTER.deserialize(message));
|
||||
message = ChatColor.translateAlternateColorCodes('&', message);
|
||||
|
||||
return message;
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Component formatToComponent(@NotNull String message) {
|
||||
|
||||
return toComponent(format(message));
|
||||
|
||||
}
|
||||
|
||||
public static @NotNull String toLegacy(@NotNull Component component) {
|
||||
|
||||
return LEGACY_COMPONENT_SERIALIZER.serialize(component);
|
||||
|
||||
}
|
||||
|
||||
public static @NotNull Component toComponent(@NotNull String message) {
|
||||
|
||||
return LEGACY_COMPONENT_SERIALIZER.deserialize(message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,6 +32,7 @@ menu:
|
||||
upgrade-slot: 12
|
||||
output-slot: 14
|
||||
dont-convert-with-modeldata: false
|
||||
force: true
|
||||
items:
|
||||
'1':
|
||||
slots:
|
||||
@@ -50,4 +51,4 @@ messages:
|
||||
no-permission: "&cYou do not have permission to do this!"
|
||||
reload: "&aPlugin reloaded in %time%ms!"
|
||||
|
||||
config-version: 2
|
||||
config-version: 3
|
||||
Reference in new issue
Block a user