0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-19 17:02:13 +02:00

Merge v7.33 into 1.19.2

This commit is contained in:
Alexander01998 2023-05-30 18:52:44 +02:00
parent f8d0c9fb7b
commit b7e75787fb
48 changed files with 2022 additions and 313 deletions

44
.github/workflows/gradle.yml vendored Normal file
View File

@ -0,0 +1,44 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ "master" ]
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
pull_request:
branches: [ "master" ]
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build

View File

@ -5,7 +5,7 @@ buildscript {
}
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'maven-publish'
}

144
codestyle/cleanup.xml Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="Wurst-Imperium 2022-06" version="2">
<setting id="cleanup.use_autoboxing" value="true"/>
<setting id="cleanup.remove_redundant_semicolons" value="true"/>
<setting id="cleanup.system_property_file_separator" value="true"/>
<setting id="cleanup.objects_equals" value="true"/>
<setting id="cleanup.primitive_parsing" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces" value="true"/>
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.try_with_resource" value="true"/>
<setting id="cleanup.system_property" value="false"/>
<setting id="cleanup.add_missing_nls_tags" value="false"/>
<setting id="cleanup.stringbuilder" value="false"/>
<setting id="cleanup.push_down_negation" value="false"/>
<setting id="cleanup.system_property_path_separator" value="true"/>
<setting id="cleanup.use_var" value="false"/>
<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
<setting id="cleanup.convert_functional_interfaces" value="true"/>
<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
<setting id="cleanup.remove_private_constructors" value="true"/>
<setting id="cleanup.evaluate_nullable" value="true"/>
<setting id="cleanup.strictly_equal_or_different" value="false"/>
<setting id="cleanup.system_property_boolean" value="true"/>
<setting id="cleanup.embedded_if" value="true"/>
<setting id="cleanup.join" value="true"/>
<setting id="cleanup.return_expression" value="false"/>
<setting id="cleanup.remove_unnecessary_casts" value="true"/>
<setting id="cleanup.redundant_falling_through_block_end" value="true"/>
<setting id="cleanup.overridden_assignment_move_decl" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.multi_catch" value="true"/>
<setting id="cleanup.if_condition" value="true"/>
<setting id="cleanup.comparison_statement" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
<setting id="cleanup.use_unboxing" value="true"/>
<setting id="cleanup.bitwise_conditional_expression" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
<setting id="cleanup.instanceof" value="false"/>
<setting id="cleanup.correct_indentation" value="true"/>
<setting id="cleanup.make_private_fields_final" value="true"/>
<setting id="cleanup.boolean_value_rather_than_comparison" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
<setting id="cleanup.no_string_creation" value="true"/>
<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
<setting id="cleanup.substring" value="true"/>
<setting id="cleanup.lazy_logical_operator" value="false"/>
<setting id="cleanup.remove_unused_method_parameters" value="false"/>
<setting id="cleanup.valueof_rather_than_instantiation" value="true"/>
<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.pull_out_if_from_if_else" value="false"/>
<setting id="cleanup.use_anonymous_class_creation" value="false"/>
<setting id="cleanup.convert_to_enhanced_for_loop_if_loop_var_used" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
<setting id="cleanup.break_loop" value="false"/>
<setting id="cleanup.useless_continue" value="true"/>
<setting id="cleanup.instanceof_keyword" value="false"/>
<setting id="cleanup.standard_comparison" value="false"/>
<setting id="cleanup.format_source_code" value="true"/>
<setting id="cleanup.remove_unused_imports" value="true"/>
<setting id="cleanup.use_lambda" value="true"/>
<setting id="cleanup.map_cloning" value="true"/>
<setting id="cleanup.no_super" value="true"/>
<setting id="cleanup.extract_increment" value="false"/>
<setting id="cleanup.always_use_this_for_non_static_field_access" value="false"/>
<setting id="cleanup.add_missing_annotations" value="true"/>
<setting id="cleanup.primitive_rather_than_wrapper" value="false"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.primitive_serialization" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
<setting id="cleanup.sort_members" value="false"/>
<setting id="cleanup.insert_inferred_type_arguments" value="false"/>
<setting id="cleanup.add_missing_override_annotations" value="true"/>
<setting id="cleanup.system_property_line_separator" value="true"/>
<setting id="cleanup.static_inner_class" value="true"/>
<setting id="cleanup.use_directly_map_method" value="true"/>
<setting id="cleanup.add_all" value="false"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="true"/>
<setting id="cleanup.single_used_field" value="false"/>
<setting id="cleanup.collection_cloning" value="true"/>
<setting id="cleanup.comparing_on_criteria" value="true"/>
<setting id="cleanup.stringbuffer_to_stringbuilder" value="false"/>
<setting id="cleanup.do_while_rather_than_while" value="true"/>
<setting id="cleanup.remove_unused_private_types" value="true"/>
<setting id="cleanup.make_variable_declarations_final" value="false"/>
<setting id="cleanup.merge_conditional_blocks" value="false"/>
<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.use_blocks" value="true"/>
<setting id="cleanup.array_with_curly" value="true"/>
<setting id="cleanup.remove_unnecessary_array_creation" value="true"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.operand_factorization" value="true"/>
<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
<setting id="cleanup.convert_to_switch_expressions" value="false"/>
<setting id="cleanup.remove_redundant_type_arguments" value="true"/>
<setting id="cleanup.number_suffix" value="true"/>
<setting id="cleanup.redundant_comparator" value="true"/>
<setting id="cleanup.remove_unused_private_members" value="true"/>
<setting id="cleanup.never_use_blocks" value="true"/>
<setting id="cleanup.organize_imports" value="true"/>
<setting id="cleanup.switch" value="false"/>
<setting id="cleanup.stringbuilder_for_local_vars" value="true"/>
<setting id="cleanup.make_parameters_final" value="false"/>
<setting id="cleanup.ternary_operator" value="true"/>
<setting id="cleanup.controlflow_merge" value="false"/>
<setting id="cleanup.unreachable_block" value="false"/>
<setting id="cleanup.always_use_blocks" value="false"/>
<setting id="cleanup.add_serial_version_id" value="false"/>
<setting id="cleanup.stringconcat_to_textblock" value="false"/>
<setting id="cleanup.invert_equals" value="false"/>
<setting id="cleanup.use_string_is_blank" value="true"/>
<setting id="cleanup.remove_unused_local_variables" value="true"/>
<setting id="cleanup.remove_redundant_modifiers" value="false"/>
<setting id="cleanup.system_property_file_encoding" value="true"/>
<setting id="cleanup.sort_members_all" value="false"/>
<setting id="cleanup.double_negation" value="true"/>
<setting id="cleanup.format_source_code_changes_only" value="false"/>
<setting id="cleanup.arrays_fill" value="true"/>
<setting id="cleanup.add_generated_serial_version_id" value="true"/>
<setting id="cleanup.plain_replacement" value="true"/>
<setting id="cleanup.precompile_regex" value="true"/>
<setting id="cleanup.useless_return" value="true"/>
<setting id="cleanup.simplify_lambda_expression_and_method_ref" value="true"/>
<setting id="cleanup.unlooped_while" value="true"/>
<setting id="cleanup.make_local_variable_final" value="false"/>
<setting id="cleanup.pull_up_assignment" value="false"/>
<setting id="cleanup.overridden_assignment" value="false"/>
<setting id="cleanup.else_if" value="true"/>
<setting id="cleanup.reduce_indentation" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="true"/>
<setting id="cleanup.hash" value="true"/>
<setting id="cleanup.boolean_literal" value="true"/>
<setting id="cleanup.add_default_serial_version_id" value="false"/>
<setting id="cleanup.add_missing_methods" value="true"/>
<setting id="cleanup.primitive_comparison" value="true"/>
<setting id="cleanup.one_if_rather_than_duplicate_blocks_that_fall_through" value="false"/>
</profile>
</profiles>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/*
* Copyright (c) 2014-${year} Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
${filecomment}
${package_declaration}
${typecomment}
${type_declaration}</template></templates>

365
codestyle/formatter.xml Normal file
View File

@ -0,0 +1,365 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="18">
<profile kind="CodeFormatterProfile" name="Wurst-Imperium" version="18">
<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.insert_space_before_at_in_annotation_type_declaration" value="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_logical_operator" value="insert"/>
<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="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<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.blank_lines_after_imports" value="1"/>
<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.comment.insert_new_line_before_root_tags" value="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.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.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<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_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.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.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
<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.alignment_for_enum_constants" value="49"/>
<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="0"/>
<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.parentheses_positions_in_if_while_statement" value="common_lines"/>
<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="true"/>
<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.insert_space_after_closing_brace_in_block" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
<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.insert_space_before_arrow_in_switch_case" value="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_new_line_after_annotation_on_field" value="insert"/>
<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.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
<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_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.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<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.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_if_empty"/>
<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.never_indent_line_comments_on_first_column" value="false"/>
<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_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"/>
<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.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty"/>
<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_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" 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.brace_position_for_method_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_if_empty"/>
<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.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<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.alignment_for_additive_operator" value="16"/>
<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_after_comma_in_multiple_field_declarations" value="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.insert_space_before_relational_operator" value="insert"/>
<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_if_empty"/>
<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.insert_space_after_comma_in_superinterfaces" value="insert"/>
<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_block" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/>
<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="do not 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_before_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<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.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.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.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="do not insert"/>
<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="insert"/>
<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.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.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not 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_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.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_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" 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.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="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="16"/>
<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.number_of_blank_lines_after_code_block" value="0"/>
<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.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>
<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="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
<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.comment.insert_new_line_between_different_tags" 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="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<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="do not insert"/>
<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.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.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="false"/>
<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.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.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"/>
<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="16"/>
<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.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.keep_code_block_on_one_line" value="one_line_if_empty"/>
<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_constructor_declaration_throws" 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_comma_in_allocation_expression" 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.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not 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.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.continuation_indentation_for_array_initializer" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" 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.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
<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.insert_space_after_not_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
<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_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="do not 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.insert_space_after_closing_angle_bracket_in_type_parameters" value="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.keep_lambda_body_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<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.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="80"/>
<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.keep_empty_array_initializer_on_one_line" value="false"/>
<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_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_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_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_colon_in_conditional" value="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_comma_in_method_declaration_parameters" 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_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_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_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="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.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<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="false"/>
<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.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_after_opening_paren_in_try" 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.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.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<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_after_comma_in_method_declaration_throws" value="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.blank_lines_after_last_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<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.keep_simple_while_body_on_same_line" value="false"/>
<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="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
<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.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_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_colon_in_case" 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_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_if_empty"/>
<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.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
<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="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not 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_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.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.insert_space_after_opening_angle_bracket_in_type_parameters" 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_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.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.join_lines_in_comments" value="false"/>
<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="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/>
<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="tab"/>
<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.wrap_before_string_concatenation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
<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="do not insert"/>
</profile>
</profiles>

View File

@ -6,13 +6,13 @@ org.gradle.jvmargs=-Xmx1G
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.14
loader_version=0.14.21
#Fabric api
fabric_version=0.75.1+1.19.2
fabric_version=0.76.0+1.19.2
# Mod Properties
mod_version = v7.32-MC1.19.2
mod_version = v7.33-MC1.19.2
maven_group = net.wurstclient
archives_base_name = Wurst-Client

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

8
gradlew vendored
View File

@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# 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.
@ -231,4 +237,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"

180
gradlew.bat vendored
View File

@ -1,89 +1,91 @@
@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
@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% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
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% 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

View File

@ -58,7 +58,7 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;
public static final String VERSION = "7.32";
public static final String VERSION = "7.33";
public static final String MC_VERSION = "1.19.2";
private WurstAnalytics analytics;
@ -182,6 +182,12 @@ public enum WurstClient
{
if(otfs.translationsOtf.getForceEnglish().isChecked())
return IMC.getLanguageManager().getEnglish().get(key);
// This extra check is necessary because I18n.translate() doesn't
// always return the key when the translation is missing. If the key
// contains a '%', it will return "Format Error: key" instead.
if(!I18n.hasTranslation(key))
return key;
return I18n.translate(key);
}

View File

@ -179,8 +179,8 @@ public final class ClickGui
continue;
JsonObject jsonWindow = new JsonObject();
jsonWindow.addProperty("x", window.getX());
jsonWindow.addProperty("y", window.getY());
jsonWindow.addProperty("x", window.getActualX());
jsonWindow.addProperty("y", window.getActualY());
jsonWindow.addProperty("minimized", window.isMinimized());
jsonWindow.addProperty("pinned", window.isPinned());
json.add(window.getTitle(), jsonWindow);

View File

@ -62,7 +62,29 @@ public class Window
this.title = title;
}
/**
* Returns the X position of the window, adjusted to fit inside the screen.
*/
public final int getX()
{
// prevent window from going off the right side of the screen
net.minecraft.client.util.Window mcWindow = WurstClient.MC.getWindow();
if(x > mcWindow.getScaledWidth() - 1)
return mcWindow.getScaledWidth() - 1;
// prevent window from going off the left side of the screen
if(x <= -width)
return -width + 1;
return x;
}
/**
* Returns the actual X position of the window, without any adjustments.
* This should only be used for saving the window's position to the config
* file.
*/
public final int getActualX()
{
return x;
}
@ -72,7 +94,29 @@ public class Window
this.x = x;
}
/**
* Returns the Y position of the window, adjusted to fit inside the screen.
*/
public final int getY()
{
// prevent window from going off the bottom of the screen
net.minecraft.client.util.Window mcWindow = WurstClient.MC.getWindow();
if(y > mcWindow.getScaledHeight() - 1)
return mcWindow.getScaledHeight() - 1;
// prevent window from going off the top of the screen
if(y <= -12)
return -12;
return y;
}
/**
* Returns the actual Y position of the window, without any adjustments.
* This should only be used for saving the window's position to the config
* file.
*/
public final int getActualY()
{
return y;
}
@ -226,8 +270,8 @@ public class Window
public final void startDragging(int mouseX, int mouseY)
{
dragging = true;
dragOffsetX = x - mouseX;
dragOffsetY = y - mouseY;
dragOffsetX = getX() - mouseX;
dragOffsetY = getY() - mouseY;
}
public final void dragTo(int mouseX, int mouseY)

View File

@ -25,7 +25,6 @@ import net.minecraft.util.math.Matrix4f;
import net.wurstclient.WurstClient;
import net.wurstclient.clickgui.ClickGui;
import net.wurstclient.clickgui.Component;
import net.wurstclient.clickgui.Window;
import net.wurstclient.clickgui.screens.EditBlockScreen;
import net.wurstclient.settings.BlockSetting;
import net.wurstclient.util.RenderUtils;
@ -121,14 +120,7 @@ public final class BlockComponent extends Component
String text = setting.getName() + ":";
fr.draw(matrixStack, text, x1, y1 + 2, txtColor);
MatrixStack modelViewStack = RenderSystem.getModelViewStack();
modelViewStack.push();
Window parent = getParent();
modelViewStack.translate(parent.getX(),
parent.getY() + 13 + parent.getScrollOffset(), 0);
RenderUtils.drawItem(matrixStack, stack, x3, y1, true);
modelViewStack.pop();
RenderSystem.applyModelViewMatrix();
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -10,22 +10,31 @@ package net.wurstclient.commands;
import java.util.Comparator;
import java.util.stream.StreamSupport;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.BlockPos;
import net.wurstclient.command.CmdError;
import net.wurstclient.command.CmdException;
import net.wurstclient.command.CmdSyntaxError;
import net.wurstclient.command.Command;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.util.FakePlayerEntity;
import net.wurstclient.util.MathUtils;
public final class TpCmd extends Command
{
private final CheckboxSetting disableFreecam =
new CheckboxSetting("Disable Freecam",
"Disables Freecam just before teleporting.\n\n"
+ "This allows you to teleport your actual character to your"
+ " Freecam position by typing \".tp ~ ~ ~\" while Freecam is"
+ " enabled.",
true);
public TpCmd()
{
super("tp", "Teleports you up to 10 blocks away.", ".tp <x> <y> <z>",
".tp <entity>");
addSetting(disableFreecam);
}
@Override
@ -33,8 +42,10 @@ public final class TpCmd extends Command
{
BlockPos pos = argsToPos(args);
ClientPlayerEntity player = MC.player;
player.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
if(disableFreecam.isChecked() && WURST.getHax().freecamHack.isEnabled())
WURST.getHax().freecamHack.setEnabled(false);
MC.player.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
}
private BlockPos argsToPos(String... args) throws CmdException

View File

@ -42,6 +42,7 @@ public final class HackList implements UpdateListener
public final ArrowDmgHack arrowDmgHack = new ArrowDmgHack();
public final AutoArmorHack autoArmorHack = new AutoArmorHack();
public final AutoBuildHack autoBuildHack = new AutoBuildHack();
public final AutoCompleteHack autoCompleteHack = new AutoCompleteHack();
public final AutoDropHack autoDropHack = new AutoDropHack();
public final AutoLeaveHack autoLeaveHack = new AutoLeaveHack();
public final AutoLibrarianHack autoLibrarianHack = new AutoLibrarianHack();

View File

@ -12,15 +12,14 @@ import java.util.List;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.ChatHudLine;
import net.minecraft.client.util.ChatMessages;
import net.minecraft.text.CharacterVisitor;
import net.minecraft.text.MutableText;
import net.minecraft.text.OrderedText;
import net.minecraft.text.Style;
import net.minecraft.util.math.MathHelper;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.ChatInputListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.util.ChatUtils;
import net.wurstclient.util.MathUtils;
@SearchTags({"NoSpam", "ChatFilter", "anti spam", "no spam", "chat filter"})
@ -51,33 +50,6 @@ public final class AntiSpamHack extends Hack implements ChatInputListener
if(chatLines.isEmpty())
return;
/**
* A {@link CharacterVisitor} to completely bypass Mojang's visitor
* system and just get the damn {@link String} out of a
* {@link ChatHudLine}.
*
* <p>
* Is this seriously the replacement for <code>getString()</code>?
* What were they thinking?!
*/
class JustGiveMeTheStringVisitor implements CharacterVisitor
{
StringBuilder sb = new StringBuilder();
@Override
public boolean accept(int index, Style style, int codePoint)
{
sb.appendCodePoint(codePoint);
return true;
}
@Override
public String toString()
{
return sb.toString();
}
}
ChatHud chat = MC.inGameHud.getChatHud();
int maxTextLength =
MathHelper.floor(chat.getWidth() / chat.getChatScale());
@ -89,17 +61,12 @@ public final class AntiSpamHack extends Hack implements ChatInputListener
for(int i = chatLines.size() - 1; i >= 0; i--)
{
JustGiveMeTheStringVisitor oldLineVS =
new JustGiveMeTheStringVisitor();
chatLines.get(i).content().accept(oldLineVS);
String oldLine = oldLineVS.toString();
String oldLine = ChatUtils.getAsString(chatLines.get(i));
if(matchingLines <= newLines.size() - 1)
{
JustGiveMeTheStringVisitor newLineVS =
new JustGiveMeTheStringVisitor();
newLines.get(matchingLines).accept(newLineVS);
String newLine = newLineVS.toString();
String newLine =
ChatUtils.getAsString(newLines.get(matchingLines));
if(matchingLines < newLines.size() - 1)
{
@ -119,10 +86,8 @@ public final class AntiSpamHack extends Hack implements ChatInputListener
if(i > 0 && matchingLines == newLines.size() - 1)
{
JustGiveMeTheStringVisitor nextOldLineVS =
new JustGiveMeTheStringVisitor();
chatLines.get(i - 1).content().accept(nextOldLineVS);
String nextOldLine = nextOldLineVS.toString();
String nextOldLine =
ChatUtils.getAsString(chatLines.get(i - 1));
String twoLines = oldLine + nextOldLine;
String addedText = twoLines.substring(newLine.length());

View File

@ -0,0 +1,161 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks;
import java.util.function.BiConsumer;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.client.gui.screen.ChatScreen;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.ChatOutputListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.hacks.autocomplete.ApiProviderSetting;
import net.wurstclient.hacks.autocomplete.MessageCompleter;
import net.wurstclient.hacks.autocomplete.ModelSettings;
import net.wurstclient.hacks.autocomplete.OobaboogaMessageCompleter;
import net.wurstclient.hacks.autocomplete.OpenAiMessageCompleter;
import net.wurstclient.hacks.autocomplete.SuggestionHandler;
import net.wurstclient.util.ChatUtils;
@SearchTags({"auto complete", "Copilot", "ChatGPT", "chat GPT", "GPT-3", "GPT3",
"GPT 3", "OpenAI", "open ai", "ChatAI", "chat AI", "ChatBot", "chat bot"})
public final class AutoCompleteHack extends Hack
implements ChatOutputListener, UpdateListener
{
private final ModelSettings modelSettings = new ModelSettings();
private final SuggestionHandler suggestionHandler = new SuggestionHandler();
private final ApiProviderSetting apiProvider = new ApiProviderSetting();
private MessageCompleter completer;
private String draftMessage;
private BiConsumer<SuggestionsBuilder, String> suggestionsUpdater;
private Thread apiCallThread;
private long lastApiCallTime;
private long lastRefreshTime;
public AutoCompleteHack()
{
super("AutoComplete");
setCategory(Category.CHAT);
addSetting(apiProvider);
modelSettings.forEach(this::addSetting);
suggestionHandler.getSettings().forEach(this::addSetting);
}
@Override
protected void onEnable()
{
completer = switch(apiProvider.getSelected())
{
case OPENAI -> new OpenAiMessageCompleter(modelSettings);
case OOBABOOGA -> new OobaboogaMessageCompleter(modelSettings);
};
if(completer instanceof OpenAiMessageCompleter
&& System.getenv("WURST_OPENAI_KEY") == null)
{
ChatUtils.error("API key not found. Please set the"
+ " WURST_OPENAI_KEY environment variable and reboot.");
setEnabled(false);
return;
}
EVENTS.add(ChatOutputListener.class, this);
EVENTS.add(UpdateListener.class, this);
}
@Override
public void onDisable()
{
EVENTS.remove(ChatOutputListener.class, this);
EVENTS.remove(UpdateListener.class, this);
suggestionHandler.clearSuggestions();
}
@Override
public void onSentMessage(ChatOutputEvent event)
{
suggestionHandler.clearSuggestions();
}
@Override
public void onUpdate()
{
// check if 300ms have passed since the last refresh
long timeSinceLastRefresh =
System.currentTimeMillis() - lastRefreshTime;
if(timeSinceLastRefresh < 300)
return;
// check if 3s have passed since the last API call
long timeSinceLastApiCall =
System.currentTimeMillis() - lastApiCallTime;
if(timeSinceLastApiCall < 3000)
return;
// check if the chat is open
if(!(MC.currentScreen instanceof ChatScreen))
return;
// check if we have a draft message and suggestions updater
if(draftMessage == null || suggestionsUpdater == null)
return;
// don't start a new thread if the old one is still running
if(apiCallThread != null && apiCallThread.isAlive())
return;
// check if we already have a suggestion for the current draft message
if(suggestionHandler.hasEnoughSuggestionFor(draftMessage))
return;
// copy fields to local variables, in case they change
// while the thread is running
String draftMessage2 = draftMessage;
BiConsumer<SuggestionsBuilder, String> suggestionsUpdater2 =
suggestionsUpdater;
// build thread
apiCallThread = new Thread(() -> {
// get suggestion
String suggestion = completer.completeChatMessage(draftMessage2);
if(suggestion.isEmpty())
return;
// apply suggestion
suggestionHandler.addSuggestion(suggestion, draftMessage2,
suggestionsUpdater2);
});
apiCallThread.setName("AutoComplete API Call");
apiCallThread.setPriority(Thread.MIN_PRIORITY);
apiCallThread.setDaemon(true);
// start thread
lastApiCallTime = System.currentTimeMillis();
apiCallThread.start();
}
public void onRefresh(String draftMessage,
BiConsumer<SuggestionsBuilder, String> suggestionsUpdater)
{
suggestionHandler.showSuggestions(draftMessage, suggestionsUpdater);
this.draftMessage = draftMessage;
this.suggestionsUpdater = suggestionsUpdater;
lastRefreshTime = System.currentTimeMillis();
}
// See ChatInputSuggestorMixin
}

View File

@ -111,6 +111,7 @@ public final class AutoFarmHack extends Hack
Stream.of(greenBuffer, cyanBuffer, redBuffer).filter(Objects::nonNull)
.forEach(VertexBuffer::close);
greenBuffer = cyanBuffer = redBuffer = null;
}
@Override

View File

@ -388,7 +388,7 @@ public final class AutoLibrarianHack extends Hack
Box box = villager.getBoundingBox();
Vec3d start = RotationUtils.getEyesPos();
Vec3d end = box.getCenter();
Vec3d hitVec = box.raycast(start, end).get();
Vec3d hitVec = box.raycast(start, end).orElse(start);
EntityHitResult hitResult = new EntityHitResult(villager, hitVec);
// face end vector
@ -428,12 +428,20 @@ public final class AutoLibrarianHack extends Hack
if(enchantmentNbt.isEmpty())
continue;
NbtList bookNbt =
EnchantedBookItem.getEnchantmentNbt(tradeOffer.getSellItem());
NbtList bookNbt = EnchantedBookItem.getEnchantmentNbt(stack);
String enchantment = bookNbt.getCompound(0).getString("id");
int level = bookNbt.getCompound(0).getInt("lvl");
int price = tradeOffer.getAdjustedFirstBuyItem().getCount();
return new BookOffer(enchantment, level, price);
BookOffer bookOffer = new BookOffer(enchantment, level, price);
if(!bookOffer.isValid())
{
System.out.println("Found invalid enchanted book offer.\n"
+ "NBT data: " + stack.getNbt());
continue;
}
return bookOffer;
}
return null;

View File

@ -17,6 +17,7 @@ import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
@ -93,6 +94,10 @@ public final class BowAimbotHack extends Hack
@Override
public void onEnable()
{
// disable conflicting hacks
WURST.getHax().excavatorHack.setEnabled(false);
// register event listeners
EVENTS.add(GUIRenderListener.class, this);
EVENTS.add(RenderListener.class, this);
EVENTS.add(UpdateListener.class, this);
@ -239,6 +244,7 @@ public final class BowAimbotHack extends Hack
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
RenderSystem.setShaderColor(1, 1, 1, 1);
}
@Override
@ -264,9 +270,11 @@ public final class BowAimbotHack extends Hack
else
message = "Target Locked";
TextRenderer tr = MC.textRenderer;
// translate to center
Window sr = MC.getWindow();
int msgWidth = MC.textRenderer.getWidth(message);
int msgWidth = tr.getWidth(message);
matrixStack.translate(sr.getScaledWidth() / 2 - msgWidth / 2,
sr.getScaledHeight() / 2 + 1, 0);
@ -275,12 +283,14 @@ public final class BowAimbotHack extends Hack
RenderSystem.setShaderColor(0, 0, 0, 0.5F);
bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, 0, 0, 0).next();
bufferBuilder.vertex(matrix, msgWidth + 3, 0, 0).next();
bufferBuilder.vertex(matrix, msgWidth + 3, 10, 0).next();
bufferBuilder.vertex(matrix, 0, 10, 0).next();
tessellator.draw();
// text
RenderSystem.setShaderColor(1, 1, 1, 1);
MC.textRenderer.draw(matrixStack, message, 2, 1, 0xffffffff);
matrixStack.pop();
@ -288,6 +298,7 @@ public final class BowAimbotHack extends Hack
// GL resets
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
RenderSystem.setShaderColor(1, 1, 1, 1);
}
private enum Priority

View File

@ -92,13 +92,12 @@ public final class ExcavatorHack extends Hack
public void onEnable()
{
// disable conflicting hacks
// TODO:
// WURST.getHax().bowAimbotMod.setEnabled(false);
// WURST.getHax().templateToolMod.setEnabled(false);
WURST.getHax().autoMineHack.setEnabled(false);
WURST.getHax().bowAimbotHack.setEnabled(false);
WURST.getHax().nukerHack.setEnabled(false);
WURST.getHax().nukerLegitHack.setEnabled(false);
WURST.getHax().speedNukerHack.setEnabled(false);
// WURST.getHax().templateToolHack.setEnabled(false);
WURST.getHax().tunnellerHack.setEnabled(false);
step = Step.START_POS;
@ -321,6 +320,7 @@ public final class ExcavatorHack extends Hack
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
RenderSystem.setShaderColor(1, 1, 1, 1);
}
@Override
@ -363,6 +363,7 @@ public final class ExcavatorHack extends Hack
tessellator.draw();
// text
RenderSystem.setShaderColor(1, 1, 1, 1);
tr.draw(matrixStack, message, 2, 1, 0xffffffff);
matrixStack.pop();
@ -370,6 +371,7 @@ public final class ExcavatorHack extends Hack
// GL resets
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
RenderSystem.setShaderColor(1, 1, 1, 1);
}
public void enableWithArea(BlockPos pos1, BlockPos pos2)

View File

@ -7,10 +7,10 @@
*/
package net.wurstclient.hacks;
import java.util.Comparator;
import java.util.function.ToDoubleFunction;
import java.util.ArrayList;
import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import org.lwjgl.opengl.GL11;
@ -20,25 +20,29 @@ import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.passive.AbstractHorseEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.PostMotionListener;
import net.wurstclient.events.RenderListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.settings.filters.FilterBabiesSetting;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RenderUtils;
import net.wurstclient.util.RotationUtils;
@ -52,17 +56,21 @@ public final class FeedAuraHack extends Hack
+ "Anything that is further away than the specified value will not be fed.",
5, 1, 10, 0.05, ValueDisplay.DECIMAL);
private final EnumSetting<Priority> priority = new EnumSetting<>("Priority",
"Determines which animal will be fed first.\n"
+ "\u00a7lDistance\u00a7r - Feeds the closest animal.\n"
+ "\u00a7lAngle\u00a7r - Feeds the animal that requires the least head movement.\n"
+ "\u00a7lHealth\u00a7r - Feeds the weakest animal.",
Priority.values(), Priority.ANGLE);
private final FilterBabiesSetting filterBabies =
new FilterBabiesSetting("Won't feed baby animals.\n"
+ "Saves food, but doesn't speed up baby growth.", true);
private final FilterBabiesSetting filterBabies = new FilterBabiesSetting(
"Won't feed baby animals.\n" + "Saves food, but slows baby growth.",
false);
private final CheckboxSetting filterUntamed =
new CheckboxSetting("Filter untamed",
"Won't feed tameable animals that haven't been tamed yet.", false);
private final CheckboxSetting filterHorses = new CheckboxSetting(
"Filter horse-like animals",
"Won't feed horses, llamas, donkeys, etc.\n"
+ "Recommended due to Minecraft bug MC-233276, which causes these animals to consume items indefinitely.",
true);
private final Random random = new Random();
private AnimalEntity target;
private AnimalEntity renderTarget;
@ -71,8 +79,9 @@ public final class FeedAuraHack extends Hack
super("FeedAura");
setCategory(Category.OTHER);
addSetting(range);
addSetting(priority);
addSetting(filterBabies);
addSetting(filterUntamed);
addSetting(filterHorses);
}
@Override
@ -109,11 +118,8 @@ public final class FeedAuraHack extends Hack
ClientPlayerEntity player = MC.player;
ItemStack heldStack = player.getInventory().getMainHandStack();
double rangeSq = Math.pow(range.getValue(), 2);
Stream<AnimalEntity> stream = StreamSupport
.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> !e.isRemoved()).filter(e -> e instanceof AnimalEntity)
.map(e -> (AnimalEntity)e).filter(e -> e.getHealth() > 0)
double rangeSq = range.getValueSq();
Stream<AnimalEntity> stream = EntityUtils.getValidAnimals()
.filter(e -> player.squaredDistanceTo(e) <= rangeSq)
.filter(e -> e.isBreedingItem(heldStack))
.filter(AnimalEntity::canEat);
@ -121,7 +127,20 @@ public final class FeedAuraHack extends Hack
if(filterBabies.isChecked())
stream = stream.filter(filterBabies);
target = stream.min(priority.getSelected().comparator).orElse(null);
if(filterUntamed.isChecked())
stream = stream.filter(e -> !isUntamed(e));
if(filterHorses.isChecked())
stream = stream.filter(e -> !(e instanceof AbstractHorseEntity));
// convert targets to list
ArrayList<AnimalEntity> targets =
stream.collect(Collectors.toCollection(ArrayList::new));
// pick a target at random
target = targets.isEmpty() ? null
: targets.get(random.nextInt(targets.size()));
renderTarget = target;
if(target == null)
return;
@ -140,7 +159,13 @@ public final class FeedAuraHack extends Hack
ClientPlayerEntity player = MC.player;
Hand hand = Hand.MAIN_HAND;
EntityHitResult hitResult = new EntityHitResult(target);
// create realistic hit result
Box box = target.getBoundingBox();
Vec3d start = RotationUtils.getEyesPos();
Vec3d end = box.getCenter();
Vec3d hitVec = box.raycast(start, end).orElse(start);
EntityHitResult hitResult = new EntityHitResult(target, hitVec);
ActionResult actionResult =
im.interactEntityAtLocation(player, target, hitResult, hand);
@ -173,27 +198,25 @@ public final class FeedAuraHack extends Hack
float p = 1;
LivingEntity le = renderTarget;
p = (le.getMaxHealth() - le.getHealth()) / le.getMaxHealth();
float red = p * 2F;
float green = 2 - red;
float green = p * 2F;
float red = 2 - green;
matrixStack.translate(
renderTarget.prevX
+ (renderTarget.getX() - renderTarget.prevX) * partialTicks,
renderTarget.prevY
+ (renderTarget.getY() - renderTarget.prevY) * partialTicks,
renderTarget.prevZ
+ (renderTarget.getZ() - renderTarget.prevZ) * partialTicks);
MathHelper.lerp(partialTicks, renderTarget.prevX,
renderTarget.getX()),
MathHelper.lerp(partialTicks, renderTarget.prevY,
renderTarget.getY()),
MathHelper.lerp(partialTicks, renderTarget.prevZ,
renderTarget.getZ()));
matrixStack.translate(0, 0.05, 0);
matrixStack.scale(renderTarget.getWidth(), renderTarget.getHeight(),
renderTarget.getWidth());
matrixStack.translate(-0.5, 0, -0.5);
if(p < 1)
{
matrixStack.translate(0.5, 0.5, 0.5);
matrixStack.scale(p, p, p);
matrixStack.translate(-0.5, -0.5, -0.5);
}
matrixStack.translate(0.5, 0.5, 0.5);
matrixStack.scale(p, p, p);
matrixStack.translate(-0.5, -0.5, -0.5);
RenderSystem.setShader(GameRenderer::getPositionShader);
@ -212,30 +235,14 @@ public final class FeedAuraHack extends Hack
GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
private enum Priority
private boolean isUntamed(AnimalEntity e)
{
DISTANCE("Distance", e -> MC.player.squaredDistanceTo(e)),
if(e instanceof AbstractHorseEntity horse && !horse.isTame())
return true;
ANGLE("Angle",
e -> RotationUtils
.getAngleToLookVec(e.getBoundingBox().getCenter())),
if(e instanceof TameableEntity tame && !tame.isTamed())
return true;
HEALTH("Health", e -> e instanceof LivingEntity
? ((LivingEntity)e).getHealth() : Integer.MAX_VALUE);
private final String name;
private final Comparator<Entity> comparator;
private Priority(String name, ToDoubleFunction<Entity> keyExtractor)
{
this.name = name;
comparator = Comparator.comparingDouble(keyExtractor);
}
@Override
public String toString()
{
return name;
}
return false;
}
}

View File

@ -84,6 +84,7 @@ public final class KillauraLegitHack extends Hack
FilterPetsSetting.genericCombat(false),
FilterTradersSetting.genericCombat(false),
FilterGolemsSetting.genericCombat(false),
FilterAllaysSetting.genericCombat(false),
FilterInvisibleSetting.genericCombat(true),
FilterNamedSetting.genericCombat(false),
FilterShulkerBulletSetting.genericCombat(false),

View File

@ -60,6 +60,7 @@ public final class ProtectHack extends Hack
FilterPetsSetting.genericCombat(false),
FilterTradersSetting.genericCombat(false),
FilterGolemsSetting.genericCombat(false),
FilterAllaysSetting.genericCombat(false),
FilterInvisibleSetting.genericCombat(false),
FilterNamedSetting.genericCombat(false),
FilterShulkerBulletSetting.genericCombat(false),

View File

@ -17,6 +17,7 @@ import net.wurstclient.events.PostMotionListener;
import net.wurstclient.events.PreMotionListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IKeyBinding;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.EnumSetting;
@SearchTags({"AutoSneaking"})
@ -28,11 +29,20 @@ public final class SneakHack extends Hack
+ "\u00a7lLegit\u00a7r mode actually makes you sneak.",
SneakMode.values(), SneakMode.LEGIT);
private final CheckboxSetting offWhileFlying =
new CheckboxSetting("Turn off while flying",
"Automatically disables Legit Sneak while you are flying or using"
+ " Freecam, so that it doesn't force you to fly down.\n\n"
+ "Keep in mind that this also means you won't be hidden from"
+ " other players while doing these things.",
false);
public SneakHack()
{
super("Sneak");
setCategory(Category.MOVEMENT);
addSetting(mode);
addSetting(offWhileFlying);
}
@Override
@ -75,7 +85,10 @@ public final class SneakHack extends Hack
switch(mode.getSelected())
{
case LEGIT:
sneakKey.setPressed(true);
if(offWhileFlying.isChecked() && isFlying())
((IKeyBinding)sneakKey).resetPressedState();
else
sneakKey.setPressed(true);
break;
case PACKET:
@ -96,6 +109,20 @@ public final class SneakHack extends Hack
sendSneakPacket(Mode.PRESS_SHIFT_KEY);
}
private boolean isFlying()
{
if(MC.player.getAbilities().flying)
return true;
if(WURST.getHax().flightHack.isEnabled())
return true;
if(WURST.getHax().freecamHack.isEnabled())
return true;
return false;
}
private void sendSneakPacket(Mode mode)
{
ClientPlayerEntity player = MC.player;

View File

@ -9,6 +9,7 @@ package net.wurstclient.hacks;
import java.awt.Color;
import java.util.ArrayList;
import java.util.function.Predicate;
import org.lwjgl.opengl.GL11;
@ -21,8 +22,15 @@ import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.*;
import net.minecraft.util.Arm;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RaycastContext;
@ -31,21 +39,32 @@ import net.wurstclient.SearchTags;
import net.wurstclient.events.RenderListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.ColorSetting;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RenderUtils;
import net.wurstclient.util.RotationUtils;
@SearchTags({"ArrowTrajectories", "ArrowPrediction", "aim assist",
"arrow trajectories"})
"arrow trajectories", "bow trajectories"})
public final class TrajectoriesHack extends Hack implements RenderListener
{
private final ColorSetting color =
new ColorSetting("Color", "Color of the trajectory.", Color.GREEN);
private final ColorSetting missColor = new ColorSetting("Miss Color",
"Color of the trajectory when it doesn't hit anything.", Color.GRAY);
private final ColorSetting entityHitColor =
new ColorSetting("Entity Hit Color",
"Color of the trajectory when it hits an entity.", Color.RED);
private final ColorSetting blockHitColor =
new ColorSetting("Block Hit Color",
"Color of the trajectory when it hits a block.", Color.GREEN);
public TrajectoriesHack()
{
super("Trajectories");
setCategory(Category.RENDER);
addSetting(color);
addSetting(missColor);
addSetting(entityHitColor);
addSetting(blockHitColor);
}
@Override
@ -72,15 +91,22 @@ public final class TrajectoriesHack extends Hack implements RenderListener
RenderUtils.applyCameraRotationOnly();
ArrayList<Vec3d> path = getPath(partialTicks);
Vec3d camPos = RenderUtils.getCameraPos();
Trajectory trajectory = getTrajectory(partialTicks);
ArrayList<Vec3d> path = trajectory.path;
drawLine(matrixStack, path, camPos);
ColorSetting color = switch(trajectory.type)
{
case MISS -> missColor;
case ENTITY -> entityHitColor;
case BLOCK -> blockHitColor;
};
drawLine(matrixStack, path, color);
if(!path.isEmpty())
{
Vec3d end = path.get(path.size() - 1);
drawEndOfLine(matrixStack, end, camPos);
drawEndOfLine(matrixStack, end, color);
}
RenderSystem.setShaderColor(1, 1, 1, 1);
@ -92,8 +118,9 @@ public final class TrajectoriesHack extends Hack implements RenderListener
}
private void drawLine(MatrixStack matrixStack, ArrayList<Vec3d> path,
Vec3d camPos)
ColorSetting color)
{
Vec3d camPos = RenderUtils.getCameraPos();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -113,8 +140,10 @@ public final class TrajectoriesHack extends Hack implements RenderListener
tessellator.draw();
}
private void drawEndOfLine(MatrixStack matrixStack, Vec3d end, Vec3d camPos)
private void drawEndOfLine(MatrixStack matrixStack, Vec3d end,
ColorSetting color)
{
Vec3d camPos = RenderUtils.getCameraPos();
double renderX = end.x - camPos.x;
double renderY = end.y - camPos.y;
double renderZ = end.z - camPos.z;
@ -132,112 +161,143 @@ public final class TrajectoriesHack extends Hack implements RenderListener
matrixStack.pop();
}
private ArrayList<Vec3d> getPath(float partialTicks)
private record Trajectory(ArrayList<Vec3d> path, HitResult.Type type)
{}
private Trajectory getTrajectory(float partialTicks)
{
ClientPlayerEntity player = MC.player;
ArrayList<Vec3d> path = new ArrayList<>();
HitResult.Type type = HitResult.Type.MISS;
// find the hand with a throwable item
Hand hand = Hand.MAIN_HAND;
ItemStack stack = player.getMainHandStack();
if(!isThrowable(stack))
{
hand = Hand.OFF_HAND;
stack = player.getOffHandStack();
// if neither hand has a throwable item, return empty path
if(!isThrowable(stack))
return new Trajectory(path, type);
}
// calculate item-specific values
Item item = stack.getItem();
double throwPower = getThrowPower(item);
double gravity = getProjectileGravity(item);
// check if item is throwable
if(stack.isEmpty() || !isThrowable(item))
return path;
// calculate starting position
double arrowPosX = player.lastRenderX
+ (player.getX() - player.lastRenderX) * partialTicks
- Math.cos(Math.toRadians(player.getYaw())) * 0.16;
double arrowPosY = player.lastRenderY
+ (player.getY() - player.lastRenderY) * partialTicks
+ player.getStandingEyeHeight() - 0.1;
double arrowPosZ = player.lastRenderZ
+ (player.getZ() - player.lastRenderZ) * partialTicks
- Math.sin(Math.toRadians(player.getYaw())) * 0.16;
// Motion factor. Arrows go faster than snowballs and all that...
double arrowMotionFactor = item instanceof RangedWeaponItem ? 1.0 : 0.4;
// prepare yaw and pitch
double yaw = Math.toRadians(player.getYaw());
double pitch = Math.toRadians(player.getPitch());
// calculate starting position
Vec3d arrowPos = EntityUtils.getLerpedPos(player, partialTicks)
.add(getHandOffset(hand, yaw));
// calculate starting motion
double arrowMotionX =
-Math.sin(yaw) * Math.cos(pitch) * arrowMotionFactor;
double arrowMotionY = -Math.sin(pitch) * arrowMotionFactor;
double arrowMotionZ =
Math.cos(yaw) * Math.cos(pitch) * arrowMotionFactor;
// 3D Pythagorean theorem. Returns the length of the arrowMotion vector.
double arrowMotion = Math.sqrt(arrowMotionX * arrowMotionX
+ arrowMotionY * arrowMotionY + arrowMotionZ * arrowMotionZ);
arrowMotionX /= arrowMotion;
arrowMotionY /= arrowMotion;
arrowMotionZ /= arrowMotion;
// apply bow charge
if(item instanceof RangedWeaponItem)
{
float bowPower = (72000 - player.getItemUseTimeLeft()) / 20.0f;
bowPower = (bowPower * bowPower + bowPower * 2.0f) / 3.0f;
if(bowPower > 1 || bowPower <= 0.1F)
bowPower = 1;
bowPower *= 3F;
arrowMotionX *= bowPower;
arrowMotionY *= bowPower;
arrowMotionZ *= bowPower;
}else
{
arrowMotionX *= 1.5;
arrowMotionY *= 1.5;
arrowMotionZ *= 1.5;
}
double gravity = getProjectileGravity(item);
Vec3d eyesPos = RotationUtils.getEyesPos();
Vec3d arrowMotion = getStartingMotion(yaw, pitch, throwPower);
// build the path
for(int i = 0; i < 1000; i++)
{
// add to path
Vec3d arrowPos = new Vec3d(arrowPosX, arrowPosY, arrowPosZ);
path.add(arrowPos);
// apply motion
arrowPosX += arrowMotionX * 0.1;
arrowPosY += arrowMotionY * 0.1;
arrowPosZ += arrowMotionZ * 0.1;
arrowPos = arrowPos.add(arrowMotion.multiply(0.1));
// apply air friction
arrowMotionX *= 0.999;
arrowMotionY *= 0.999;
arrowMotionZ *= 0.999;
arrowMotion = arrowMotion.multiply(0.999);
// apply gravity
arrowMotionY -= gravity * 0.1;
arrowMotion = arrowMotion.add(0, -gravity * 0.1, 0);
// check for collision
RaycastContext context = new RaycastContext(eyesPos, arrowPos,
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE, MC.player);
if(MC.world.raycast(context).getType() != HitResult.Type.MISS)
Vec3d lastPos = path.size() > 1 ? path.get(path.size() - 2)
: RotationUtils.getEyesPos();
// check for block collision
BlockHitResult bResult =
MC.world.raycast(new RaycastContext(lastPos, arrowPos,
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE, MC.player));
if(bResult.getType() != HitResult.Type.MISS)
{
// replace last pos with the collision point
type = HitResult.Type.BLOCK;
path.set(path.size() - 1, bResult.getPos());
break;
}
// check for entity collision
Box box = new Box(lastPos, arrowPos);
Predicate<Entity> predicate = e -> !e.isSpectator() && e.canHit();
double maxDistSq = 64 * 64;
EntityHitResult eResult = ProjectileUtil.raycast(MC.player, lastPos,
arrowPos, box, predicate, maxDistSq);
if(eResult != null && eResult.getType() != HitResult.Type.MISS)
{
// replace last pos with the collision point
type = HitResult.Type.ENTITY;
path.set(path.size() - 1, eResult.getPos());
break;
}
}
return path;
return new Trajectory(path, type);
}
private Vec3d getHandOffset(Hand hand, double yaw)
{
Arm mainArm = MC.options.getMainArm().getValue();
boolean rightSide = mainArm == Arm.RIGHT && hand == Hand.MAIN_HAND
|| mainArm == Arm.LEFT && hand == Hand.OFF_HAND;
double sideMultiplier = rightSide ? -1 : 1;
double handOffsetX = Math.cos(yaw) * 0.16 * sideMultiplier;
double handOffsetY = MC.player.getStandingEyeHeight() - 0.1;
double handOffsetZ = Math.sin(yaw) * 0.16 * sideMultiplier;
return new Vec3d(handOffsetX, handOffsetY, handOffsetZ);
}
private Vec3d getStartingMotion(double yaw, double pitch, double throwPower)
{
double cosOfPitch = Math.cos(pitch);
double arrowMotionX = -Math.sin(yaw) * cosOfPitch;
double arrowMotionY = -Math.sin(pitch);
double arrowMotionZ = Math.cos(yaw) * cosOfPitch;
return new Vec3d(arrowMotionX, arrowMotionY, arrowMotionZ).normalize()
.multiply(throwPower);
}
private double getThrowPower(Item item)
{
// use a static 1.5x for snowballs and such
if(!(item instanceof RangedWeaponItem))
return 1.5;
// calculate bow power
float bowPower = (72000 - MC.player.getItemUseTimeLeft()) / 20F;
bowPower = bowPower * bowPower + bowPower * 2F;
// clamp value if fully charged or not charged at all
if(bowPower > 3 || bowPower <= 0.3F)
bowPower = 3;
return bowPower;
}
private double getProjectileGravity(Item item)
{
if(item instanceof BowItem || item instanceof CrossbowItem)
if(item instanceof RangedWeaponItem)
return 0.05;
if(item instanceof PotionItem)
if(item instanceof ThrowablePotionItem)
return 0.4;
if(item instanceof FishingRodItem)
@ -249,13 +309,15 @@ public final class TrajectoriesHack extends Hack implements RenderListener
return 0.03;
}
private boolean isThrowable(Item item)
public static boolean isThrowable(ItemStack stack)
{
return item instanceof BowItem || item instanceof CrossbowItem
|| item instanceof SnowballItem || item instanceof EggItem
|| item instanceof EnderPearlItem
|| item instanceof SplashPotionItem
|| item instanceof LingeringPotionItem
if(stack.isEmpty())
return false;
Item item = stack.getItem();
return item instanceof RangedWeaponItem || item instanceof SnowballItem
|| item instanceof EggItem || item instanceof EnderPearlItem
|| item instanceof ThrowablePotionItem
|| item instanceof FishingRodItem || item instanceof TridentItem;
}
}

View File

@ -157,9 +157,14 @@ public final class TunnellerHack extends Hack
currentBlock = null;
}
for(VertexBuffer buffer : vertexBuffers)
if(buffer != null)
buffer.close();
for(int i = 0; i < vertexBuffers.length; i++)
{
if(vertexBuffers[i] == null)
continue;
vertexBuffers[i].close();
vertexBuffers[i] = null;
}
}
@Override
@ -734,7 +739,10 @@ public final class TunnellerHack extends Hack
lastTorch = null;
nextTorch = new BlockPos(MC.player.getPos());
if(vertexBuffers[4] != null)
{
vertexBuffers[4].close();
vertexBuffers[4] = null;
}
return false;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks.autocomplete;
import net.wurstclient.settings.EnumSetting;
public final class ApiProviderSetting
extends EnumSetting<ApiProviderSetting.ApiProvider>
{
public ApiProviderSetting()
{
super("API provider",
"\u00a7lOpenAI\u00a7r lets you use models like ChatGPT, but requires an"
+ " account with API access, costs money to use and sends your chat"
+ " history to their servers. The name is a lie - it's closed"
+ " source.\n\n"
+ "\u00a7loobabooga\u00a7r lets you use models like LLaMA and many"
+ " others. It's a true open source alternative to OpenAI that you"
+ " can run locally on your own computer. It's free to use and does"
+ " not send your chat history to any servers.",
ApiProvider.values(), ApiProvider.OOBABOOGA);
}
public enum ApiProvider
{
OPENAI("OpenAI"),
OOBABOOGA("oobabooga");
private final String name;
private ApiProvider(String name)
{
this.name = name;
}
@Override
public String toString()
{
return name;
}
}
}

View File

@ -0,0 +1,108 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks.autocomplete;
import java.io.IOException;
import java.util.List;
import com.google.gson.JsonObject;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.ChatHudLine;
import net.wurstclient.WurstClient;
import net.wurstclient.util.ChatUtils;
import net.wurstclient.util.json.JsonException;
import net.wurstclient.util.json.WsonObject;
public abstract class MessageCompleter
{
protected static final MinecraftClient MC = WurstClient.MC;
protected final ModelSettings modelSettings;
public MessageCompleter(ModelSettings modelSettings)
{
this.modelSettings = modelSettings;
}
public final String completeChatMessage(String draftMessage)
{
// build prompt and parameters
String prompt = buildPrompt(draftMessage);
JsonObject params = buildParams(prompt);
System.out.println(params);
try
{
// send request
WsonObject response = requestCompletion(params);
System.out.println(response);
// read response
return extractCompletion(response);
}catch(IOException | JsonException e)
{
e.printStackTrace();
return "";
}
}
protected String buildPrompt(String draftMessage)
{
// tell the model that it's talking in a Minecraft chat
String prompt = "=== Minecraft chat log ===\n";
// add chat history
List<ChatHudLine.Visible> chatHistory =
MC.inGameHud.getChatHud().visibleMessages;
int messages = 0;
for(int i = chatHistory.size() - 1; i >= 0; i--)
{
// get message
String message = ChatUtils.getAsString(chatHistory.get(i));
// filter out Wurst messages so the model won't admit it's hacking
if(message.startsWith(ChatUtils.WURST_PREFIX))
continue;
// give non-player messages a sender to avoid confusing the model
if(!message.startsWith("<"))
if(modelSettings.filterServerMessages.isChecked())
continue;
else
message = "<System> " + message;
// limit context length to save tokens
if(messages >= modelSettings.contextLength.getValueI())
break;
// add message to prompt
prompt += message + "\n";
messages++;
}
// if the chat history is empty, add a dummy system message
if(chatHistory.isEmpty())
prompt += "<System> " + MC.getSession().getUsername()
+ " joined the game.\n";
// add draft message
prompt += "<" + MC.getSession().getUsername() + "> " + draftMessage;
return prompt;
}
protected abstract JsonObject buildParams(String prompt);
protected abstract WsonObject requestCompletion(JsonObject parameters)
throws IOException, JsonException;
protected abstract String extractCompletion(WsonObject response)
throws JsonException;
}

View File

@ -0,0 +1,188 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks.autocomplete;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.Setting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
public final class ModelSettings
{
public final EnumSetting<OpenAiModel> openAiModel = new EnumSetting<>(
"OpenAI model",
"The model to use for OpenAI API calls.\n\n"
+ "\u00a7lText-Davinci-003\u00a7r (better known as GPT-3) is an"
+ " older model that's less censored than ChatGPT, but it's also"
+ " 10x more expensive to use.\n\n"
+ "\u00a7lGPT-3.5-Turbo\u00a7r (better known as ChatGPT) is"
+ " recommended for most use cases, as it's relatively cheap and"
+ " powerful.\n\n"
+ "\u00a7lGPT-4\u00a7r is more powerful, but only works if OpenAI"
+ " has chosen you to be a beta tester. It can be anywhere from"
+ " 15x to 60x more expensive than ChatGPT.",
OpenAiModel.values(), OpenAiModel.GPT_3_5_TURBO);
public enum OpenAiModel
{
TEXT_DAVINCI_003("text-davinci-003", false),
GPT_3_5_TURBO("gpt-3.5-turbo", true),
GPT_4("gpt-4", true),
GPT_4_32K("gpt-4-32k", true);
private final String name;
private final boolean chat;
private OpenAiModel(String name, boolean chat)
{
this.name = name;
this.chat = chat;
}
@Override
public String toString()
{
return name;
}
public boolean isChatModel()
{
return chat;
}
}
public final SliderSetting maxTokens = new SliderSetting("Max tokens",
"The maximum number of tokens that the model can generate.\n\n"
+ "Higher values allow the model to predict longer chat messages,"
+ " but also increase the time it takes to generate predictions.\n\n"
+ "The default value of 16 is fine for most use cases.\n\n"
+ "When using an API that doesn't support stop sequences (like the"
+ " oobabooga web UI), higher values will result in a lot of wasted"
+ " time and tokens.",
16, 1, 100, 1, ValueDisplay.INTEGER);
public final SliderSetting temperature = new SliderSetting("Temperature",
"Controls the model's creativity and randomness. A higher value will"
+ " result in more creative and sometimes nonsensical completions,"
+ " while a lower value will result in more boring completions.",
0.7, 0, 2, 0.01, ValueDisplay.DECIMAL);
public final SliderSetting topP = new SliderSetting("Top P",
"An alternative to temperature. Makes the model less random by only"
+ " letting it choose from the most likely tokens.\n\n"
+ "A value of 100% disables this feature by letting the model"
+ " choose from all tokens.",
1, 0, 1, 0.01, ValueDisplay.PERCENTAGE);
public final SliderSetting presencePenalty =
new SliderSetting("Presence penalty",
"Penalty for choosing tokens that already appear in the chat"
+ " history.\n\n"
+ "Positive values encourage the model to use synonyms and"
+ " talk about different topics. Negative values encourage the"
+ " model to repeat the same word over and over again.\n\n"
+ "Only works with OpenAI models.",
0, -2, 2, 0.01, ValueDisplay.DECIMAL);
public final SliderSetting frequencyPenalty =
new SliderSetting("Frequency penalty",
"Similar to presence penalty, but based on how often the token"
+ " appears in the chat history.\n\n"
+ "Positive values encourage the model to use synonyms and"
+ " talk about different topics. Negative values encourage the"
+ " model to repeat existing chat messages.\n\n"
+ "Only works with OpenAI models.",
0.6, -2, 2, 0.01, ValueDisplay.DECIMAL);
public final SliderSetting repetitionPenalty =
new SliderSetting("Repetition penalty",
"Similar to presence penalty, but uses a different algorithm.\n\n"
+ "1.0 means no penalty, negative values are not possible and"
+ " 1.5 is the maximum value.\n\n"
+ "Only works with the oobabooga web UI.",
1, 1, 1.5, 0.01, ValueDisplay.DECIMAL);
public final SliderSetting encoderRepetitionPenalty =
new SliderSetting("Encoder repetition penalty",
"Similar to frequency penalty, but uses a different algorithm.\n\n"
+ "1.0 means no penalty, 0.8 behaves like a negative value and"
+ " 1.5 is the maximum value.\n\n"
+ "Only works with the oobabooga web UI.",
1, 0.8, 1.5, 0.01, ValueDisplay.DECIMAL);
public final EnumSetting<StopSequence> stopSequence = new EnumSetting<>(
"Stop sequence",
"Controls how AutoComplete detects the end of a chat message.\n\n"
+ "\u00a7lLine Break\u00a7r is the default value and is recommended"
+ " for most language models.\n\n"
+ "\u00a7lNext Message\u00a7r works better with certain"
+ " code-optimized language models, which have a tendency to insert"
+ " line breaks in the middle of a chat message.",
StopSequence.values(), StopSequence.LINE_BREAK);
public enum StopSequence
{
LINE_BREAK("Line Break", "\n"),
NEXT_MESSAGE("Next Message", "\n<");
private final String name;
private final String sequence;
private StopSequence(String name, String sequence)
{
this.name = name;
this.sequence = sequence;
}
public String getSequence()
{
return sequence;
}
@Override
public String toString()
{
return name;
}
}
public final SliderSetting contextLength = new SliderSetting(
"Context length",
"Controls how many messages from the chat history are used to generate"
+ " predictions.\n\n"
+ "Higher values improve the quality of predictions, but also"
+ " increase the time it takes to generate them, as well as cost"
+ " (for OpenAI API users) or RAM usage (for oobabooga users).",
10, 0, 100, 1, ValueDisplay.INTEGER);
public final CheckboxSetting filterServerMessages =
new CheckboxSetting("Filter server messages",
"Only shows player-made chat messages to the model.\n\n"
+ "This can help you save tokens and get more out of a low"
+ " context length, but it also means that the model will have"
+ " no idea about events like players joining, leaving, dying,"
+ " etc.",
false);
private final List<Setting> settings =
Collections.unmodifiableList(Arrays.asList(openAiModel, maxTokens,
temperature, topP, presencePenalty, frequencyPenalty,
repetitionPenalty, encoderRepetitionPenalty, stopSequence,
contextLength, filterServerMessages));
public void forEach(Consumer<Setting> action)
{
settings.forEach(action);
}
}

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks.autocomplete;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.wurstclient.util.json.JsonException;
import net.wurstclient.util.json.JsonUtils;
import net.wurstclient.util.json.WsonObject;
public final class OobaboogaMessageCompleter extends MessageCompleter
{
public OobaboogaMessageCompleter(ModelSettings modelSettings)
{
super(modelSettings);
}
@Override
protected JsonObject buildParams(String prompt)
{
JsonObject params = new JsonObject();
params.addProperty("prompt", prompt);
params.addProperty("max_length", modelSettings.maxTokens.getValueI());
params.addProperty("temperature", modelSettings.temperature.getValue());
params.addProperty("top_p", modelSettings.topP.getValue());
params.addProperty("repetition_penalty",
modelSettings.repetitionPenalty.getValue());
params.addProperty("encoder_repetition_penalty",
modelSettings.encoderRepetitionPenalty.getValue());
JsonArray stoppingStrings = new JsonArray();
stoppingStrings
.add(modelSettings.stopSequence.getSelected().getSequence());
params.add("stopping_strings", stoppingStrings);
return params;
}
@Override
protected WsonObject requestCompletion(JsonObject parameters)
throws IOException, JsonException
{
// set up the API request
URL url = new URL("http://127.0.0.1:5000/api/v1/generate");
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
// set the request body
conn.setDoOutput(true);
try(OutputStream os = conn.getOutputStream())
{
os.write(JsonUtils.GSON.toJson(parameters).getBytes());
os.flush();
}
// parse the response
return JsonUtils.parseConnectionToObject(conn);
}
@Override
protected String extractCompletion(WsonObject response) throws JsonException
{
// extract completion from response
String completion =
response.getArray("results").getObject(0).getString("text");
// remove newlines
completion = completion.replace("\n", " ");
return completion;
}
}

View File

@ -0,0 +1,107 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks.autocomplete;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.wurstclient.util.json.JsonException;
import net.wurstclient.util.json.JsonUtils;
import net.wurstclient.util.json.WsonObject;
public final class OpenAiMessageCompleter extends MessageCompleter
{
public OpenAiMessageCompleter(ModelSettings modelSettings)
{
super(modelSettings);
}
@Override
protected JsonObject buildParams(String prompt)
{
// build the request parameters
JsonObject params = new JsonObject();
params.addProperty("stop",
modelSettings.stopSequence.getSelected().getSequence());
params.addProperty("model",
"" + modelSettings.openAiModel.getSelected());
params.addProperty("max_tokens", modelSettings.maxTokens.getValueI());
params.addProperty("temperature", modelSettings.temperature.getValue());
params.addProperty("top_p", modelSettings.topP.getValue());
params.addProperty("presence_penalty",
modelSettings.presencePenalty.getValue());
params.addProperty("frequency_penalty",
modelSettings.frequencyPenalty.getValue());
// add the prompt, depending on the model
if(modelSettings.openAiModel.getSelected().isChatModel())
{
JsonArray messages = new JsonArray();
JsonObject promptMessage = new JsonObject();
promptMessage.addProperty("role", "user");
promptMessage.addProperty("content", prompt);
messages.add(promptMessage);
params.add("messages", messages);
}else
params.addProperty("prompt", prompt);
return params;
}
@Override
protected WsonObject requestCompletion(JsonObject parameters)
throws IOException, JsonException
{
// get the API URL
URL url = modelSettings.openAiModel.getSelected().isChatModel()
? new URL("https://api.openai.com/v1/chat/completions")
: new URL("https://api.openai.com/v1/completions");
// set up the API request
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Authorization",
"Bearer " + System.getenv("WURST_OPENAI_KEY"));
// set the request body
conn.setDoOutput(true);
try(OutputStream os = conn.getOutputStream())
{
os.write(JsonUtils.GSON.toJson(parameters).getBytes());
os.flush();
}
// parse the response
return JsonUtils.parseConnectionToObject(conn);
}
@Override
protected String extractCompletion(WsonObject response) throws JsonException
{
// extract completion from response
String completion;
if(modelSettings.openAiModel.getSelected().isChatModel())
completion = response.getArray("choices").getObject(0)
.getObject("message").getString("content");
else
completion =
response.getArray("choices").getObject(0).getString("text");
// remove newlines
completion = completion.replace("\n", " ");
return completion;
}
}

View File

@ -0,0 +1,123 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks.autocomplete;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.wurstclient.settings.Setting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
public final class SuggestionHandler
{
private final ArrayList<String> suggestions = new ArrayList<>();
private final SliderSetting maxSuggestionPerDraft = new SliderSetting(
"Max suggestions per draft",
"How many suggestions the AI is allowed to generate for the same draft"
+ " message.\n\n"
+ "\u00a7c\u00a7lWARNING:\u00a7r Higher values can use up a lot of"
+ " tokens. Definitely limit this to 1 for expensive models like"
+ " GPT-4.",
3, 1, 10, 1, ValueDisplay.INTEGER);
private final SliderSetting maxSuggestionsKept = new SliderSetting(
"Max suggestions kept", "Maximum number of suggestions kept in memory.",
100, 10, 1000, 10, ValueDisplay.INTEGER);
private final SliderSetting maxSuggestionsShown = new SliderSetting(
"Max suggestions shown",
"How many suggestions can be shown above the chat box.\n\n"
+ "If this is set too high, the suggestions will obscure some of"
+ " the existing chat messages. How high you can set this depends"
+ " on your screen resolution and GUI scale.",
5, 1, 10, 1, ValueDisplay.INTEGER);
private final List<Setting> settings = Arrays.asList(maxSuggestionPerDraft,
maxSuggestionsKept, maxSuggestionsShown);
public List<Setting> getSettings()
{
return settings;
}
public boolean hasEnoughSuggestionFor(String draftMessage)
{
synchronized(suggestions)
{
return suggestions.stream().map(String::toLowerCase)
.filter(s -> s.startsWith(draftMessage.toLowerCase()))
.count() >= maxSuggestionPerDraft.getValue();
}
}
public void addSuggestion(String suggestion, String draftMessage,
BiConsumer<SuggestionsBuilder, String> suggestionsUpdater)
{
synchronized(suggestions)
{
String completedMessage = draftMessage + suggestion;
if(!suggestions.contains(completedMessage))
{
suggestions.add(completedMessage);
if(suggestions.size() > maxSuggestionsKept.getValue())
suggestions.remove(0);
}
showSuggestionsImpl(draftMessage, suggestionsUpdater);
}
}
public void showSuggestions(String draftMessage,
BiConsumer<SuggestionsBuilder, String> suggestionsUpdater)
{
synchronized(suggestions)
{
showSuggestionsImpl(draftMessage, suggestionsUpdater);
}
}
private void showSuggestionsImpl(String draftMessage,
BiConsumer<SuggestionsBuilder, String> suggestionsUpdater)
{
SuggestionsBuilder builder = new SuggestionsBuilder(draftMessage, 0);
String inlineSuggestion = null;
int shownSuggestions = 0;
for(int i = suggestions.size() - 1; i >= 0; i--)
{
String s = suggestions.get(i);
if(!s.toLowerCase().startsWith(draftMessage.toLowerCase()))
continue;
if(shownSuggestions >= maxSuggestionsShown.getValue())
break;
builder.suggest(s);
inlineSuggestion = s;
shownSuggestions++;
}
suggestionsUpdater.accept(builder, inlineSuggestion);
}
public void clearSuggestions()
{
synchronized(suggestions)
{
suggestions.clear();
}
}
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.mixin;
import java.util.concurrent.CompletableFuture;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.mojang.brigadier.suggestion.Suggestions;
import net.minecraft.client.gui.screen.ChatInputSuggestor;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.wurstclient.WurstClient;
import net.wurstclient.hacks.AutoCompleteHack;
@Mixin(ChatInputSuggestor.class)
public abstract class ChatInputSuggestorMixin
{
@Shadow
private TextFieldWidget textField;
@Shadow
private CompletableFuture<Suggestions> pendingSuggestions;
@Inject(at = @At("TAIL"), method = "refresh()V")
private void onRefresh(CallbackInfo ci)
{
AutoCompleteHack autoComplete =
WurstClient.INSTANCE.getHax().autoCompleteHack;
if(!autoComplete.isEnabled())
return;
String draftMessage =
textField.getText().substring(0, textField.getCursor());
autoComplete.onRefresh(draftMessage, (builder, suggestion) -> {
textField.setSuggestion(suggestion);
pendingSuggestions = builder.buildFuture();
show(false);
});
}
@Shadow
public abstract void show(boolean narrateFirstSuggestion);
}

View File

@ -471,6 +471,7 @@ public final class NavigatorFeatureScreen extends NavigatorScreen
}
// text
RenderSystem.setShaderColor(1, 1, 1, 1);
int textY = bgy1 + scroll + 2;
for(String line : text.split("\n"))
{

View File

@ -50,6 +50,10 @@ public final class AnchorAuraFilterList extends EntityFilterList
+ damageWarning,
true));
builder.add(new FilterAllaysSetting(
"Won't target allays when auto-placing anchors." + damageWarning,
true));
builder.add(new FilterInvisibleSetting(
"Won't target invisible entities when auto-placing anchors."
+ damageWarning,

View File

@ -50,6 +50,10 @@ public final class CrystalAuraFilterList extends EntityFilterList
+ damageWarning,
true));
builder.add(new FilterAllaysSetting(
"Won't target allays when auto-placing crystals." + damageWarning,
true));
builder.add(new FilterInvisibleSetting(
"Won't target invisible entities when auto-placing crystals."
+ damageWarning,

View File

@ -63,6 +63,7 @@ public class EntityFilterList
FilterPetsSetting.genericCombat(false),
FilterTradersSetting.genericCombat(false),
FilterGolemsSetting.genericCombat(false),
FilterAllaysSetting.genericCombat(false),
FilterInvisibleSetting.genericCombat(false),
FilterNamedSetting.genericCombat(false),
FilterShulkerBulletSetting.genericCombat(false),

View File

@ -56,6 +56,8 @@ public final class FollowFilterList extends EntityFilterList
builder.add(new FilterGolemsSetting(
"Won't follow iron golems, snow golems and shulkers.", true));
builder.add(new FilterAllaysSetting("Won't follow allays.", true));
builder.add(new FilterInvisibleSetting(
"Won't follow invisible entities.", false));

View File

@ -55,6 +55,8 @@ public final class RemoteViewFilterList extends EntityFilterList
builder.add(new FilterGolemsSetting(
"Won't view iron golems, snow golems and shulkers.", true));
builder.add(new FilterAllaysSetting("Won't view allays.", true));
builder.add(new FilterInvisibleSetting("Won't view invisible entities.",
false));

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.settings.filters;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.AllayEntity;
public final class FilterAllaysSetting extends EntityFilterCheckbox
{
public FilterAllaysSetting(String description, boolean checked)
{
super("Filter allays", description, checked);
}
@Override
public boolean test(Entity e)
{
return !(e instanceof AllayEntity);
}
public static FilterAllaysSetting genericCombat(boolean checked)
{
return new FilterAllaysSetting("Won't attack allays.", checked);
}
}

View File

@ -9,7 +9,9 @@ package net.wurstclient.util;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.ChatHudLine;
import net.minecraft.text.MutableText;
import net.minecraft.text.OrderedText;
import net.minecraft.text.Text;
import net.wurstclient.WurstClient;
@ -64,4 +66,16 @@ public enum ChatUtils
{
message(SYNTAX_ERROR_PREFIX + message);
}
public static String getAsString(ChatHudLine.Visible visible)
{
return getAsString(visible.content());
}
public static String getAsString(OrderedText text)
{
JustGiveMeTheStringVisitor visitor = new JustGiveMeTheStringVisitor();
text.accept(visitor);
return visitor.toString();
}
}

View File

@ -15,7 +15,10 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.projectile.ShulkerBulletEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.wurstclient.WurstClient;
public enum EntityUtils
@ -38,4 +41,22 @@ public enum EntityUtils
|| e instanceof ShulkerBulletEntity)
&& e != MC.player && !(e instanceof FakePlayerEntity)
&& !WURST.getFriends().isFriend(e);
public static Stream<AnimalEntity> getValidAnimals()
{
return StreamSupport.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof AnimalEntity).map(e -> (AnimalEntity)e)
.filter(IS_VALID_ANIMAL);
}
public static Predicate<AnimalEntity> IS_VALID_ANIMAL =
a -> a != null && !a.isRemoved() && a.getHealth() > 0;
public static Vec3d getLerpedPos(Entity e, float partialTicks)
{
double x = MathHelper.lerp(partialTicks, e.lastRenderX, e.getX());
double y = MathHelper.lerp(partialTicks, e.lastRenderY, e.getY());
double z = MathHelper.lerp(partialTicks, e.lastRenderZ, e.getZ());
return new Vec3d(x, y, z);
}
}

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.util;
import net.minecraft.client.gui.hud.ChatHudLine;
import net.minecraft.text.CharacterVisitor;
import net.minecraft.text.Style;
/**
* A {@link CharacterVisitor} to completely bypass Mojang's visitor
* system and just get the damn {@link String} out of a
* {@link ChatHudLine.Visible}.
*
* <p>
* Is this seriously the replacement for <code>getString()</code>?
* What were they thinking?!
*/
public class JustGiveMeTheStringVisitor implements CharacterVisitor
{
private final StringBuilder sb = new StringBuilder();
@Override
public boolean accept(int index, Style style, int codePoint)
{
sb.appendCodePoint(codePoint);
return true;
}
@Override
public String toString()
{
return sb.toString();
}
}

View File

@ -15,6 +15,7 @@
"description.wurst.setting.arrowdmg.trident_yeet_mode": "When enabled, tridents fly much further. Doesn't seem to affect damage or Riptide.\n\n§c§lWARNING:§r You can easily lose your trident by enabling this option!",
"description.wurst.hack.autoarmor": "Manages your armor automatically.",
"description.wurst.hack.autobuild": "Builds things automatically.\nPlace a single block to start building.",
"description.wurst.hack.autocomplete": "Auto-completes your chat messages using large language models. Requires either an OpenAI account with API access or a locally installed language model with the oobabooga web UI.",
"description.wurst.hack.autodrop": "Automatically drops unwanted items.",
"description.wurst.hack.autoleave": "Automatically leaves the server when your health is low.",
"description.wurst.hack.autolibrarian": "Automatically trains a villager to become a librarian that sells a specific enchanted book. You can set up an entire trading hall in no time by using this hack.",

View File

@ -2,3 +2,4 @@ accessWidener v1 named
accessible class net/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier
accessible class net/minecraft/client/util/telemetry/TelemetrySender$PlayerGameMode
accessible field net/minecraft/client/toast/ToastManager toastQueue Ljava/util/Deque;
accessible field net/minecraft/client/gui/hud/ChatHud visibleMessages Ljava/util/List;

View File

@ -16,6 +16,7 @@
"CactusBlockMixin",
"CameraMixin",
"ChatHudMixin",
"ChatInputSuggestorMixin",
"ChatScreenMixin",
"ChunkOcclusionGraphBuilderMixin",
"ClientConnectionMixin",