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

Merge branch 'master' into DeathScreen-AutoRespawn

This commit is contained in:
Alexander01998 2023-11-10 10:34:49 +01:00 committed by GitHub
commit c7f8505d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
378 changed files with 9244 additions and 6900 deletions

View File

@ -1,31 +0,0 @@
---
name: Bug Report
about: Report a bug
title: ''
labels: bug
assignees: ''
---
Before posting, please make sure that this hasn't already been reported by someone else.
## Description
What's wrong?
## Steps To Reproduce
Please make a list of steps to reproduce the problem (ideally from a fresh Wurst installation):
1.
2.
3.
## Screenshots / Videos (Optional)
If applicable, add screenshots, videos or other files to help explain the problem.
## Crash Report
Please find your crash report file at "%appdata%/.minecraft/crash-reports", open the file in a text editor and copy-paste its content below.
```
(crash report goes here)
```
**Please note:** If the game did not crash, please hold down F3+C for 10 seconds to generate a crash report. Even when a bug doesn't cause the game to crash, this file still contains useful information that can help us to find and fix the problem. Because of this, please always include a crash report.

66
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Bug Report
description: Report a bug
labels: ["type:bug", "status:unconfirmed"]
body:
- type: markdown
attributes:
value: |
## Welcome!
Please fill out the following template to help us understand and reproduce the issue you're experiencing.
- type: checkboxes
id: checklist
attributes:
label: Pre-reporting checklist
description: "Please select all that apply."
options:
- label: "I have searched existing issues and didn't find any previous reports of this bug."
- label: "This bug still happens in the latest version of Wurst. I've made sure my installation is up to date."
- label: "I have tried removing all other mods and the bug still happens."
- type: textarea
id: description
attributes:
label: Description
description: "Please describe the bug in as much detail as possible."
validations:
required: true
- type: textarea
id: repro
attributes:
label: Repro steps
description: "How do you trigger this bug? Please walk us through it step by step."
value: |
1.
2.
3.
validations:
required: true
- type: input
id: wurst-version
attributes:
label: Wurst Client version
placeholder: e.g. 7.15
validations:
required: true
- type: input
id: minecraft-version
attributes:
label: Minecraft version
placeholder: e.g. 1.16.5
validations:
required: true
- type: textarea
id: crash
attributes:
label: Crash report (if applicable)
description: "If your game crashed, please paste the entire crash report here."
placeholder: |
---- Minecraft Crash Report ----
// Who set us up the TNT?
render: plaintext
validations:
required: false
- type: markdown
attributes:
value: |
## Thank you!
We appreciate your help in improving Wurst Client by reporting this bug. Please make sure you have filled out all the necessary information before submitting this issue.

View File

@ -1,7 +1,7 @@
blank_issues_enabled: true
contact_links:
- name: Reddit Community
url: https://www.reddit.com/r/WurstClient/
- name: WurstForum
url: https://wurstforum.net/?utm_source=GitHub&utm_medium=Wurst7+repo
about: For general discussion, support, memes, etc.
- name: Contact Alexander
url: https://www.wurstclient.net/contact/?utm_source=GitHub&utm_medium=Wurst7&utm_campaign=Issues&utm_content=Contact+Alexander

View File

@ -1,14 +0,0 @@
---
name: Suggestion
about: Suggest a new hack/command/setting/etc.
title: ''
labels: enhancement
assignees: ''
---
Before posting, please make sure that this hasn't already been suggested by someone else.
## Description
What does it do and how is it useful? Please assume that we have never heard of it before. Just mentioning a name won't work. If it's for an older version of Minecraft (like 1.8 or 1.12), please mention that too.
## Screenshots / Videos (Optional)
If applicable, add screenshots, videos or other files to help explain the suggestion.

62
.github/ISSUE_TEMPLATE/suggestion.yml vendored Normal file
View File

@ -0,0 +1,62 @@
name: Suggestion
description: "Suggest a change to improve the Wurst Client"
labels: ["type:enhancement", "status:unconfirmed"]
body:
- type: markdown
attributes:
value: |
## Welcome!
Please fill out the following template to help us understand the improvement you're suggesting.
- type: checkboxes
id: checklist
attributes:
label: Pre-suggestion checklist
description: "Please select all that apply."
options:
- label: "I have searched existing issues and didn't find any previous issues with the same suggestion."
- label: "This is only one suggestion. I understand that GitHub issues don't work well with lists."
- label: "This feature doesn't already exist in the latest version of Wurst. I've made sure my installation is up to date."
- label: "I have looked at the code and am reasonably confident that this suggestion is possible to implement."
- type: dropdown
id: type
attributes:
label: What type of improvement are you suggesting?
multiple: true
options:
- "Adding a new hack."
- "Adding a new chat command."
- "Adding a different kind of feature."
- "Changing the settings of existing features."
- "Porting existing features to a different Minecraft version."
- "Turning a Wurst feature into a standalone mod."
- "Removing an old feature that doesn't work anymore."
- "Other (please explain in description)"
validations:
required: true
- type: dropdown
id: target-audience
attributes:
label: What type of player would find this improvement useful?
multiple: true
options:
- "Builders"
- "Miners"
- "Griefers"
- "PVPers"
- "Redstoners"
- "Anarchy/faction players"
- "Other (please explain in description)"
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: "Please describe the improvement in as much detail as possible. What does it do and how is it useful? Assume that we have never heard of it before, even if it exists in other hacked clients."
validations:
required: true
- type: markdown
attributes:
value: |
## Thank you!
We appreciate your help in improving Wurst Client by suggesting this improvement. Please make sure you have filled out all the necessary information before submitting this issue.

View File

@ -1,7 +1,7 @@
<!--NOTE: If you are contributing multiple unrelated features, please create a separate pull request for each feature. Squeezing everything into one giant pull request makes it very difficult for me to add your features, as I have to test, validate and add them one by one. Thank you for your understanding - and thanks again for taking the time to contribute!!-->
## Description
What have you added and what does it do? (Alternatively, what have you fixed and how does it work?)
> What have you added and what does it do? (Alternatively, what have you fixed and how does it work?)
## (Optional) screenshots / videos
If applicable, add screenshots or videos to help explain your pull request.
> If applicable, add screenshots or videos to help explain your pull request.

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

@ -0,0 +1,43 @@
# 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:
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
pull_request:
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'microsoft'
- 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
- name: VirusTotal scan
if: github.event_name == 'push'
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
files: |
./build/libs/*.jar
continue-on-error: true

View File

@ -1,6 +1,9 @@
name: JSON syntax
on:
push:
paths:
- '**.json'
pull_request:
paths:
- '**.json'
@ -9,8 +12,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1.0.3
- name: Checkout repository
uses: actions/checkout@v4
- name: Check JSON syntax
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

37
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: "Close stale issues and pull requests"
on:
schedule:
- cron: "30 1 * * 1-5"
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@main
with:
stale-issue-message: |
This issue has been open for a while with no recent activity. If this issue is still important to you, please add a comment within the next 7 days to keep it open. Otherwise, the issue will be automatically closed to free up time for other tasks.
Issues should be closed if:
- They are duplicates of other issues
- There is not enough demand
- They are no longer relevant
- There are not enough details
stale-pr-message: |
This pull request has been open for a while with no recent activity. If you're still working on this or waiting for a review, please add a comment or commit within the next 7 days to keep it open. Otherwise, the pull request will be automatically closed to free up time for other tasks.
Pull requests should be closed if:
- They have been superseded by another pull request
- They are out of scope or don't align with the project
- They have become obsolete due to other changes
- They have bugs or conflicts that won't be resolved
days-before-stale: 60
days-before-close: 7
stale-issue-label: "status:stale"
stale-pr-label: "status:stale"
operations-per-run: 50
enable-statistics: true

View File

@ -5,7 +5,7 @@ buildscript {
}
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
}
@ -50,7 +50,7 @@ loom {
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
@ -81,7 +81,7 @@ publishing {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.

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

@ -1,18 +1,19 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.14
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.23
#Fabric api
fabric_version=0.75.1+1.19.3
fabric_version=0.90.4+1.20.2
# Mod Properties
mod_version = v7.32-MC1.19.3
mod_version = v7.38.1-MC1.20.2
maven_group = net.wurstclient
archives_base_name = Wurst-Client

Binary file not shown.

View File

@ -1,5 +1,7 @@
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.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

33
gradlew vendored
View File

@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@ -80,13 +80,11 @@ do
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
@ -205,6 +214,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 +246,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"

181
gradlew.bat vendored
View File

@ -1,89 +1,92 @@
@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=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
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

@ -10,18 +10,15 @@ package net.wurstclient;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringJoiner;
import net.minecraft.client.MinecraftClient;
import net.minecraft.text.StringVisitable;
import net.minecraft.text.Style;
import net.wurstclient.event.EventManager;
import net.wurstclient.keybinds.PossibleKeybind;
import net.wurstclient.mixinterface.IMinecraftClient;
import net.wurstclient.settings.Setting;
import net.wurstclient.util.ChatUtils;
public abstract class Feature
{
@ -48,14 +45,7 @@ public abstract class Feature
public String getWrappedDescription(int width)
{
List<StringVisitable> lines = MC.textRenderer.getTextHandler()
.wrapLines(getDescription(), width, Style.EMPTY);
StringJoiner joiner = new StringJoiner("\n");
lines.stream().map(StringVisitable::getString)
.forEach(s -> joiner.add(s));
return joiner.toString();
return ChatUtils.wrapText(getDescription(), width);
}
public Category getCategory()

View File

@ -12,6 +12,28 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Adds search tags to a Wurst feature so that it can be found through the
* search bar in the Navigator GUI.
*
* <p>
* Navigator can already find features by their name and description, so
* repeating that information in the search tags is pointless. However, names
* and descriptions of settings are not used by Navigator, so repeating those
* can make sense if people are likely to search for them.
*
* <p>
* Navigator is not case-sensitive, so for example "NukerLegit" and "nukerlegit"
* are treated the same. However, Navigator struggles with spaces and the order
* of words, for example "NukerLegit", "Nuker Legit" and "Legit Nuker" are all
* treated differently.
*
* <p>
* By convention, search tags with spaces should be written in lower case and
* search tags without spaces should be written in camel case. For example,
* "NukerLegit" and "nuker legit". This is not enforced, but it makes the
* code easier to read.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SearchTags

View File

@ -10,7 +10,6 @@ package net.wurstclient;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -23,6 +22,7 @@ import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.client.util.InputUtil;
import net.wurstclient.altmanager.AltManager;
import net.wurstclient.altmanager.Encryption;
import net.wurstclient.analytics.WurstAnalytics;
import net.wurstclient.clickgui.ClickGui;
import net.wurstclient.command.CmdList;
@ -40,6 +40,7 @@ import net.wurstclient.hack.HackList;
import net.wurstclient.hud.IngameHUD;
import net.wurstclient.keybinds.KeybindList;
import net.wurstclient.keybinds.KeybindProcessor;
import net.wurstclient.mixinterface.ILanguageManager;
import net.wurstclient.mixinterface.IMinecraftClient;
import net.wurstclient.navigator.Navigator;
import net.wurstclient.other_feature.OtfList;
@ -56,8 +57,8 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;
public static final String VERSION = "7.32";
public static final String MC_VERSION = "1.19.3";
public static final String VERSION = "7.38.1";
public static final String MC_VERSION = "1.20.2";
private WurstAnalytics analytics;
private EventManager eventManager;
@ -145,13 +146,11 @@ public enum WurstClient
problematicPackDetector.start();
Path altsFile = wurstFolder.resolve("alts.encrypted_json");
Path encFolder =
Paths.get(System.getProperty("user.home"), ".Wurst encryption")
.normalize();
Path encFolder = Encryption.chooseEncryptionFolder();
altManager = new AltManager(altsFile, encFolder);
zoomKey = new KeyBinding("key.wurst.zoom", InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_V, "Zoom");
GLFW.GLFW_KEY_V, KeyBinding.MISC_CATEGORY);
KeyBindingHelper.registerKeyBinding(zoomKey);
analytics.trackPageView("/mc" + MC_VERSION + "/v" + VERSION,
@ -179,7 +178,13 @@ public enum WurstClient
public String translate(String key)
{
if(otfs.translationsOtf.getForceEnglish().isChecked())
return IMC.getLanguageManager().getEnglish().get(key);
return ILanguageManager.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

@ -30,7 +30,7 @@ public class FlyPathProcessor extends PathProcessor
public void process()
{
// get positions
BlockPos pos = new BlockPos(MC.player.getPos());
BlockPos pos = BlockPos.ofFloored(MC.player.getPos());
Vec3d posVec = MC.player.getPos();
BlockPos nextPos = path.get(index);
int posIndex = path.indexOf(pos);
@ -151,4 +151,10 @@ public class FlyPathProcessor extends PathProcessor
}
}
}
@Override
public boolean canBreakBlocks()
{
return true;
}
}

View File

@ -19,10 +19,14 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.block.*;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.LavaFluid;
import net.minecraft.fluid.WaterFluid;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.wurstclient.WurstClient;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;
public class PathFinder
@ -63,11 +67,12 @@ public class PathFinder
public PathFinder(BlockPos goal)
{
if(WurstClient.MC.player.isOnGround())
start = new PathPos(new BlockPos(WurstClient.MC.player.getX(),
start = new PathPos(BlockPos.ofFloored(WurstClient.MC.player.getX(),
WurstClient.MC.player.getY() + 0.5,
WurstClient.MC.player.getZ()));
else
start = new PathPos(new BlockPos(WurstClient.MC.player.getPos()));
start =
new PathPos(BlockPos.ofFloored(WurstClient.MC.player.getPos()));
this.goal = goal;
costMap.put(start, 0F);
@ -196,15 +201,13 @@ public class PathFinder
&& (flying || canClimbUpAt(pos) || goal.equals(up)
|| canSafelyStandOn(north) || canSafelyStandOn(east)
|| canSafelyStandOn(south) || canSafelyStandOn(west))
&& (divingAllowed || BlockUtils.getState(up.up())
.getMaterial() != Material.WATER))
&& (divingAllowed || BlockUtils.getBlock(up.up()) != Blocks.WATER))
neighbors.add(new PathPos(up, onGround));
// down
if(pos.getY() > WurstClient.MC.world.getBottomY() && canGoThrough(down)
&& canGoAbove(down.down()) && (flying || canFallBelow(pos))
&& (divingAllowed
|| BlockUtils.getState(pos).getMaterial() != Material.WATER))
&& (divingAllowed || BlockUtils.getBlock(pos) != Blocks.WATER))
neighbors.add(new PathPos(down));
return neighbors;
@ -246,8 +249,7 @@ public class PathFinder
if(!canGoAbove(pos.down()))
return false;
if(!divingAllowed
&& BlockUtils.getState(up).getMaterial() == Material.WATER)
if(!divingAllowed && BlockUtils.getBlock(up) == Blocks.WATER)
return false;
return true;
@ -265,8 +267,7 @@ public class PathFinder
if(!canGoAbove(pos.down()))
return false;
if(!divingAllowed
&& BlockUtils.getState(up).getMaterial() == Material.WATER)
if(!divingAllowed && BlockUtils.getBlock(up) == Blocks.WATER)
return false;
return true;
@ -277,16 +278,15 @@ public class PathFinder
return false;
}
@SuppressWarnings("deprecation")
protected boolean canBeSolid(BlockPos pos)
{
BlockState state = BlockUtils.getState(pos);
Material material = state.getMaterial();
Block block = state.getBlock();
return material.blocksMovement()
&& !(block instanceof AbstractSignBlock)
|| block instanceof LadderBlock || jesus
&& (material == Material.WATER || material == Material.LAVA);
return state.blocksMovement() && !(block instanceof AbstractSignBlock)
|| block instanceof LadderBlock
|| jesus && (block == Blocks.WATER || block == Blocks.LAVA);
}
@SuppressWarnings("deprecation")
@ -299,9 +299,9 @@ public class PathFinder
return false;
// check if solid
Material material = BlockUtils.getState(pos).getMaterial();
Block block = BlockUtils.getBlock(pos);
if(material.blocksMovement() && !(block instanceof AbstractSignBlock))
BlockState state = BlockUtils.getState(pos);
Block block = state.getBlock();
if(state.blocksMovement() && !(block instanceof AbstractSignBlock))
return false;
// check if trapped
@ -311,7 +311,7 @@ public class PathFinder
// check if safe
if(!invulnerable
&& (material == Material.LAVA || material == Material.FIRE))
&& (block == Blocks.LAVA || block instanceof AbstractFireBlock))
return false;
return true;
@ -331,13 +331,14 @@ public class PathFinder
private boolean canSafelyStandOn(BlockPos pos)
{
// check if solid
Material material = BlockUtils.getState(pos).getMaterial();
if(!canBeSolid(pos))
return false;
// check if safe
if(!invulnerable
&& (material == Material.CACTUS || material == Material.LAVA))
BlockState state = BlockUtils.getState(pos);
Fluid fluid = state.getFluidState().getFluid();
if(!invulnerable && (state.getBlock() instanceof CactusBlock
|| fluid instanceof LavaFluid))
return false;
return true;
@ -380,7 +381,7 @@ public class PathFinder
// check if block resets fall damage
Block prevBlock = BlockUtils.getBlock(prevPos);
BlockState prevState = BlockUtils.getState(prevPos);
if(prevState.getMaterial() == Material.WATER
if(prevState.getFluidState().getFluid() instanceof WaterFluid
|| prevBlock instanceof LadderBlock
|| prevBlock instanceof VineBlock
|| prevBlock instanceof CobwebBlock)
@ -394,8 +395,8 @@ public class PathFinder
private boolean canFlyAt(BlockPos pos)
{
return flying || !noWaterSlowdown
&& BlockUtils.getState(pos).getMaterial() == Material.WATER;
return flying
|| !noWaterSlowdown && BlockUtils.getBlock(pos) == Blocks.WATER;
}
private boolean canClimbUpAt(BlockPos pos)
@ -421,7 +422,7 @@ public class PathFinder
{
// check feet
Block blockFeet = BlockUtils.getBlock(pos);
if(BlockUtils.getState(pos).getMaterial().isLiquid()
if(BlockUtils.getBlock(pos) instanceof FluidBlock
|| blockFeet instanceof LadderBlock
|| blockFeet instanceof VineBlock
|| blockFeet instanceof CobwebBlock)
@ -429,7 +430,7 @@ public class PathFinder
// check head
Block blockHead = BlockUtils.getBlock(pos.up());
if(BlockUtils.getState(pos.up()).getMaterial().isLiquid()
if(BlockUtils.getBlock(pos.up()) instanceof FluidBlock
|| blockHead instanceof CobwebBlock)
return true;
@ -444,12 +445,12 @@ public class PathFinder
for(int i = 0; i < positions.length; i++)
{
BlockPos pos = positions[i];
Material material = BlockUtils.getState(pos).getMaterial();
Block block = BlockUtils.getBlock(pos);
// liquids
if(material == Material.WATER && !noWaterSlowdown)
if(block == Blocks.WATER && !noWaterSlowdown)
costs[i] *= 1.3164437838225804F;
else if(material == Material.LAVA)
else if(block == Blocks.LAVA)
costs[i] *= 4.539515393656079F;
// soul sand
@ -556,13 +557,15 @@ public class PathFinder
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
if(!depthTest)
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
matrixStack.push();
RenderUtils.applyRenderOffset(matrixStack);
RegionPos region = RenderUtils.getCameraRegion();
RenderUtils.applyRegionalRenderOffset(matrixStack, region);
matrixStack.translate(0.5, 0.5, 0.5);
if(debugMode)
@ -576,7 +579,7 @@ public class PathFinder
if(renderedThings >= 5000)
break;
PathRenderer.renderNode(matrixStack, element);
PathRenderer.renderNode(matrixStack, element, region);
renderedThings++;
}
@ -592,7 +595,7 @@ public class PathFinder
RenderSystem.setShaderColor(1, 0, 0, 0.75F);
PathRenderer.renderArrow(matrixStack, entry.getValue(),
entry.getKey());
entry.getKey(), region);
renderedThings++;
}
}
@ -603,7 +606,8 @@ public class PathFinder
else
RenderSystem.setShaderColor(0, 1, 0, 0.75F);
for(int i = 0; i < path.size() - 1; i++)
PathRenderer.renderArrow(matrixStack, path.get(i), path.get(i + 1));
PathRenderer.renderArrow(matrixStack, path.get(i), path.get(i + 1),
region);
matrixStack.pop();
@ -611,7 +615,6 @@ public class PathFinder
RenderSystem.setShaderColor(1, 1, 1, 1);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glDepthMask(true);
}

View File

@ -40,6 +40,8 @@ public abstract class PathProcessor
public abstract void process();
public abstract boolean canBreakBlocks();
public final int getIndex()
{
return index;

View File

@ -19,11 +19,12 @@ import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.BlockPos;
import net.wurstclient.util.RegionPos;
public final class PathRenderer
{
public static void renderArrow(MatrixStack matrixStack, BlockPos start,
BlockPos end)
BlockPos end, RegionPos region)
{
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -31,13 +32,13 @@ public final class PathRenderer
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES,
VertexFormats.POSITION);
int startX = start.getX();
int startX = start.getX() - region.x();
int startY = start.getY();
int startZ = start.getZ();
int startZ = start.getZ() - region.z();
int endX = end.getX();
int endX = end.getX() - region.x();
int endY = end.getY();
int endZ = end.getZ();
int endZ = end.getZ() - region.z();
matrixStack.push();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
@ -98,11 +99,13 @@ public final class PathRenderer
tessellator.draw();
}
public static void renderNode(MatrixStack matrixStack, BlockPos pos)
public static void renderNode(MatrixStack matrixStack, BlockPos pos,
RegionPos region)
{
matrixStack.push();
matrixStack.translate(pos.getX(), pos.getY(), pos.getZ());
matrixStack.translate(pos.getX() - region.x(), pos.getY(),
pos.getZ() - region.z());
matrixStack.scale(0.1F, 0.1F, 0.1F);
Matrix4f matrix = matrixStack.peek().getPositionMatrix();

View File

@ -32,11 +32,11 @@ public class WalkPathProcessor extends PathProcessor
// get positions
BlockPos pos;
if(WurstClient.MC.player.isOnGround())
pos = new BlockPos(WurstClient.MC.player.getX(),
pos = BlockPos.ofFloored(WurstClient.MC.player.getX(),
WurstClient.MC.player.getY() + 0.5,
WurstClient.MC.player.getZ());
else
pos = new BlockPos(WurstClient.MC.player.getPos());
pos = BlockPos.ofFloored(WurstClient.MC.player.getPos());
PathPos nextPos = path.get(index);
int posIndex = path.indexOf(pos);
@ -138,4 +138,10 @@ public class WalkPathProcessor extends PathProcessor
MC.options.forwardKey.setPressed(true);
}
}
@Override
public boolean canBreakBlocks()
{
return MC.player.isOnGround();
}
}

View File

@ -10,14 +10,22 @@ package net.wurstclient.altmanager;
import java.util.HashMap;
import java.util.UUID;
import org.joml.Matrix4f;
import org.lwjgl.opengl.GL11;
import com.mojang.authlib.GameProfile;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.BufferRenderer;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.DefaultSkinHelper;
import net.minecraft.client.util.SkinTextures;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.Uuids;
@ -34,19 +42,46 @@ public final class AltRenderer
if(loadedSkins.get(name) == null)
{
UUID uuid =
Uuids.getUuidFromProfile(new GameProfile((UUID)null, name));
UUID uuid = Uuids.getOfflinePlayerUuid(name);
PlayerListEntry entry =
new PlayerListEntry(new GameProfile(uuid, name), false);
loadedSkins.put(name, entry.getSkinTexture());
loadedSkins.put(name, entry.getSkinTextures().texture());
}
RenderSystem.setShaderTexture(0, loadedSkins.get(name));
}
public static void drawAltFace(MatrixStack matrixStack, String name, int x,
private static void drawTexture(DrawContext context, int x, int y, float u,
float v, int w, int h, int fw, int fh)
{
int x2 = x + w;
int y2 = y + h;
int z = 0;
float uOverFw = u / fw;
float uPlusWOverFw = (u + w) / fw;
float vOverFh = v / fh;
float vPlusHOverFh = (v + h) / fh;
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix4f = matrixStack.peek().getPositionMatrix();
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION_TEXTURE);
bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh)
.next();
bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh)
.next();
bufferBuilder.vertex(matrix4f, x2, y2, z)
.texture(uPlusWOverFw, vPlusHOverFh).next();
bufferBuilder.vertex(matrix4f, x2, y, z).texture(uPlusWOverFw, vOverFh)
.next();
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
}
public static void drawAltFace(DrawContext context, String name, int x,
int y, int w, int h, boolean selected)
{
try
@ -64,14 +99,14 @@ public final class AltRenderer
int fh = 192;
float u = 24;
float v = 24;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Hat
fw = 192;
fh = 192;
u = 120;
v = 24;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
GL11.glDisable(GL11.GL_BLEND);
@ -81,7 +116,7 @@ public final class AltRenderer
}
}
public static void drawAltBody(MatrixStack matrixStack, String name, int x,
public static void drawAltBody(DrawContext context, String name, int x,
int y, int width, int height)
{
try
@ -89,7 +124,8 @@ public final class AltRenderer
bindSkinTexture(name);
boolean slim = DefaultSkinHelper
.getModel(Uuids.getOfflinePlayerUuid(name)).equals("slim");
.getSkinTextures(Uuids.getOfflinePlayerUuid(name))
.model() == SkinTextures.Model.SLIM;
GL11.glEnable(GL11.GL_BLEND);
RenderSystem.setShaderColor(1, 1, 1, 1);
@ -103,7 +139,7 @@ public final class AltRenderer
int fh = height * 2;
float u = height / 4;
float v = height / 4;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Hat
x = x + 0;
@ -112,7 +148,7 @@ public final class AltRenderer
h = height / 4;
u = height / 4 * 5;
v = height / 4;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Chest
x = x + 0;
@ -121,7 +157,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 2.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Jacket
x = x + 0;
@ -130,7 +166,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 2.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Arm
x = x - width / 16 * (slim ? 3 : 4);
@ -139,7 +175,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 5.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Sleeve
x = x + 0;
@ -148,7 +184,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 5.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Arm
x = x + width / 16 * (slim ? 11 : 12);
@ -157,7 +193,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 5.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Sleeve
x = x + 0;
@ -166,7 +202,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 5.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Leg
x = x - width / 2;
@ -175,7 +211,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 0.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Pants
x = x + 0;
@ -184,7 +220,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 0.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Leg
x = x + width / 4;
@ -193,7 +229,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 0.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Pants
x = x + 0;
@ -202,7 +238,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 0.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
GL11.glDisable(GL11.GL_BLEND);
@ -212,7 +248,7 @@ public final class AltRenderer
}
}
public static void drawAltBack(MatrixStack matrixStack, String name, int x,
public static void drawAltBack(DrawContext context, String name, int x,
int y, int width, int height)
{
try
@ -220,7 +256,8 @@ public final class AltRenderer
bindSkinTexture(name);
boolean slim = DefaultSkinHelper
.getModel(Uuids.getOfflinePlayerUuid(name)).equals("slim");
.getSkinTextures(Uuids.getOfflinePlayerUuid(name))
.model() == SkinTextures.Model.SLIM;
GL11.glEnable(GL11.GL_BLEND);
RenderSystem.setShaderColor(1, 1, 1, 1);
@ -234,7 +271,7 @@ public final class AltRenderer
int fh = height * 2;
float u = height / 4 * 3;
float v = height / 4;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Hat
x = x + 0;
@ -243,7 +280,7 @@ public final class AltRenderer
h = height / 4;
u = height / 4 * 7;
v = height / 4;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Chest
x = x + 0;
@ -252,7 +289,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 4;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Jacket
x = x + 0;
@ -261,7 +298,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 4;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Arm
x = x - width / 16 * (slim ? 3 : 4);
@ -270,7 +307,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * (slim ? 6.375F : 6.5F);
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Sleeve
x = x + 0;
@ -279,7 +316,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * (slim ? 6.375F : 6.5F);
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Arm
x = x + width / 16 * (slim ? 11 : 12);
@ -288,7 +325,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * (slim ? 6.375F : 6.5F);
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Sleeve
x = x + 0;
@ -297,7 +334,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * (slim ? 6.375F : 6.5F);
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Leg
x = x - width / 2;
@ -306,7 +343,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 1.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Left Pants
x = x + 0;
@ -315,7 +352,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 1.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Leg
x = x + width / 4;
@ -324,7 +361,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 1.5F;
v = height / 4 * 2.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
// Right Pants
x = x + 0;
@ -333,7 +370,7 @@ public final class AltRenderer
h = height / 8 * 3;
u = height / 4 * 1.5F;
v = height / 4 * 4.5F;
DrawableHelper.drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
drawTexture(context, x, y, u, v, w, h, fw, fh);
GL11.glDisable(GL11.GL_BLEND);

View File

@ -8,12 +8,14 @@
package net.wurstclient.altmanager;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.security.GeneralSecurityException;
import java.security.KeyFactory;
@ -39,6 +41,7 @@ import com.google.gson.JsonParser;
import net.minecraft.util.Util;
import net.minecraft.util.crash.CrashException;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashReportSection;
import net.wurstclient.util.json.JsonException;
import net.wurstclient.util.json.JsonUtils;
import net.wurstclient.util.json.WsonArray;
@ -99,6 +102,57 @@ public final class Encryption
return encFolder;
}
public static Path chooseEncryptionFolder()
{
String userHome = System.getProperty("user.home");
String xdgDataHome = System.getenv("XDG_DATA_HOME");
String encFolderName = ".Wurst encryption";
Path homeEncFolder = Paths.get(userHome, encFolderName).normalize();
Path encFolder = homeEncFolder;
if(xdgDataHome != null && !xdgDataHome.isEmpty())
{
encFolder = Paths.get(xdgDataHome, encFolderName).normalize();
if(!Files.exists(encFolder) && Files.isDirectory(homeEncFolder))
migrateEncryptionFolder(homeEncFolder, encFolder);
}
return encFolder;
}
public static void migrateEncryptionFolder(Path oldFolder, Path newFolder)
{
System.out.println("Migrating encryption folder from " + oldFolder
+ " to " + newFolder);
try
{
Files.createDirectories(newFolder);
File[] oldFiles = oldFolder.toFile().listFiles();
for(File oldFile : oldFiles)
{
Path fileDestination = newFolder.resolve(oldFile.getName());
Files.copy(oldFile.toPath(), fileDestination);
}
for(File oldFile : oldFiles)
oldFile.delete();
Files.deleteIfExists(oldFolder);
}catch(IOException e)
{
CrashReport report =
CrashReport.create(e, "Migrating Wurst encryption folder");
CrashReportSection section = report.addElement("Migration");
section.add("Old path", oldFolder);
section.add("New path", newFolder);
throw new CrashException(report);
}
}
public byte[] decrypt(byte[] bytes)
{
try
@ -195,6 +249,7 @@ public final class Encryption
}
private KeyPair getRsaKeyPair(Path publicFile, Path privateFile)
throws IOException
{
if(Files.notExists(publicFile) || Files.notExists(privateFile))
return createRsaKeys(publicFile, privateFile);
@ -213,7 +268,7 @@ public final class Encryption
}
}
private SecretKey getAesKey(Path path, KeyPair pair)
private SecretKey getAesKey(Path path, KeyPair pair) throws IOException
{
if(Files.notExists(path))
return createAesKey(path, pair);
@ -232,6 +287,7 @@ public final class Encryption
}
private KeyPair createRsaKeys(Path publicFile, Path privateFile)
throws IOException
{
try
{
@ -268,14 +324,14 @@ public final class Encryption
return pair;
}catch(GeneralSecurityException | IOException e)
}catch(GeneralSecurityException e)
{
throw new CrashException(
CrashReport.create(e, "Creating RSA keypair"));
}
}
private SecretKey createAesKey(Path path, KeyPair pair)
private SecretKey createAesKey(Path path, KeyPair pair) throws IOException
{
try
{
@ -293,7 +349,7 @@ public final class Encryption
return key;
}catch(GeneralSecurityException | IOException e)
}catch(GeneralSecurityException e)
{
throw new CrashException(CrashReport.create(e, "Creating AES key"));
}

View File

@ -7,84 +7,21 @@
*/
package net.wurstclient.altmanager;
import java.net.Proxy;
import java.util.Optional;
import com.mojang.authlib.Agent;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.exceptions.AuthenticationUnavailableException;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import net.minecraft.client.util.Session;
import net.minecraft.client.session.Session;
import net.minecraft.util.Uuids;
import net.wurstclient.WurstClient;
public enum LoginManager
{
;
public static void login(String email, String password)
throws LoginException
{
YggdrasilUserAuthentication auth =
(YggdrasilUserAuthentication)new YggdrasilAuthenticationService(
Proxy.NO_PROXY, "").createUserAuthentication(Agent.MINECRAFT);
auth.setUsername(email);
auth.setPassword(password);
try
{
auth.logIn();
GameProfile profile = auth.getSelectedProfile();
String username = profile.getName();
String uuid = profile.getId().toString();
String accessToken = auth.getAuthenticatedToken();
Session session = new Session(username, uuid, accessToken,
Optional.empty(), Optional.empty(), Session.AccountType.MOJANG);
WurstClient.IMC.setSession(session);
}catch(AuthenticationUnavailableException e)
{
throw new LoginException("Cannot contact authentication server!",
e);
}catch(AuthenticationException e)
{
e.printStackTrace();
String msg = e.getMessage().toLowerCase();
if(msg.contains("invalid username or password."))
throw new LoginException("Wrong password! (or shadowbanned)",
e);
if(msg.contains("account migrated"))
throw new LoginException("Account migrated to Mojang account.",
e);
if(msg.contains("migrated"))
throw new LoginException(
"Account migrated to Microsoft account.", e);
throw new LoginException("Cannot contact authentication server!",
e);
}catch(NullPointerException e)
{
e.printStackTrace();
throw new LoginException("Wrong password! (or shadowbanned)", e);
}
}
public static void changeCrackedName(String newName)
{
Session session = new Session(newName, "", "", Optional.empty(),
Optional.empty(), Session.AccountType.MOJANG);
Session session =
new Session(newName, Uuids.getOfflinePlayerUuid(newName), "",
Optional.empty(), Optional.empty(), Session.AccountType.MOJANG);
WurstClient.IMC.setSession(session);
}

View File

@ -30,7 +30,7 @@ import java.util.stream.Collectors;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.minecraft.client.util.Session;
import net.minecraft.client.session.Session;
import net.wurstclient.WurstClient;
import net.wurstclient.util.json.JsonException;
import net.wurstclient.util.json.JsonUtils;

View File

@ -22,9 +22,9 @@ public final class MinecraftProfile
this.mcAccessToken = mcAccessToken;
}
public String getUUID()
public UUID getUUID()
{
return "" + uuid;
return uuid;
}
public String getName()

View File

@ -61,13 +61,7 @@ public final class MojangAlt extends Alt
@Override
public void login() throws LoginException
{
try
{
MicrosoftLoginManager.login(email, password);
}catch(Exception e)
{
LoginManager.login(email, password);
}
MicrosoftLoginManager.login(email, password);
name = getNameFromSession();
}

View File

@ -28,6 +28,8 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
@ -101,7 +103,7 @@ public abstract class AltEditorScreen extends Screen
nameOrEmailBox = new TextFieldWidget(textRenderer, width / 2 - 100, 60,
200, 20, Text.literal(""));
nameOrEmailBox.setMaxLength(48);
nameOrEmailBox.setTextFieldFocused(true);
nameOrEmailBox.setFocused(true);
nameOrEmailBox.setText(getDefaultNameOrEmail());
addSelectableChild(nameOrEmailBox);
@ -117,7 +119,7 @@ public abstract class AltEditorScreen extends Screen
passwordBox.setMaxLength(256);
addSelectableChild(passwordBox);
setInitialFocus(nameOrEmailBox);
setFocused(nameOrEmailBox);
}
private void openSkinFolder()
@ -142,9 +144,6 @@ public abstract class AltEditorScreen extends Screen
@Override
public final void tick()
{
nameOrEmailBox.tick();
passwordBox.tick();
String nameOrEmail = nameOrEmailBox.getText().trim();
boolean alex = nameOrEmail.equalsIgnoreCase("Alexander01998");
@ -342,39 +341,40 @@ public abstract class AltEditorScreen extends Screen
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(matrixStack);
renderBackground(context, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionProgram);
// skin preview
AltRenderer.drawAltBack(matrixStack, nameOrEmailBox.getText(),
AltRenderer.drawAltBack(context, nameOrEmailBox.getText(),
(width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
AltRenderer.drawAltBody(matrixStack, nameOrEmailBox.getText(),
AltRenderer.drawAltBody(context, nameOrEmailBox.getText(),
width - (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
// text
drawStringWithShadow(matrixStack, textRenderer,
"Name (for cracked alts), or", width / 2 - 100, 37, 10526880);
drawStringWithShadow(matrixStack, textRenderer,
"E-Mail (for premium alts)", width / 2 - 100, 47, 10526880);
drawStringWithShadow(matrixStack, textRenderer,
context.drawTextWithShadow(textRenderer, "Name (for cracked alts), or",
width / 2 - 100, 37, 10526880);
context.drawTextWithShadow(textRenderer, "E-Mail (for premium alts)",
width / 2 - 100, 47, 10526880);
context.drawTextWithShadow(textRenderer,
"Password (leave blank for cracked alts)", width / 2 - 100, 87,
10526880);
String[] lines = message.split("\n");
for(int i = 0; i < lines.length; i++)
drawCenteredText(matrixStack, textRenderer, lines[i], width / 2,
142 + 10 * i, 16777215);
context.drawCenteredTextWithShadow(textRenderer, lines[i],
width / 2, 142 + 10 * i, 16777215);
// text boxes
nameOrEmailBox.render(matrixStack, mouseX, mouseY, partialTicks);
passwordBox.render(matrixStack, mouseX, mouseY, partialTicks);
nameOrEmailBox.render(context, mouseX, mouseY, partialTicks);
passwordBox.render(context, mouseX, mouseY, partialTicks);
// red flash for errors
if(errorTimer > 0)
@ -397,7 +397,8 @@ public abstract class AltEditorScreen extends Screen
errorTimer--;
}
super.render(matrixStack, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -28,7 +28,9 @@ import com.google.gson.JsonObject;
import com.mojang.blaze3d.systems.RenderSystem;
import it.unimi.dsi.fastutil.booleans.BooleanConsumer;
import net.fabricmc.fabric.api.client.screen.v1.Screens;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.NoticeScreen;
@ -48,7 +50,6 @@ import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
import net.wurstclient.WurstClient;
import net.wurstclient.altmanager.*;
import net.wurstclient.mixinterface.IScreen;
import net.wurstclient.util.ListWidget;
import net.wurstclient.util.MultiProcessingUtils;
import net.wurstclient.util.json.JsonException;
@ -180,10 +181,12 @@ public final class AltManagerScreen extends Screen
}
@Override
public boolean mouseScrolled(double d, double e, double amount)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
listGui.mouseScrolled(d, e, amount);
return super.mouseScrolled(d, e, amount);
listGui.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
@ -408,12 +411,13 @@ public final class AltManagerScreen extends Screen
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(matrixStack);
listGui.render(matrixStack, mouseX, mouseY, partialTicks);
renderBackground(context, mouseX, mouseY, partialTicks);
listGui.render(context, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -427,20 +431,20 @@ public final class AltManagerScreen extends Screen
if(alt == null)
return;
AltRenderer.drawAltBack(matrixStack, alt.getName(),
AltRenderer.drawAltBack(context, alt.getName(),
(width / 2 - 125) / 2 - 32, height / 2 - 64 - 9, 64, 128);
AltRenderer.drawAltBody(matrixStack, alt.getName(),
AltRenderer.drawAltBody(context, alt.getName(),
width - (width / 2 - 140) / 2 - 32, height / 2 - 64 - 9, 64,
128);
}
// title text
drawCenteredText(matrixStack, textRenderer, "Alt Manager", width / 2, 4,
16777215);
drawCenteredText(matrixStack, textRenderer,
context.drawCenteredTextWithShadow(textRenderer, "Alt Manager",
width / 2, 4, 16777215);
context.drawCenteredTextWithShadow(textRenderer,
"Alts: " + altManager.getList().size(), width / 2, 14, 10526880);
drawCenteredText(
matrixStack, textRenderer, "premium: " + altManager.getNumPremium()
context.drawCenteredTextWithShadow(
textRenderer, "premium: " + altManager.getNumPremium()
+ ", cracked: " + altManager.getNumCracked(),
width / 2, 24, 10526880);
@ -466,13 +470,14 @@ public final class AltManagerScreen extends Screen
errorTimer--;
}
super.render(matrixStack, mouseX, mouseY, partialTicks);
renderButtonTooltip(matrixStack, mouseX, mouseY);
renderAltTooltip(matrixStack, mouseX, mouseY);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
renderButtonTooltip(context, mouseX, mouseY);
renderAltTooltip(context, mouseX, mouseY);
}
private void renderAltTooltip(MatrixStack matrixStack, int mouseX,
int mouseY)
private void renderAltTooltip(DrawContext context, int mouseX, int mouseY)
{
if(!listGui.isMouseInList(mouseX, mouseY))
return;
@ -514,20 +519,15 @@ public final class AltManagerScreen extends Screen
if(alt.isFavorite())
addTooltip(tooltip, "favorite");
renderTooltip(matrixStack, tooltip, mouseX, mouseY);
context.drawTooltip(textRenderer, tooltip, mouseX, mouseY);
}
private void renderButtonTooltip(MatrixStack matrixStack, int mouseX,
private void renderButtonTooltip(DrawContext context, int mouseX,
int mouseY)
{
for(Drawable d : ((IScreen)(Object)this).getButtons())
for(ClickableWidget button : Screens.getButtons(this))
{
if(!(d instanceof ClickableWidget))
continue;
ClickableWidget button = (ClickableWidget)d;
if(!button.isHovered())
if(!button.isSelected())
continue;
if(button != importButton && button != exportButton)
@ -541,7 +541,7 @@ public final class AltManagerScreen extends Screen
else
addTooltip(tooltip, "window_freeze");
renderTooltip(matrixStack, tooltip, mouseX, mouseY);
context.drawTooltip(textRenderer, tooltip, mouseX, mouseY);
break;
}
}
@ -636,11 +636,12 @@ public final class AltManagerScreen extends Screen
}
@Override
protected void renderItem(MatrixStack matrixStack, int id, int x, int y,
protected void renderItem(DrawContext context, int id, int x, int y,
int var4, int var5, int var6, float partialTicks)
{
Alt alt = list.get(id);
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -671,16 +672,20 @@ public final class AltManagerScreen extends Screen
}
// face
AltRenderer.drawAltFace(matrixStack, alt.getName(), x + 1, y + 1,
24, 24, isSelectedItem(id));
AltRenderer.drawAltFace(context, alt.getName(), x + 1, y + 1, 24,
24, isSelectedItem(id));
// name / email
client.textRenderer.draw(matrixStack,
"Name: " + alt.getDisplayName(), x + 31, y + 3, 10526880);
context.drawText(client.textRenderer,
"Name: " + alt.getDisplayName(), x + 31, y + 3, 10526880,
false);
context.drawText(client.textRenderer,
"Name: " + alt.getDisplayName(), x + 31, y + 3, 10526880,
false);
String bottomText = getBottomText(alt);
client.textRenderer.draw(matrixStack, bottomText, x + 31, y + 15,
10526880);
context.drawText(client.textRenderer, bottomText, x + 31, y + 15,
10526880, false);
}
public String getBottomText(Alt alt)

View File

@ -42,18 +42,8 @@ public final class DirectLoginScreen extends AltEditorScreen
}catch(LoginException e)
{
try
{
LoginManager.login(nameOrEmail, password);
}catch(LoginException e2)
{
message = "\u00a7c\u00a7lMicrosoft:\u00a7c "
+ e.getMessage() + "\n\u00a7c\u00a7lMojang:\u00a7c "
+ e2.getMessage();
doErrorEffect();
}
message = "\u00a7c\u00a7lMicrosoft:\u00a7c " + e.getMessage();
doErrorEffect();
return;
}

View File

@ -28,6 +28,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -179,8 +180,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);
@ -459,7 +460,7 @@ public final class ClickGui
}
}
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
updateColors();
@ -493,18 +494,19 @@ public final class ClickGui
else
window.stopDraggingScrollbar();
renderWindow(matrixStack, window, mouseX, mouseY, partialTicks);
renderWindow(context, window, mouseX, mouseY, partialTicks);
}
renderPopups(matrixStack, mouseX, mouseY);
renderTooltip(matrixStack, mouseX, mouseY);
renderPopups(context, mouseX, mouseY);
renderTooltip(context, mouseX, mouseY);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
}
public void renderPopups(MatrixStack matrixStack, int mouseX, int mouseY)
public void renderPopups(DrawContext context, int mouseX, int mouseY)
{
MatrixStack matrixStack = context.getMatrices();
for(Popup popup : popups)
{
Component owner = popup.getOwner();
@ -519,15 +521,15 @@ public final class ClickGui
int cMouseX = mouseX - x1;
int cMouseY = mouseY - y1;
popup.render(matrixStack, cMouseX, cMouseY);
popup.render(context, cMouseX, cMouseY);
matrixStack.pop();
}
}
public void renderTooltip(MatrixStack matrixStack, int mouseX, int mouseY)
public void renderTooltip(DrawContext context, int mouseX, int mouseY)
{
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
MatrixStack matrixStack = context.getMatrices();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -555,6 +557,7 @@ public final class ClickGui
matrixStack.push();
matrixStack.translate(0, 0, 300);
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
RenderSystem.setShader(GameRenderer::getPositionProgram);
@ -581,15 +584,16 @@ public final class ClickGui
tessellator.draw();
// text
RenderSystem.setShaderColor(1, 1, 1, 1);
for(int i = 0; i < lines.length; i++)
fr.draw(matrixStack, lines[i], xt1 + 2, yt1 + 2 + i * fr.fontHeight,
txtColor);
context.drawText(fr, lines[i], xt1 + 2, yt1 + 2 + i * fr.fontHeight,
txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
matrixStack.pop();
}
public void renderPinnedWindows(MatrixStack matrixStack, float partialTicks)
public void renderPinnedWindows(DrawContext context, float partialTicks)
{
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
@ -598,7 +602,7 @@ public final class ClickGui
for(Window window : windows)
if(window.isPinned() && !window.isInvisible())
renderWindow(matrixStack, window, Integer.MIN_VALUE,
renderWindow(context, window, Integer.MIN_VALUE,
Integer.MIN_VALUE, partialTicks);
GL11.glEnable(GL11.GL_CULL_FACE);
@ -622,8 +626,8 @@ public final class ClickGui
acColor = clickGui.getAccentColor();
}
private void renderWindow(MatrixStack matrixStack, Window window,
int mouseX, int mouseY, float partialTicks)
private void renderWindow(DrawContext context, Window window, int mouseX,
int mouseY, float partialTicks)
{
int x1 = window.getX();
int y1 = window.getY();
@ -631,6 +635,7 @@ public final class ClickGui
int y2 = y1 + window.getHeight();
int y3 = y1 + 13;
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -791,7 +796,7 @@ public final class ClickGui
int cMouseX = mouseX - x1;
int cMouseY = mouseY - y4;
for(int i = 0; i < window.countChildren(); i++)
window.getChild(i).render(matrixStack, cMouseX, cMouseY,
window.getChild(i).render(context, cMouseX, cMouseY,
partialTicks);
matrixStack.pop();
@ -887,7 +892,7 @@ public final class ClickGui
TextRenderer fr = MC.textRenderer;
String title = fr.trimToWidth(Text.literal(window.getTitle()), x3 - x1)
.getString();
fr.draw(matrixStack, title, x1 + 2, y1 + 3, txtColor);
context.drawText(fr, title, x1 + 2, y1 + 3, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -13,6 +13,7 @@ import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -69,8 +70,9 @@ public final class ComboBoxPopup<T extends Enum<T>> extends Popup
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY)
public void render(DrawContext context, int mouseX, int mouseY)
{
MatrixStack matrixStack = context.getMatrices();
int x1 = getX();
int x2 = x1 + getWidth();
int y1 = getY();
@ -97,7 +99,7 @@ public final class ComboBoxPopup<T extends Enum<T>> extends Popup
boolean hValue = hovering && mouseY >= yi1 && mouseY < yi2;
drawValueBackground(matrixStack, x1, x2, yi1, yi2, hValue);
drawValueName(matrixStack, x1, yi1, value);
drawValueName(context, x1, yi1, value);
}
}
@ -148,14 +150,15 @@ public final class ComboBoxPopup<T extends Enum<T>> extends Popup
tessellator.draw();
}
private void drawValueName(MatrixStack matrixStack, int x1, int yi1,
private void drawValueName(DrawContext context, int x1, int yi1,
Enum<?> value)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
int txtColor = gui.getTxtColor();
RenderSystem.setShaderColor(1, 1, 1, 1);
tr.draw(matrixStack, value.toString(), x1 + 2, yi1 + 2, txtColor);
context.drawText(tr, value.toString(), x1 + 2, yi1 + 2, txtColor,
false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -7,7 +7,7 @@
*/
package net.wurstclient.clickgui;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.DrawContext;
public abstract class Component
{
@ -23,7 +23,7 @@ public abstract class Component
}
public abstract void render(MatrixStack matrixStack, int mouseX, int mouseY,
public abstract void render(DrawContext context, int mouseX, int mouseY,
float partialTicks);
public abstract int getDefaultWidth();

View File

@ -7,7 +7,7 @@
*/
package net.wurstclient.clickgui;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.DrawContext;
public abstract class Popup
{
@ -27,8 +27,7 @@ public abstract class Popup
public abstract void handleMouseClick(int mouseX, int mouseY,
int mouseButton);
public abstract void render(MatrixStack matrixStack, int mouseX,
int mouseY);
public abstract void render(DrawContext context, int mouseX, int mouseY);
public abstract int getDefaultWidth();

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

@ -14,6 +14,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -56,7 +57,7 @@ public abstract class AbstractListEditButton extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
@ -79,6 +80,7 @@ public abstract class AbstractListEditButton extends Component
boolean hText = hovering && mouseX < x3;
boolean hBox = hovering && mouseX >= x3;
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -121,9 +123,9 @@ public abstract class AbstractListEditButton extends Component
// setting name
RenderSystem.setShaderColor(1, 1, 1, 1);
TextRenderer fr = MC.textRenderer;
fr.draw(matrixStack, getText(), x1, y1 + 2, txtColor);
fr.draw(matrixStack, buttonText, x3 + 2, y1 + 2, txtColor);
TextRenderer tr = MC.textRenderer;
context.drawText(tr, getText(), x1, y1 + 2, txtColor, false);
context.drawText(tr, buttonText, x3 + 2, y1 + 2, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -14,6 +14,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.block.Block;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
@ -25,7 +26,6 @@ import net.minecraft.item.ItemStack;
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;
@ -61,7 +61,7 @@ public final class BlockComponent extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
@ -85,6 +85,7 @@ public final class BlockComponent extends Component
ItemStack stack = new ItemStack(setting.getBlock());
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -117,18 +118,11 @@ public final class BlockComponent extends Component
// setting name
RenderSystem.setShaderColor(1, 1, 1, 1);
TextRenderer fr = WurstClient.MC.textRenderer;
TextRenderer tr = WurstClient.MC.textRenderer;
String text = setting.getName() + ":";
fr.draw(matrixStack, text, x1, y1 + 2, txtColor);
context.drawText(tr, text, x1, y1 + 2, txtColor, false);
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();
RenderUtils.drawItem(context, stack, x3, y1, true);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -13,6 +13,7 @@ import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -55,9 +56,10 @@ public final class CheckboxComponent extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
int x1 = getX();
int x2 = x1 + getWidth();
int x3 = x1 + 11;
@ -80,7 +82,7 @@ public final class CheckboxComponent extends Component
if(setting.isChecked())
drawCheck(matrixStack, x1, y1, hovering);
drawName(matrixStack, x3, y1);
drawName(context, x3, y1);
}
private boolean isHovering(int mouseX, int mouseY, int x1, int x2, int y1,
@ -209,7 +211,7 @@ public final class CheckboxComponent extends Component
tessellator.draw();
}
private void drawName(MatrixStack matrixStack, int x3, int y1)
private void drawName(DrawContext context, int x3, int y1)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
int txtColor = gui.getTxtColor();
@ -219,7 +221,7 @@ public final class CheckboxComponent extends Component
String name = setting.getName();
int tx = x3 + 2;
int ty = y1 + 2;
MC.textRenderer.draw(matrixStack, name, tx, ty, txtColor);
context.drawText(MC.textRenderer, name, tx, ty, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -14,6 +14,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -55,9 +56,10 @@ public final class ColorComponent extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
int x1 = getX();
int x2 = x1 + getWidth();
int y1 = getY();
@ -84,7 +86,7 @@ public final class ColorComponent extends Component
drawBackground(matrixStack, x1, x2, y1, y3);
drawBox(matrixStack, x1, x2, y2, y3, hovering && mouseY >= y3);
drawNameAndValue(matrixStack, x1, x2, y1 + 2);
drawNameAndValue(context, x1, x2, y1 + 2);
}
private boolean isHovering(int mouseX, int mouseY, int x1, int x2, int y1,
@ -155,8 +157,7 @@ public final class ColorComponent extends Component
tessellator.draw();
}
private void drawNameAndValue(MatrixStack matrixStack, int x1, int x2,
int y1)
private void drawNameAndValue(DrawContext context, int x1, int x2, int y1)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
int txtColor = gui.getTxtColor();
@ -164,11 +165,11 @@ public final class ColorComponent extends Component
RenderSystem.setShaderColor(1, 1, 1, 1);
TextRenderer tr = MC.textRenderer;
tr.draw(matrixStack, setting.getName(), x1, y1, txtColor);
context.drawText(tr, setting.getName(), x1, y1, txtColor, false);
String value = ColorUtils.toHex(setting.getColor());
int valueWidth = tr.getWidth(value);
tr.draw(matrixStack, value, x2 - valueWidth, y1, txtColor);
context.drawText(tr, value, x2 - valueWidth, y1, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

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.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -102,9 +103,10 @@ public final class ComboBoxComponent<T extends Enum<T>> extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
int x1 = getX();
int x2 = x1 + getWidth();
int x3 = x2 - 11;
@ -128,7 +130,7 @@ public final class ComboBoxComponent<T extends Enum<T>> extends Component
drawSeparator(matrixStack, x3, y1, y2);
drawArrow(matrixStack, x2, x3, y1, y2, hBox);
drawNameAndValue(matrixStack, x1, x4, y1);
drawNameAndValue(context, x1, x4, y1);
}
private boolean isHovering(int mouseX, int mouseY, int x1, int x2, int y1,
@ -257,8 +259,7 @@ public final class ComboBoxComponent<T extends Enum<T>> extends Component
tessellator.draw();
}
private void drawNameAndValue(MatrixStack matrixStack, int x1, int x4,
int y1)
private void drawNameAndValue(DrawContext context, int x1, int x4, int y1)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
int txtColor = gui.getTxtColor();
@ -268,8 +269,8 @@ public final class ComboBoxComponent<T extends Enum<T>> extends Component
String name = setting.getName();
String value = "" + setting.getSelected();
tr.draw(matrixStack, name, x1, y1 + 2, txtColor);
tr.draw(matrixStack, value, x4 + 2, y1 + 2, txtColor);
context.drawText(tr, name, x1, y1 + 2, txtColor, false);
context.drawText(tr, value, x4 + 2, y1 + 2, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -16,6 +16,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -95,9 +96,10 @@ public final class FeatureButton extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
int x1 = getX();
int x2 = x1 + getWidth();
int x3 = hasSettings ? x2 - 11 : x2;
@ -126,7 +128,7 @@ public final class FeatureButton extends Component
drawSettingsArrow(matrixStack, x2, x3, y1, y2, hSettings);
}
drawName(matrixStack, x1, x3, y1);
drawName(context, x1, x3, y1);
}
private boolean isHovering(int mouseX, int mouseY, int x1, int x2, int y1,
@ -288,7 +290,7 @@ public final class FeatureButton extends Component
tessellator.draw();
}
private void drawName(MatrixStack matrixStack, int x1, int x3, int y1)
private void drawName(DrawContext context, int x1, int x3, int y1)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
int txtColor = gui.getTxtColor();
@ -301,7 +303,7 @@ public final class FeatureButton extends Component
int tx = x1 + (x3 - x1 - nameWidth) / 2;
int ty = y1 + 2;
tr.draw(matrixStack, name, tx, ty, txtColor);
context.drawText(tr, name, tx, ty, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -13,6 +13,7 @@ import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
@ -54,7 +55,7 @@ public final class FileComponent extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
@ -63,8 +64,8 @@ public final class FileComponent extends Component
int txtColor = gui.getTxtColor();
float opacity = gui.getOpacity();
TextRenderer fr = WurstClient.MC.textRenderer;
int buttonWidth = fr.getWidth(setting.getSelectedFileName());
TextRenderer tr = WurstClient.MC.textRenderer;
int buttonWidth = tr.getWidth(setting.getSelectedFileName());
int x1 = getX();
int x2 = x1 + getWidth();
@ -80,6 +81,7 @@ public final class FileComponent extends Component
boolean hText = hovering && mouseX < x3;
boolean hBox = hovering && mouseX >= x3;
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -128,9 +130,9 @@ public final class FileComponent extends Component
// setting name
RenderSystem.setShaderColor(1, 1, 1, 1);
String text = setting.getName() + ": ";
fr.draw(matrixStack, text, x1, y1 + 2, txtColor);
fr.draw(matrixStack, setting.getSelectedFileName(), x3 + 2, y1 + 2,
txtColor);
context.drawText(tr, text, x1, y1 + 2, txtColor, false);
context.drawText(tr, setting.getSelectedFileName(), x3 + 2, y1 + 2,
txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -12,6 +12,7 @@ import org.joml.Quaternionf;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
@ -26,10 +27,12 @@ import net.minecraft.entity.mob.WaterCreatureEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.wurstclient.WurstClient;
import net.wurstclient.clickgui.ClickGui;
import net.wurstclient.clickgui.Component;
import net.wurstclient.hacks.RadarHack;
import net.wurstclient.util.EntityUtils;
public final class RadarComponent extends Component
{
@ -43,7 +46,7 @@ public final class RadarComponent extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
@ -62,6 +65,7 @@ public final class RadarComponent extends Component
&& mouseY < y2 && mouseY >= -scroll
&& mouseY < getParent().getHeight() - 13 - scroll;
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
@ -125,6 +129,7 @@ public final class RadarComponent extends Component
matrixStack.pop();
matrix = matrixStack.peek().getPositionMatrix();
Vec3d lerpedPlayerPos = EntityUtils.getLerpedPos(player, partialTicks);
// points
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
@ -133,14 +138,9 @@ public final class RadarComponent extends Component
VertexFormats.POSITION_COLOR);
for(Entity e : hack.getEntities())
{
double diffX =
e.lastRenderX + (e.getX() - e.lastRenderX) * partialTicks
- (player.lastRenderX
+ (player.getX() - player.lastRenderX) * partialTicks);
double diffZ =
e.lastRenderZ + (e.getZ() - e.lastRenderZ) * partialTicks
- (player.lastRenderZ
+ (player.getZ() - player.lastRenderZ) * partialTicks);
Vec3d lerpedEntityPos = EntityUtils.getLerpedPos(e, partialTicks);
double diffX = lerpedEntityPos.x - lerpedPlayerPos.x;
double diffZ = lerpedEntityPos.z - lerpedPlayerPos.z;
double distance = Math.sqrt(diffX * diffX + diffZ * diffZ)
* (getWidth() * 0.5 / hack.getRadius());
double neededRotation = Math.toDegrees(Math.atan2(diffZ, diffX));
@ -157,7 +157,9 @@ public final class RadarComponent extends Component
continue;
int color;
if(e instanceof PlayerEntity)
if(WurstClient.INSTANCE.getFriends().isFriend(e))
color = 0x0000FF;
else if(e instanceof PlayerEntity)
color = 0xFF0000;
else if(e instanceof Monster)
color = 0xFF8000;

View File

@ -14,6 +14,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
@ -75,9 +76,10 @@ public final class SliderComponent extends Component
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
int x1 = getX();
int x2 = x1 + getWidth();
int x3 = x1 + 2;
@ -112,7 +114,7 @@ public final class SliderComponent extends Component
drawBackground(matrixStack, x1, x2, x3, x4, y1, y2, y4, y5);
drawRail(matrixStack, x3, x4, y4, y5, hSlider, renderAsDisabled);
drawKnob(matrixStack, x1, x2, y2, y3, hSlider, renderAsDisabled);
drawNameAndValue(matrixStack, x1, x2, y1, renderAsDisabled);
drawNameAndValue(context, x1, x2, y1, renderAsDisabled);
}
private void handleDragging(int mouseX, int x3, int x4)
@ -300,8 +302,8 @@ public final class SliderComponent extends Component
tessellator.draw();
}
private void drawNameAndValue(MatrixStack matrixStack, int x1, int x2,
int y1, boolean renderAsDisabled)
private void drawNameAndValue(DrawContext context, int x1, int x2, int y1,
boolean renderAsDisabled)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
int txtColor = gui.getTxtColor();
@ -312,8 +314,8 @@ public final class SliderComponent extends Component
String name = setting.getName();
String value = setting.getValueString();
int valueWidth = tr.getWidth(value);
tr.draw(matrixStack, name, x1, y1 + 2, txtColor);
tr.draw(matrixStack, value, x2 - valueWidth, y1 + 2, txtColor);
context.drawText(tr, name, x1, y1 + 2, txtColor, false);
context.drawText(tr, value, x2 - valueWidth, y1 + 2, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}

View File

@ -0,0 +1,157 @@
/*
* 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.clickgui.components;
import java.util.Objects;
import org.joml.Matrix4f;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.GameRenderer;
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.text.Style;
import net.wurstclient.WurstClient;
import net.wurstclient.clickgui.ClickGui;
import net.wurstclient.clickgui.Component;
import net.wurstclient.clickgui.screens.EditTextFieldScreen;
import net.wurstclient.settings.TextFieldSetting;
import net.wurstclient.util.ChatUtils;
public final class TextFieldEditButton extends Component
{
protected static final MinecraftClient MC = WurstClient.MC;
private final TextFieldSetting setting;
public TextFieldEditButton(TextFieldSetting setting)
{
this.setting = Objects.requireNonNull(setting);
setWidth(getDefaultWidth());
setHeight(getDefaultHeight());
}
@Override
public void handleMouseClick(double mouseX, double mouseY, int mouseButton)
{
if(mouseY < getY() + 11)
return;
switch(mouseButton)
{
case 0:
MC.setScreen(new EditTextFieldScreen(MC.currentScreen, setting));
break;
case 1:
setting.resetToDefault();
break;
}
}
@Override
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
float[] bgColor = gui.getBgColor();
float[] acColor = gui.getAcColor();
int txtColor = gui.getTxtColor();
float opacity = gui.getOpacity();
int x1 = getX();
int x2 = x1 + getWidth();
int y1 = getY();
int y2 = y1 + getHeight();
int y3 = y1 + 11;
int scroll = getParent().isScrollingEnabled()
? getParent().getScrollOffset() : 0;
boolean hovering = mouseX >= x1 && mouseY >= y1 && mouseX < x2
&& mouseY < y2 && mouseY >= -scroll
&& mouseY < getParent().getHeight() - 13 - scroll;
boolean hText = hovering && mouseY < y3;
boolean hBox = hovering && mouseY >= y3;
TextRenderer tr = MC.textRenderer;
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Tessellator tessellator = RenderSystem.renderThreadTesselator();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionProgram);
// tooltip
if(hText)
gui.setTooltip(ChatUtils.wrapText(setting.getDescription(), 200));
else if(hBox)
gui.setTooltip(ChatUtils.wrapText(setting.getValue(), 200));
// background
RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2],
opacity);
bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, x1, y1, 0).next();
bufferBuilder.vertex(matrix, x1, y2, 0).next();
bufferBuilder.vertex(matrix, x2, y2, 0).next();
bufferBuilder.vertex(matrix, x2, y1, 0).next();
tessellator.draw();
// box
RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2],
hBox ? opacity * 1.5F : opacity);
bufferBuilder.begin(VertexFormat.DrawMode.QUADS,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, x1, y3, 0).next();
bufferBuilder.vertex(matrix, x1, y2, 0).next();
bufferBuilder.vertex(matrix, x2, y2, 0).next();
bufferBuilder.vertex(matrix, x2, y3, 0).next();
tessellator.draw();
RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F);
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP,
VertexFormats.POSITION);
bufferBuilder.vertex(matrix, x1, y3, 0).next();
bufferBuilder.vertex(matrix, x1, y2, 0).next();
bufferBuilder.vertex(matrix, x2, y2, 0).next();
bufferBuilder.vertex(matrix, x2, y3, 0).next();
bufferBuilder.vertex(matrix, x1, y3, 0).next();
tessellator.draw();
int maxLength = tr.getTextHandler().getLimitedStringLength(
setting.getValue(), getWidth() - 8, Style.EMPTY);
String value = setting.getValue();
if(maxLength < value.length())
value = value.substring(0, maxLength) + "...";
// setting name and value
RenderSystem.setShaderColor(1, 1, 1, 1);
context.drawText(tr, setting.getName(), x1, y1 + 2, txtColor, false);
context.drawText(tr, value, x1 + 2, y3 + 2, txtColor, false);
GL11.glEnable(GL11.GL_BLEND);
}
@Override
public int getDefaultWidth()
{
TextRenderer tr = MC.textRenderer;
return tr.getWidth(setting.getName()) + 4;
}
@Override
public int getDefaultHeight()
{
return 22;
}
}

View File

@ -14,6 +14,8 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
@ -236,10 +238,12 @@ public final class AddBookOfferScreen extends Screen
}
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
listGui.mouseScrolled(mouseX, mouseY, amount);
return super.mouseScrolled(mouseX, mouseY, amount);
listGui.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
@ -280,46 +284,44 @@ public final class AddBookOfferScreen extends Screen
pricePlusButton.active = offerToAdd != null && offerToAdd.price() < 64;
priceMinusButton.active = offerToAdd != null && offerToAdd.price() > 1;
levelField.tick();
priceField.tick();
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
listGui.render(matrixStack, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
listGui.render(context, mouseX, mouseY, partialTicks);
matrixStack.push();
matrixStack.translate(0, 0, 300);
TextRenderer tr = client.textRenderer;
String titleText = "Available Books (" + listGui.getItemCount() + ")";
drawCenteredText(matrixStack, tr, titleText, width / 2, 12, 0xffffff);
context.drawCenteredTextWithShadow(tr, titleText, width / 2, 12,
0xffffff);
levelField.render(matrixStack, mouseX, mouseY, partialTicks);
priceField.render(matrixStack, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
levelField.render(context, mouseX, mouseY, partialTicks);
priceField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.translate(width / 2 - 100, 0, 0);
drawStringWithShadow(matrixStack, tr, "Level:", 0, height - 72,
0xf0f0f0);
drawStringWithShadow(matrixStack, tr, "Max price:", 0, height - 56,
0xf0f0f0);
context.drawTextWithShadow(tr, "Level:", 0, height - 72, 0xf0f0f0);
context.drawTextWithShadow(tr, "Max price:", 0, height - 56, 0xf0f0f0);
if(alreadyAdded && offerToAdd != null)
{
String errorText = offerToAdd.getEnchantmentNameWithLevel()
+ " is already on your list!";
drawStringWithShadow(matrixStack, tr, errorText, 0, height - 40,
0xff5555);
context.drawTextWithShadow(tr, errorText, 0, height - 40, 0xff5555);
}
matrixStack.pop();
RenderUtils.drawItem(matrixStack, new ItemStack(Items.EMERALD),
RenderUtils.drawItem(context, new ItemStack(Items.EMERALD),
width / 2 - 16, height - 58, false);
}
@ -393,15 +395,16 @@ public final class AddBookOfferScreen extends Screen
}
@Override
protected void renderItem(MatrixStack matrixStack, int index, int x,
int y, int var4, int mouseX, int mouseY, float partialTicks)
protected void renderItem(DrawContext context, int index, int x, int y,
int var4, int mouseX, int mouseY, float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
if(isSelectedItem(index))
drawSelectionOutline(matrixStack, x, y);
Item item = Registries.ITEM.get(new Identifier("enchanted_book"));
ItemStack stack = new ItemStack(item);
RenderUtils.drawItem(matrixStack, stack, x + 1, y + 1, true);
RenderUtils.drawItem(context, stack, x + 1, y + 1, true);
TextRenderer tr = mc.textRenderer;
BookOffer bookOffer = list.get(index);
@ -409,13 +412,14 @@ public final class AddBookOfferScreen extends Screen
String name = bookOffer.getEnchantmentName();
int nameColor = enchantment.isCursed() ? 0xff5555 : 0xf0f0f0;
tr.draw(matrixStack, name, x + 28, y, nameColor);
context.drawText(tr, name, x + 28, y, nameColor, false);
tr.draw(matrixStack, bookOffer.id(), x + 28, y + 9, 0xa0a0a0);
context.drawText(tr, bookOffer.id(), x + 28, y + 9, 0xa0a0a0,
false);
int maxLevel = enchantment.getMaxLevel();
String levels = maxLevel + (maxLevel == 1 ? " level" : " levels");
tr.draw(matrixStack, levels, x + 28, y + 18, 0xa0a0a0);
context.drawText(tr, levels, x + 28, y + 18, 0xa0a0a0, false);
}
}
}

View File

@ -7,8 +7,9 @@
*/
package net.wurstclient.clickgui.screens;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.wurstclient.clickgui.ClickGui;
@ -43,17 +44,21 @@ public final class ClickGuiScreen extends Screen
}
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double delta)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
gui.handleMouseScroll(mouseX, mouseY, delta);
return super.mouseScrolled(mouseX, mouseY, delta);
gui.handleMouseScroll(mouseX, mouseY, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
super.render(matrixStack, mouseX, mouseY, partialTicks);
gui.render(matrixStack, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
gui.render(context, mouseX, mouseY, partialTicks);
}
}

View File

@ -14,6 +14,8 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.block.Block;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
@ -52,7 +54,7 @@ public final class EditBlockListScreen extends Screen
listGui = new ListGui(client, this, blockList.getBlockNames());
blockNameField = new TextFieldWidget(client.textRenderer,
width / 2 - 152, height - 55, 150, 18, Text.literal(""));
width / 2 - 152, height - 56, 150, 20, Text.literal(""));
addSelectableChild(blockNameField);
blockNameField.setMaxLength(256);
@ -113,11 +115,12 @@ public final class EditBlockListScreen extends Screen
}
@Override
public boolean mouseScrolled(double double_1, double double_2,
double double_3)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
listGui.mouseScrolled(double_1, double_2, double_3);
return super.mouseScrolled(double_1, double_2, double_3);
listGui.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
@ -149,8 +152,6 @@ public final class EditBlockListScreen extends Screen
@Override
public void tick()
{
blockNameField.tick();
String nameOrId = blockNameField.getText();
blockToAdd = BlockUtils.getBlockFromNameOrID(nameOrId);
addButton.active = blockToAdd != null;
@ -160,44 +161,51 @@ public final class EditBlockListScreen extends Screen
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
listGui.render(matrixStack, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
listGui.render(context, mouseX, mouseY, partialTicks);
drawCenteredText(matrixStack, client.textRenderer,
context.drawCenteredTextWithShadow(client.textRenderer,
blockList.getName() + " (" + listGui.getItemCount() + ")",
width / 2, 12, 0xffffff);
matrixStack.push();
matrixStack.translate(0, 0, 300);
blockNameField.render(matrixStack, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
blockNameField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.push();
matrixStack.translate(-64 + width / 2 - 152, 0, 0);
if(blockNameField.getText().isEmpty() && !blockNameField.isFocused())
drawStringWithShadow(matrixStack, client.textRenderer,
"block name or ID", 68, height - 50, 0x808080);
context.drawTextWithShadow(client.textRenderer, "block name or ID",
68, height - 50, 0x808080);
int border = blockNameField.isFocused() ? 0xffffffff : 0xffa0a0a0;
int black = 0xff000000;
fill(matrixStack, 48, height - 56, 64, height - 36, border);
fill(matrixStack, 49, height - 55, 64, height - 37, black);
fill(matrixStack, 214, height - 56, 244, height - 55, border);
fill(matrixStack, 214, height - 37, 244, height - 36, border);
fill(matrixStack, 244, height - 56, 246, height - 36, border);
fill(matrixStack, 214, height - 55, 243, height - 52, black);
fill(matrixStack, 214, height - 40, 243, height - 37, black);
fill(matrixStack, 214, height - 55, 216, height - 37, black);
fill(matrixStack, 242, height - 55, 245, height - 37, black);
context.fill(48, height - 56, 64, height - 36, border);
context.fill(49, height - 55, 65, height - 37, black);
context.fill(214, height - 56, 244, height - 55, border);
context.fill(214, height - 37, 244, height - 36, border);
context.fill(244, height - 56, 246, height - 36, border);
context.fill(213, height - 55, 243, height - 52, black);
context.fill(213, height - 40, 243, height - 37, black);
context.fill(213, height - 55, 216, height - 37, black);
context.fill(242, height - 55, 245, height - 37, black);
matrixStack.pop();
RenderUtils.drawItem(matrixStack, new ItemStack(blockToAdd),
RenderUtils.drawItem(context,
blockToAdd == null ? ItemStack.EMPTY : new ItemStack(blockToAdd),
width / 2 - 164, height - 52, false);
matrixStack.pop();
}
@Override
@ -255,22 +263,22 @@ public final class EditBlockListScreen extends Screen
}
@Override
protected void renderItem(MatrixStack matrixStack, int index, int x,
int y, int var4, int var5, int var6, float partialTicks)
protected void renderItem(DrawContext context, int index, int x, int y,
int var4, int var5, int var6, float partialTicks)
{
String name = list.get(index);
Block block = BlockUtils.getBlockFromName(name);
ItemStack stack = new ItemStack(block);
TextRenderer fr = mc.textRenderer;
TextRenderer tr = mc.textRenderer;
RenderUtils.drawItem(matrixStack, stack, x + 1, y + 1, true);
RenderUtils.drawItem(context, stack, x + 1, y + 1, true);
String displayName = stack.isEmpty() ? "\u00a7ounknown block\u00a7r"
: stack.getName().getString();
fr.draw(matrixStack, displayName, x + 28, y, 0xf0f0f0);
fr.draw(matrixStack, name, x + 28, y + 9, 0xa0a0a0);
fr.draw(matrixStack,
context.drawText(tr, displayName, x + 28, y, 0xf0f0f0, false);
context.drawText(tr, name, x + 28, y + 9, 0xa0a0a0, false);
context.drawText(tr,
"ID: " + Block.getRawIdFromState(block.getDefaultState()),
x + 28, y + 18, 0xa0a0a0);
x + 28, y + 18, 0xa0a0a0, false);
}
}
}

View File

@ -12,6 +12,8 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
@ -41,20 +43,20 @@ public final class EditBlockScreen extends Screen
public void init()
{
int x1 = width / 2 - 100;
int y1 = 60;
int y1 = 59;
int y2 = height / 3 * 2;
TextRenderer tr = client.textRenderer;
String valueString = setting.getBlockName();
blockField = new TextFieldWidget(tr, x1, y1, 178, 18, Text.literal(""));
blockField = new TextFieldWidget(tr, x1, y1, 178, 20, Text.literal(""));
blockField.setText(valueString);
blockField.setSelectionStart(0);
blockField.setMaxLength(256);
addSelectableChild(blockField);
setInitialFocus(blockField);
blockField.setTextFieldFocused(true);
setFocused(blockField);
blockField.setFocused(true);
doneButton = ButtonWidget.builder(Text.literal("Done"), b -> done())
.dimensions(x1, y2, 200, 20).build();
@ -90,23 +92,20 @@ public final class EditBlockScreen extends Screen
}
@Override
public void tick()
{
blockField.tick();
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
TextRenderer tr = client.textRenderer;
renderBackground(matrixStack);
drawCenteredText(matrixStack, tr, setting.getName(), width / 2, 20,
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(tr, setting.getName(), width / 2, 20,
0xFFFFFF);
blockField.render(matrixStack, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
blockField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.push();
matrixStack.translate(-64 + width / 2 - 100, 115, 0);
@ -118,20 +117,15 @@ public final class EditBlockScreen extends Screen
int lblX = lblAbove ? 50 : 68;
int lblY = lblAbove ? -66 : -50;
int lblColor = lblAbove ? 0xF0F0F0 : 0x808080;
drawStringWithShadow(matrixStack, tr, lblText, lblX, lblY, lblColor);
context.drawTextWithShadow(tr, lblText, lblX, lblY, lblColor);
int border = blockField.isFocused() ? 0xffffffff : 0xffa0a0a0;
int black = 0xff000000;
fill(matrixStack, 48, -56, 64, -36, border);
fill(matrixStack, 49, -55, 64, -37, black);
fill(matrixStack, 214, -56, 244, -55, border);
fill(matrixStack, 214, -37, 244, -36, border);
fill(matrixStack, 244, -56, 246, -36, border);
fill(matrixStack, 214, -55, 243, -52, black);
fill(matrixStack, 214, -40, 243, -37, black);
fill(matrixStack, 215, -55, 216, -37, black);
fill(matrixStack, 242, -55, 245, -37, black);
context.fill(48, -56, 64, -36, border);
context.fill(49, -55, 65, -37, black);
context.fill(242, -56, 246, -36, border);
context.fill(241, -55, 245, -37, black);
matrixStack.pop();
@ -141,7 +135,7 @@ public final class EditBlockScreen extends Screen
if(blockToAdd == null)
blockToAdd = Blocks.AIR;
RenderUtils.drawItem(matrixStack, new ItemStack(blockToAdd),
RenderUtils.drawItem(context, new ItemStack(blockToAdd),
-64 + width / 2 - 100 + 52, 115 - 52, false);
}

View File

@ -10,6 +10,8 @@ package net.wurstclient.clickgui.screens;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
@ -245,39 +247,38 @@ public final class EditBookOfferScreen extends Screen
offerToSave != null && offerToSave.price() < 64;
priceMinusButton.active =
offerToSave != null && offerToSave.price() > 1;
levelField.tick();
priceField.tick();
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackgroundTexture(0);
MatrixStack matrixStack = context.getMatrices();
renderBackgroundTexture(context);
matrixStack.push();
matrixStack.translate(0, 0, 300);
TextRenderer tr = client.textRenderer;
String titleText = "Edit Book Offer";
drawCenteredText(matrixStack, tr, titleText, width / 2, 12, 0xffffff);
context.drawCenteredTextWithShadow(tr, titleText, width / 2, 12,
0xffffff);
int x = width / 2 - 100;
int y = 64;
Item item = Registries.ITEM.get(new Identifier("enchanted_book"));
ItemStack stack = new ItemStack(item);
RenderUtils.drawItem(matrixStack, stack, x + 1, y + 1, true);
RenderUtils.drawItem(context, stack, x + 1, y + 1, true);
BookOffer bookOffer = offerToSave;
String name = bookOffer.getEnchantmentNameWithLevel();
Enchantment enchantment = bookOffer.getEnchantment();
int nameColor = enchantment.isCursed() ? 0xff5555 : 0xffffff;
tr.drawWithShadow(matrixStack, name, x + 28, y, nameColor);
context.drawTextWithShadow(tr, name, x + 28, y, nameColor);
tr.draw(matrixStack, bookOffer.id(), x + 28, y + 9, 0xa0a0a0);
context.drawText(tr, bookOffer.id(), x + 28, y + 9, 0xa0a0a0, false);
String price;
if(bookOffer.price() >= 64)
@ -285,31 +286,33 @@ public final class EditBookOfferScreen extends Screen
else
{
price = "max " + bookOffer.price();
RenderUtils.drawItem(matrixStack, new ItemStack(Items.EMERALD),
RenderUtils.drawItem(context, new ItemStack(Items.EMERALD),
x + 28 + tr.getWidth(price), y + 16, false);
}
tr.draw(matrixStack, price, x + 28, y + 18, 0xa0a0a0);
context.drawText(tr, price, x + 28, y + 18, 0xa0a0a0, false);
levelField.render(matrixStack, mouseX, mouseY, partialTicks);
priceField.render(matrixStack, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
levelField.render(context, mouseX, mouseY, partialTicks);
priceField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.translate(width / 2 - 100, 112, 0);
drawStringWithShadow(matrixStack, tr, "Level:", 0, 0, 0xf0f0f0);
drawStringWithShadow(matrixStack, tr, "Max price:", 0, 16, 0xf0f0f0);
context.drawTextWithShadow(tr, "Level:", 0, 0, 0xf0f0f0);
context.drawTextWithShadow(tr, "Max price:", 0, 16, 0xf0f0f0);
if(alreadyAdded && offerToSave != null)
{
String errorText = offerToSave.getEnchantmentNameWithLevel()
+ " is already on your list!";
drawStringWithShadow(matrixStack, tr, errorText, 0, 32, 0xff5555);
context.drawTextWithShadow(tr, errorText, 0, 32, 0xff5555);
}
matrixStack.pop();
RenderUtils.drawItem(matrixStack, new ItemStack(Items.EMERALD),
RenderUtils.drawItem(context, new ItemStack(Items.EMERALD),
width / 2 - 16, 126, false);
}

View File

@ -13,6 +13,8 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
@ -124,11 +126,12 @@ public final class EditBookOffersScreen extends Screen
}
@Override
public boolean mouseScrolled(double double_1, double double_2,
double double_3)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
listGui.mouseScrolled(double_1, double_2, double_3);
return super.mouseScrolled(double_1, double_2, double_3);
listGui.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
@ -176,19 +179,21 @@ public final class EditBookOffersScreen extends Screen
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
listGui.render(matrixStack, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
listGui.render(context, mouseX, mouseY, partialTicks);
matrixStack.push();
matrixStack.translate(0, 0, 300);
drawCenteredText(matrixStack, client.textRenderer,
context.drawCenteredTextWithShadow(client.textRenderer,
bookOffers.getName() + " (" + listGui.getItemCount() + ")",
width / 2, 12, 0xffffff);
super.render(matrixStack, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.pop();
}
@ -248,15 +253,16 @@ public final class EditBookOffersScreen extends Screen
}
@Override
protected void renderItem(MatrixStack matrixStack, int index, int x,
int y, int var4, int var5, int var6, float partialTicks)
protected void renderItem(DrawContext context, int index, int x, int y,
int var4, int var5, int var6, float partialTicks)
{
MatrixStack matrixStack = context.getMatrices();
if(isSelectedItem(index))
drawSelectionOutline(matrixStack, x, y);
Item item = Registries.ITEM.get(new Identifier("enchanted_book"));
ItemStack stack = new ItemStack(item);
RenderUtils.drawItem(matrixStack, stack, x + 1, y + 1, true);
RenderUtils.drawItem(context, stack, x + 1, y + 1, true);
TextRenderer tr = mc.textRenderer;
BookOffer bookOffer = list.get(index);
@ -264,9 +270,10 @@ public final class EditBookOffersScreen extends Screen
Enchantment enchantment = bookOffer.getEnchantment();
int nameColor = enchantment.isCursed() ? 0xff5555 : 0xf0f0f0;
tr.draw(matrixStack, name, x + 28, y, nameColor);
context.drawText(tr, name, x + 28, y, nameColor, false);
tr.draw(matrixStack, bookOffer.id(), x + 28, y + 9, 0xa0a0a0);
context.drawText(tr, bookOffer.id(), x + 28, y + 9, 0xa0a0a0,
false);
String price;
if(bookOffer.price() >= 64)
@ -274,11 +281,11 @@ public final class EditBookOffersScreen extends Screen
else
{
price = "max " + bookOffer.price();
RenderUtils.drawItem(matrixStack, new ItemStack(Items.EMERALD),
RenderUtils.drawItem(context, new ItemStack(Items.EMERALD),
x + 28 + tr.getWidth(price), y + 16, false);
}
tr.draw(matrixStack, price, x + 28, y + 18, 0xa0a0a0);
context.drawText(tr, price, x + 28, y + 18, 0xa0a0a0, false);
}
}
}

View File

@ -16,14 +16,13 @@ import javax.imageio.ImageIO;
import org.lwjgl.glfw.GLFW;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.wurstclient.settings.ColorSetting;
@ -116,8 +115,8 @@ public final class EditColorScreen extends Screen
addSelectableChild(greenValueField);
addSelectableChild(blueValueField);
setInitialFocus(hexValueField);
hexValueField.setTextFieldFocused(true);
setFocused(hexValueField);
hexValueField.setFocused(true);
hexValueField.setSelectionStart(0);
hexValueField.setSelectionEnd(6);
@ -158,26 +157,16 @@ public final class EditColorScreen extends Screen
}
@Override
public void tick()
{
hexValueField.tick();
redValueField.tick();
greenValueField.tick();
blueValueField.tick();
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
TextRenderer tr = client.textRenderer;
renderBackground(matrixStack);
drawCenteredText(matrixStack, client.textRenderer,
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
colorSetting.getName(), width / 2, 16, 0xF0F0F0);
// Draw palette
RenderSystem.setShaderTexture(0, paletteIdentifier);
int x = paletteX;
int y = paletteY;
int w = paletteWidth;
@ -186,22 +175,22 @@ public final class EditColorScreen extends Screen
int fh = paletteHeight;
float u = 0;
float v = 0;
drawTexture(matrixStack, x, y, u, v, w, h, fw, fh);
context.drawTexture(paletteIdentifier, x, y, u, v, w, h, fw, fh);
// RGB letters
tr.draw(matrixStack, "#", fieldsX - 3 - tr.getWidth("#"), fieldsY + 6,
0xF0F0F0);
tr.draw(matrixStack, "R:", fieldsX - 3 - tr.getWidth("R:"),
fieldsY + 6 + 35, 0xFF0000);
tr.draw(matrixStack, "G:", fieldsX + 75 - 3 - tr.getWidth("G:"),
fieldsY + 6 + 35, 0x00FF00);
tr.draw(matrixStack, "B:", fieldsX + 150 - 3 - tr.getWidth("B:"),
fieldsY + 6 + 35, 0x0000FF);
context.drawText(tr, "#", fieldsX - 3 - tr.getWidth("#"), fieldsY + 6,
0xF0F0F0, false);
context.drawText(tr, "R:", fieldsX - 3 - tr.getWidth("R:"),
fieldsY + 6 + 35, 0xFF0000, false);
context.drawText(tr, "G:", fieldsX + 75 - 3 - tr.getWidth("G:"),
fieldsY + 6 + 35, 0x00FF00, false);
context.drawText(tr, "B:", fieldsX + 150 - 3 - tr.getWidth("B:"),
fieldsY + 6 + 35, 0x0000FF, false);
hexValueField.render(matrixStack, mouseX, mouseY, partialTicks);
redValueField.render(matrixStack, mouseX, mouseY, partialTicks);
greenValueField.render(matrixStack, mouseX, mouseY, partialTicks);
blueValueField.render(matrixStack, mouseX, mouseY, partialTicks);
hexValueField.render(context, mouseX, mouseY, partialTicks);
redValueField.render(context, mouseX, mouseY, partialTicks);
greenValueField.render(context, mouseX, mouseY, partialTicks);
blueValueField.render(context, mouseX, mouseY, partialTicks);
// Color preview
@ -212,15 +201,16 @@ public final class EditColorScreen extends Screen
int boxY = fieldsY;
// Border
fill(matrixStack, boxX - borderSize, boxY - borderSize,
context.fill(boxX - borderSize, boxY - borderSize,
boxX + boxWidth + borderSize, boxY + boxHeight + borderSize,
0xFFAAAAAA);
// Color box
fill(matrixStack, boxX, boxY, boxX + boxWidth, boxY + boxHeight,
context.fill(boxX, boxY, boxX + boxWidth, boxY + boxHeight,
color.getRGB());
super.render(matrixStack, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -13,6 +13,8 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
@ -54,7 +56,7 @@ public final class EditItemListScreen extends Screen
listGui = new ListGui(client, this, itemList.getItemNames());
itemNameField = new TextFieldWidget(client.textRenderer,
width / 2 - 152, height - 55, 150, 18, Text.literal(""));
width / 2 - 152, height - 56, 150, 20, Text.literal(""));
addSelectableChild(itemNameField);
itemNameField.setMaxLength(256);
@ -115,11 +117,12 @@ public final class EditItemListScreen extends Screen
}
@Override
public boolean mouseScrolled(double double_1, double double_2,
double double_3)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
listGui.mouseScrolled(double_1, double_2, double_3);
return super.mouseScrolled(double_1, double_2, double_3);
listGui.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
@ -151,8 +154,6 @@ public final class EditItemListScreen extends Screen
@Override
public void tick()
{
itemNameField.tick();
itemToAdd = ItemUtils
.getItemFromNameOrID(itemNameField.getText().toLowerCase());
addButton.active = itemToAdd != null;
@ -162,49 +163,56 @@ public final class EditItemListScreen extends Screen
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
listGui.render(matrixStack, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
listGui.render(context, mouseX, mouseY, partialTicks);
drawCenteredText(matrixStack, client.textRenderer,
context.drawCenteredTextWithShadow(client.textRenderer,
itemList.getName() + " (" + listGui.getItemCount() + ")", width / 2,
12, 0xffffff);
matrixStack.push();
matrixStack.translate(0, 0, 300);
itemNameField.render(matrixStack, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
itemNameField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.push();
matrixStack.translate(-64 + width / 2 - 152, 0, 0);
if(itemNameField.getText().isEmpty() && !itemNameField.isFocused())
{
matrixStack.push();
matrixStack.translate(0, 0, 300);
drawStringWithShadow(matrixStack, client.textRenderer,
"item name or ID", 68, height - 50, 0x808080);
context.drawTextWithShadow(client.textRenderer, "item name or ID",
68, height - 50, 0x808080);
matrixStack.pop();
}
int border = itemNameField.isFocused() ? 0xffffffff : 0xffa0a0a0;
int black = 0xff000000;
fill(matrixStack, 48, height - 56, 64, height - 36, border);
fill(matrixStack, 49, height - 55, 64, height - 37, black);
fill(matrixStack, 214, height - 56, 244, height - 55, border);
fill(matrixStack, 214, height - 37, 244, height - 36, border);
fill(matrixStack, 244, height - 56, 246, height - 36, border);
fill(matrixStack, 214, height - 55, 243, height - 52, black);
fill(matrixStack, 214, height - 40, 243, height - 37, black);
fill(matrixStack, 215, height - 55, 216, height - 37, black);
fill(matrixStack, 242, height - 55, 245, height - 37, black);
context.fill(48, height - 56, 64, height - 36, border);
context.fill(49, height - 55, 65, height - 37, black);
context.fill(214, height - 56, 244, height - 55, border);
context.fill(214, height - 37, 244, height - 36, border);
context.fill(244, height - 56, 246, height - 36, border);
context.fill(213, height - 55, 243, height - 52, black);
context.fill(213, height - 40, 243, height - 37, black);
context.fill(213, height - 55, 216, height - 37, black);
context.fill(242, height - 55, 245, height - 37, black);
matrixStack.pop();
RenderUtils.drawItem(matrixStack, new ItemStack(itemToAdd),
RenderUtils.drawItem(context,
itemToAdd == null ? ItemStack.EMPTY : new ItemStack(itemToAdd),
width / 2 - 164, height - 52, false);
matrixStack.pop();
}
@Override
@ -262,21 +270,21 @@ public final class EditItemListScreen extends Screen
}
@Override
protected void renderItem(MatrixStack matrixStack, int index, int x,
int y, int var4, int var5, int var6, float partialTicks)
protected void renderItem(DrawContext context, int index, int x, int y,
int var4, int var5, int var6, float partialTicks)
{
String name = list.get(index);
Item item = Registries.ITEM.get(new Identifier(name));
ItemStack stack = new ItemStack(item);
TextRenderer fr = mc.textRenderer;
TextRenderer tr = mc.textRenderer;
RenderUtils.drawItem(matrixStack, stack, x + 1, y + 1, true);
RenderUtils.drawItem(context, stack, x + 1, y + 1, true);
String displayName = stack.isEmpty() ? "\u00a7ounknown item\u00a7r"
: stack.getName().getString();
fr.draw(matrixStack, displayName, x + 28, y, 0xf0f0f0);
fr.draw(matrixStack, name, x + 28, y + 9, 0xa0a0a0);
fr.draw(matrixStack, "ID: " + Registries.ITEM.getRawId(item),
x + 28, y + 18, 0xa0a0a0);
context.drawText(tr, displayName, x + 28, y, 0xf0f0f0, false);
context.drawText(tr, name, x + 28, y + 9, 0xa0a0a0, false);
context.drawText(tr, "ID: " + Registries.ITEM.getRawId(item),
x + 28, y + 18, 0xa0a0a0, false);
}
}
}

View File

@ -10,10 +10,11 @@ package net.wurstclient.clickgui.screens;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
@ -50,8 +51,8 @@ public final class EditSliderScreen extends Screen
valueField.setSelectionStart(0);
addSelectableChild(valueField);
setInitialFocus(valueField);
valueField.setTextFieldFocused(true);
setFocused(valueField);
valueField.setFocused(true);
doneButton = ButtonWidget.builder(Text.literal("Done"), b -> done())
.dimensions(x1, y2, 200, 20).build();
@ -86,21 +87,17 @@ public final class EditSliderScreen extends Screen
}
@Override
public void tick()
{
valueField.tick();
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(matrixStack);
drawCenteredText(matrixStack, client.textRenderer, slider.getName(),
width / 2, 20, 0xFFFFFF);
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
slider.getName(), width / 2, 20, 0xFFFFFF);
valueField.render(matrixStack, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
valueField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -0,0 +1,109 @@
/*
* 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.clickgui.screens;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.text.Text;
import net.wurstclient.settings.TextFieldSetting;
public final class EditTextFieldScreen extends Screen
{
private final Screen prevScreen;
private final TextFieldSetting setting;
private TextFieldWidget valueField;
private ButtonWidget doneButton;
public EditTextFieldScreen(Screen prevScreen, TextFieldSetting setting)
{
super(Text.literal(""));
this.prevScreen = prevScreen;
this.setting = setting;
}
@Override
public void init()
{
int x1 = width / 2 - 100;
int y1 = 60;
int y2 = height / 3 * 2;
TextRenderer tr = client.textRenderer;
valueField = new TextFieldWidget(tr, x1, y1, 200, 20, Text.literal(""));
valueField.setMaxLength(Integer.MAX_VALUE);
valueField.setText(setting.getValue());
valueField.setSelectionStart(0);
addSelectableChild(valueField);
setFocused(valueField);
valueField.setFocused(true);
doneButton = ButtonWidget.builder(Text.literal("Done"), b -> done())
.dimensions(x1, y2, 200, 20).build();
addDrawableChild(doneButton);
}
private void done()
{
String value = valueField.getText();
setting.setValue(value);
client.setScreen(prevScreen);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
switch(keyCode)
{
case GLFW.GLFW_KEY_ENTER:
done();
break;
case GLFW.GLFW_KEY_ESCAPE:
client.setScreen(prevScreen);
break;
}
return super.keyPressed(keyCode, scanCode, int_3);
}
@Override
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
setting.getName(), width / 2, 20, 0xFFFFFF);
valueField.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override
public boolean shouldPause()
{
return false;
}
@Override
public boolean shouldCloseOnEsc()
{
return false;
}
}

View File

@ -16,10 +16,11 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.wurstclient.settings.FileSetting;
@ -136,11 +137,12 @@ public final class SelectFileScreen extends Screen
}
@Override
public boolean mouseScrolled(double double_1, double double_2,
double double_3)
public boolean mouseScrolled(double mouseX, double mouseY,
double horizontalAmount, double verticalAmount)
{
listGui.mouseScrolled(double_1, double_2, double_3);
return super.mouseScrolled(double_1, double_2, double_3);
listGui.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount,
verticalAmount);
}
@Override
@ -162,19 +164,20 @@ public final class SelectFileScreen extends Screen
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(matrixStack);
listGui.render(matrixStack, mouseX, mouseY, partialTicks);
renderBackground(context, mouseX, mouseY, partialTicks);
listGui.render(context, mouseX, mouseY, partialTicks);
drawCenteredText(matrixStack, client.textRenderer, setting.getName(),
width / 2, 12, 0xffffff);
context.drawCenteredTextWithShadow(client.textRenderer,
setting.getName(), width / 2, 12, 0xffffff);
super.render(matrixStack, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
if(doneButton.isHovered() && !doneButton.active)
renderTooltip(matrixStack,
if(doneButton.isSelected() && !doneButton.active)
context.drawTooltip(textRenderer,
Arrays.asList(Text.literal("You must first select a file.")),
mouseX, mouseY);
}
@ -234,16 +237,17 @@ public final class SelectFileScreen extends Screen
}
@Override
protected void renderItem(MatrixStack matrixStack, int index, int x,
int y, int var4, int var5, int var6, float partialTicks)
protected void renderItem(DrawContext context, int index, int x, int y,
int var4, int var5, int var6, float partialTicks)
{
TextRenderer fr = mc.textRenderer;
TextRenderer tr = mc.textRenderer;
Path path = list.get(index);
fr.draw(matrixStack, "" + path.getFileName(), x + 28, y, 0xf0f0f0);
fr.draw(matrixStack,
context.drawText(tr, "" + path.getFileName(), x + 28, y, 0xf0f0f0,
false);
context.drawText(tr,
"" + client.runDirectory.toPath().relativize(path), x + 28,
y + 9, 0xa0a0a0);
y + 9, 0xa0a0a0, false);
}
}
}

View File

@ -57,7 +57,7 @@ public final class AddAltCmd extends Command
{
int alts = 0;
AltManager altManager = WURST.getAltManager();
String playerName = MC.getSession().getProfile().getName();
String playerName = MC.getSession().getUsername();
for(PlayerListEntry entry : MC.player.networkHandler.getPlayerList())
{

View File

@ -45,7 +45,7 @@ public final class DigCmd extends Command
ClientPlayerEntity player = MC.player;
Direction direction = player.getHorizontalFacing();
BlockPos pos1 = new BlockPos(
BlockPos pos1 = BlockPos.ofFloored(
player.getPos().add(0, player.getEyeHeight(player.getPose()), 0));
if(height < 0)

View File

@ -16,6 +16,7 @@ import net.wurstclient.command.CmdException;
import net.wurstclient.command.CmdSyntaxError;
import net.wurstclient.command.Command;
import net.wurstclient.util.ChatUtils;
import net.wurstclient.util.ItemUtils;
public final class EnchantCmd extends Command
{
@ -34,15 +35,16 @@ public final class EnchantCmd extends Command
if(args.length > 1)
throw new CmdSyntaxError();
ItemStack stack = getHeldItem();
enchant(stack);
enchant(getHeldItem(), 127);
ChatUtils.message("Item enchanted.");
}
private ItemStack getHeldItem() throws CmdError
{
ItemStack stack = MC.player.getInventory().getMainHandStack();
ItemStack stack = MC.player.getMainHandStack();
if(stack.isEmpty())
stack = MC.player.getOffHandStack();
if(stack.isEmpty())
throw new CmdError("There is no item in your hand.");
@ -50,23 +52,26 @@ public final class EnchantCmd extends Command
return stack;
}
private void enchant(ItemStack stack)
private void enchant(ItemStack stack, int level)
{
for(Enchantment enchantment : Registries.ENCHANTMENT)
{
if(enchantment == Enchantments.SILK_TOUCH)
continue;
// Skip curses
if(enchantment.isCursed())
continue;
// Skip Silk Touch so it doesn't remove Fortune
if(enchantment == Enchantments.SILK_TOUCH)
continue;
// Limit Quick Charge to level 5 so it doesn't break
if(enchantment == Enchantments.QUICK_CHARGE)
{
stack.addEnchantment(enchantment, 5);
stack.addEnchantment(enchantment, Math.min(level, 5));
continue;
}
stack.addEnchantment(enchantment, 127);
ItemUtils.addEnchantment(stack, enchantment, level);
}
}

View File

@ -35,7 +35,7 @@ public final class ExcavateCmd extends Command
private BlockPos argsToXyzPos(String... xyz) throws CmdSyntaxError
{
BlockPos playerPos = new BlockPos(MC.player.getPos());
BlockPos playerPos = BlockPos.ofFloored(MC.player.getPos());
int[] player = {playerPos.getX(), playerPos.getY(), playerPos.getZ()};
int[] pos = new int[3];

View File

@ -39,7 +39,7 @@ public final class FollowCmd extends Command
Entity entity = StreamSupport
.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof LivingEntity)
.filter(LivingEntity.class::isInstance)
.filter(e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0)
.filter(e -> e != MC.player)
.filter(e -> !(e instanceof FakePlayerEntity))

View File

@ -24,7 +24,7 @@ public final class GetPosCmd extends Command
@Override
public void call(String[] args) throws CmdException
{
BlockPos pos = new BlockPos(MC.player.getPos());
BlockPos pos = BlockPos.ofFloored(MC.player.getPos());
String posString = pos.getX() + " " + pos.getY() + " " + pos.getZ();
switch(String.join(" ", args).toLowerCase())

View File

@ -89,7 +89,7 @@ public final class GoToCmd extends Command
{
LivingEntity entity = StreamSupport
.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
.filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e)
.filter(e -> !e.isRemoved() && e.getHealth() > 0)
.filter(e -> e != MC.player)
.filter(e -> !(e instanceof FakePlayerEntity))
@ -101,12 +101,12 @@ public final class GoToCmd extends Command
if(entity == null)
throw new CmdError("Entity \"" + name + "\" could not be found.");
return new BlockPos(entity.getPos());
return BlockPos.ofFloored(entity.getPos());
}
private BlockPos argsToXyzPos(String... xyz) throws CmdSyntaxError
{
BlockPos playerPos = new BlockPos(MC.player.getPos());
BlockPos playerPos = BlockPos.ofFloored(MC.player.getPos());
int[] player = {playerPos.getX(), playerPos.getY(), playerPos.getZ()};
int[] pos = new int[3];

View File

@ -129,7 +129,7 @@ public final class PathCmd extends Command
{
LivingEntity entity = StreamSupport
.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
.filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e)
.filter(e -> !e.isRemoved() && e.getHealth() > 0)
.filter(e -> e != MC.player)
.filter(e -> !(e instanceof FakePlayerEntity))
@ -141,12 +141,12 @@ public final class PathCmd extends Command
if(entity == null)
throw new CmdError("Entity \"" + name + "\" could not be found.");
return new BlockPos(entity.getPos());
return BlockPos.ofFloored(entity.getPos());
}
private BlockPos argsToXyzPos(String... xyz) throws CmdSyntaxError
{
BlockPos playerPos = new BlockPos(MC.player.getPos());
BlockPos playerPos = BlockPos.ofFloored(MC.player.getPos());
int[] player = {playerPos.getX(), playerPos.getY(), playerPos.getZ()};
int[] pos = new int[3];

View File

@ -80,15 +80,15 @@ public final class PotionCmd extends Command
{
NbtCompound effect = new NbtCompound();
effect.putInt("Id", parseEffectId(args[1 + i * 3]));
effect.putInt("Amplifier", parseInt(args[2 + i * 3]) - 1);
effect.putInt("Duration", parseInt(args[3 + i * 3]) * 20);
effect.putInt("id", parseEffectId(args[1 + i * 3]));
effect.putInt("amplifier", parseInt(args[2 + i * 3]) - 1);
effect.putInt("duration", parseInt(args[3 + i * 3]) * 20);
effects.add(effect);
}
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects);
nbt.put("custom_potion_effects", effects);
stack.setNbt(nbt);
ChatUtils.message("Potion modified.");
}
@ -103,10 +103,10 @@ public final class PotionCmd extends Command
{
NbtCompound tag = new NbtCompound();
int id = StatusEffect.getRawId(effect.getEffectType());
tag.putInt("Id", id);
tag.putInt("Amplifier", effect.getAmplifier());
tag.putInt("Duration", effect.getDuration());
int id = Registries.STATUS_EFFECT.getRawId(effect.getEffectType());
tag.putInt("id", id);
tag.putInt("amplifier", effect.getAmplifier());
tag.putInt("duration", effect.getDuration());
nbt.add(tag);
}
@ -127,20 +127,21 @@ public final class PotionCmd extends Command
NbtList newEffects = new NbtList();
for(StatusEffectInstance oldEffect : oldEffects)
{
int oldId = StatusEffect.getRawId(oldEffect.getEffectType());
int oldId =
Registries.STATUS_EFFECT.getRawId(oldEffect.getEffectType());
if(oldId == id)
continue;
NbtCompound effect = new NbtCompound();
effect.putInt("Id", oldId);
effect.putInt("Amplifier", oldEffect.getAmplifier());
effect.putInt("Duration", oldEffect.getDuration());
effect.putInt("id", oldId);
effect.putInt("amplifier", oldEffect.getAmplifier());
effect.putInt("duration", oldEffect.getDuration());
newEffects.add(effect);
}
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", newEffects);
nbt.put("custom_potion_effects", newEffects);
stack.setNbt(nbt);
ChatUtils.message("Effect removed.");
}
@ -157,7 +158,7 @@ public final class PotionCmd extends Command
Identifier identifier = new Identifier(input);
StatusEffect effect = Registries.STATUS_EFFECT.get(identifier);
id = StatusEffect.getRawId(effect);
id = Registries.STATUS_EFFECT.getRawId(effect);
}catch(InvalidIdentifierException e)
{

View File

@ -40,7 +40,7 @@ public final class ProtectCmd extends Command
Entity entity = StreamSupport
.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof LivingEntity)
.filter(LivingEntity.class::isInstance)
.filter(e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0)
.filter(e -> e != MC.player)
.filter(e -> !(e instanceof FakePlayerEntity))

View File

@ -11,9 +11,8 @@ import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.Window;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.wurstclient.Category;
import net.wurstclient.command.CmdException;
@ -83,7 +82,7 @@ public final class TacoCmd extends Command
}
@Override
public void onRenderGUI(MatrixStack matrixStack, float partialTicks)
public void onRenderGUI(DrawContext context, float partialTicks)
{
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_CULL_FACE);
@ -97,13 +96,12 @@ public final class TacoCmd extends Command
}else
RenderSystem.setShaderColor(1, 1, 1, 1);
RenderSystem.setShaderTexture(0, tacos[ticks / 8]);
Window sr = MC.getWindow();
int x = sr.getScaledWidth() / 2 - 32 + 76;
int y = sr.getScaledHeight() - 32 - 19;
int w = 64;
int h = 32;
DrawableHelper.drawTexture(matrixStack, x, y, 0, 0, w, h, w, h);
context.drawTexture(tacos[ticks / 8], x, y, 0, 0, w, h, w, h);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);

View File

@ -269,7 +269,7 @@ public final class TooManyHaxCmd extends Command
if(args.length > 2)
throw new CmdSyntaxError();
ArrayList<Path> files = WURST.getKeybinds().listProfiles();
ArrayList<Path> files = WURST.getHax().tooManyHaxHack.listProfiles();
int page = parsePage(args);
int pages = (int)Math.ceil(files.size() / 8.0);
pages = Math.max(pages, 1);

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
@ -56,7 +67,7 @@ public final class TpCmd extends Command
{
LivingEntity entity = StreamSupport
.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
.filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e)
.filter(e -> !e.isRemoved() && e.getHealth() > 0)
.filter(e -> e != MC.player)
.filter(e -> !(e instanceof FakePlayerEntity))
@ -68,12 +79,12 @@ public final class TpCmd extends Command
if(entity == null)
throw new CmdError("Entity \"" + name + "\" could not be found.");
return new BlockPos(entity.getPos());
return BlockPos.ofFloored(entity.getPos());
}
private BlockPos argsToXyzPos(String... xyz) throws CmdSyntaxError
{
BlockPos playerPos = new BlockPos(MC.player.getPos());
BlockPos playerPos = BlockPos.ofFloored(MC.player.getPos());
int[] player = {playerPos.getX(), playerPos.getY(), playerPos.getZ()};
int[] pos = new int[3];

View File

@ -10,11 +10,11 @@ package net.wurstclient.commands;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.wurstclient.command.CmdError;
import net.wurstclient.command.CmdException;
import net.wurstclient.command.CmdSyntaxError;
import net.wurstclient.command.Command;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.MathUtils;
public final class VClipCmd extends Command
@ -92,15 +92,12 @@ public final class VClipCmd extends Command
private boolean hasCollisions(Box box)
{
Iterable<VoxelShape> collisions =
MC.world.getBlockCollisions(MC.player, box);
return collisions.iterator().hasNext();
return BlockUtils.getBlockCollisions(box).findAny().isPresent();
}
private double getSubBlockOffset(Box offsetBox)
{
return IMC.getWorld().getCollidingBoxes(MC.player, offsetBox)
return BlockUtils.getBlockCollisions(offsetBox)
.mapToDouble(box -> box.maxY).max().getAsDouble() - offsetBox.minY;
}

View File

@ -0,0 +1,59 @@
/*
* 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.events;
import java.util.ArrayList;
import net.wurstclient.event.Event;
import net.wurstclient.event.Listener;
public interface AirStrafingSpeedListener extends Listener
{
public void onGetAirStrafingSpeed(AirStrafingSpeedEvent event);
public static class AirStrafingSpeedEvent
extends Event<AirStrafingSpeedListener>
{
private float airStrafingSpeed;
private final float defaultSpeed;
public AirStrafingSpeedEvent(float airStrafingSpeed)
{
this.airStrafingSpeed = airStrafingSpeed;
defaultSpeed = airStrafingSpeed;
}
public float getSpeed()
{
return airStrafingSpeed;
}
public void setSpeed(float airStrafingSpeed)
{
this.airStrafingSpeed = airStrafingSpeed;
}
public float getDefaultSpeed()
{
return defaultSpeed;
}
@Override
public void fire(ArrayList<AirStrafingSpeedListener> listeners)
{
for(AirStrafingSpeedListener listener : listeners)
listener.onGetAirStrafingSpeed(this);
}
@Override
public Class<AirStrafingSpeedListener> getListenerType()
{
return AirStrafingSpeedListener.class;
}
}
}

View File

@ -9,7 +9,7 @@ package net.wurstclient.events;
import java.util.ArrayList;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.wurstclient.event.CancellableEvent;
import net.wurstclient.event.Listener;
import net.wurstclient.events.PacketOutputListener.PacketOutputEvent;

View File

@ -9,22 +9,22 @@ package net.wurstclient.events;
import java.util.ArrayList;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.DrawContext;
import net.wurstclient.event.Event;
import net.wurstclient.event.Listener;
public interface GUIRenderListener extends Listener
{
public void onRenderGUI(MatrixStack matrixStack, float partialTicks);
public void onRenderGUI(DrawContext context, float partialTicks);
public static class GUIRenderEvent extends Event<GUIRenderListener>
{
private final float partialTicks;
private final MatrixStack matrixStack;
private final DrawContext context;
public GUIRenderEvent(MatrixStack matrixStack, float partialTicks)
public GUIRenderEvent(DrawContext context, float partialTicks)
{
this.matrixStack = matrixStack;
this.context = context;
this.partialTicks = partialTicks;
}
@ -32,7 +32,7 @@ public interface GUIRenderListener extends Listener
public void fire(ArrayList<GUIRenderListener> listeners)
{
for(GUIRenderListener listener : listeners)
listener.onRenderGUI(matrixStack, partialTicks);
listener.onRenderGUI(context, partialTicks);
}
@Override

View File

@ -14,23 +14,23 @@ import net.wurstclient.event.Listener;
public interface HitResultRayTraceListener extends Listener
{
public void onHitResultRayTrace(float float_1);
public void onHitResultRayTrace(float partialTicks);
public static class HitResultRayTraceEvent
extends Event<HitResultRayTraceListener>
{
private float float_1;
private float partialTicks;
public HitResultRayTraceEvent(float float_1)
public HitResultRayTraceEvent(float partialTicks)
{
this.float_1 = float_1;
this.partialTicks = partialTicks;
}
@Override
public void fire(ArrayList<HitResultRayTraceListener> listeners)
{
for(HitResultRayTraceListener listener : listeners)
listener.onHitResultRayTrace(float_1);
listener.onHitResultRayTrace(partialTicks);
}
@Override

View File

@ -9,7 +9,7 @@ package net.wurstclient.events;
import java.util.ArrayList;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.wurstclient.event.CancellableEvent;
import net.wurstclient.event.Listener;

View File

@ -9,7 +9,7 @@ package net.wurstclient.events;
import java.util.ArrayList;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.wurstclient.event.CancellableEvent;
import net.wurstclient.event.Listener;

View File

@ -11,26 +11,20 @@ import java.util.ArrayList;
import net.wurstclient.event.Event;
import net.wurstclient.event.Listener;
import net.wurstclient.mixinterface.IClientPlayerEntity;
public interface PlayerMoveListener extends Listener
{
public void onPlayerMove(IClientPlayerEntity player);
public void onPlayerMove();
public static class PlayerMoveEvent extends Event<PlayerMoveListener>
{
private final IClientPlayerEntity player;
public PlayerMoveEvent(IClientPlayerEntity player)
{
this.player = player;
}
public static final PlayerMoveEvent INSTANCE = new PlayerMoveEvent();
@Override
public void fire(ArrayList<PlayerMoveListener> listeners)
{
for(PlayerMoveListener listener : listeners)
listener.onPlayerMove(player);
listener.onPlayerMove();
}
@Override

View File

@ -9,6 +9,8 @@ package net.wurstclient.events;
import java.util.ArrayList;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.util.math.MatrixStack;
import net.wurstclient.event.Event;
import net.wurstclient.event.Listener;
@ -31,8 +33,12 @@ public interface RenderListener extends Listener
@Override
public void fire(ArrayList<RenderListener> listeners)
{
GL11.glEnable(GL11.GL_LINE_SMOOTH);
for(RenderListener listener : listeners)
listener.onRender(matrixStack, partialTicks);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
@Override

View File

@ -9,11 +9,17 @@ package net.wurstclient.events;
import java.util.ArrayList;
import net.minecraft.client.MinecraftClient;
import net.wurstclient.event.CancellableEvent;
import net.wurstclient.event.Listener;
public interface RightClickListener extends Listener
{
/**
* Fired in {@link MinecraftClient#doItemUse()} after the
* {@code interactionManager.isBreakingBlock()} check, but before the
* item use cooldown is increased.
*/
public void onRightClick(RightClickEvent event);
public static class RightClickEvent

View File

@ -8,8 +8,10 @@
package net.wurstclient.events;
import java.util.ArrayList;
import java.util.Objects;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.wurstclient.event.Event;
import net.wurstclient.event.Listener;
@ -21,11 +23,13 @@ public interface ShouldDrawSideListener extends Listener
extends Event<ShouldDrawSideListener>
{
private final BlockState state;
private final BlockPos pos;
private Boolean rendered;
public ShouldDrawSideEvent(BlockState state)
public ShouldDrawSideEvent(BlockState state, BlockPos pos)
{
this.state = state;
this.state = Objects.requireNonNull(state);
this.pos = pos;
}
public BlockState getState()
@ -33,6 +37,11 @@ public interface ShouldDrawSideListener extends Listener
return state;
}
public BlockPos getPos()
{
return pos;
}
public Boolean isRendered()
{
return rendered;

View File

@ -1,53 +0,0 @@
/*
* 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.events;
import java.util.ArrayList;
import net.minecraft.block.BlockState;
import net.wurstclient.event.CancellableEvent;
import net.wurstclient.event.Listener;
public interface TesselateBlockListener extends Listener
{
public void onTesselateBlock(TesselateBlockEvent event);
public static class TesselateBlockEvent
extends CancellableEvent<TesselateBlockListener>
{
private final BlockState state;
public TesselateBlockEvent(BlockState state)
{
this.state = state;
}
public BlockState getState()
{
return state;
}
@Override
public void fire(ArrayList<TesselateBlockListener> listeners)
{
for(TesselateBlockListener listener : listeners)
{
listener.onTesselateBlock(this);
if(isCancelled())
break;
}
}
@Override
public Class<TesselateBlockListener> getListenerType()
{
return TesselateBlockListener.class;
}
}
}

View File

@ -0,0 +1,55 @@
/*
* 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.events;
import java.util.ArrayList;
import net.minecraft.entity.Entity;
import net.wurstclient.event.CancellableEvent;
import net.wurstclient.event.Listener;
public interface VelocityFromEntityCollisionListener extends Listener
{
public void onVelocityFromEntityCollision(
VelocityFromEntityCollisionEvent event);
public static class VelocityFromEntityCollisionEvent
extends CancellableEvent<VelocityFromEntityCollisionListener>
{
private final Entity entity;
public VelocityFromEntityCollisionEvent(Entity entity)
{
this.entity = entity;
}
public Entity getEntity()
{
return entity;
}
@Override
public void fire(
ArrayList<VelocityFromEntityCollisionListener> listeners)
{
for(VelocityFromEntityCollisionListener listener : listeners)
{
listener.onVelocityFromEntityCollision(this);
if(isCancelled())
break;
}
}
@Override
public Class<VelocityFromEntityCollisionListener> getListenerType()
{
return VelocityFromEntityCollisionListener.class;
}
}
}

View File

@ -49,6 +49,11 @@ public abstract class Hack extends Feature
return WURST.translate(description);
}
public final String getDescriptionKey()
{
return description;
}
@Override
public final Category getCategory()
{

View File

@ -34,6 +34,8 @@ public final class HackList implements UpdateListener
public final AntiAfkHack antiAfkHack = new AntiAfkHack();
public final AntiBlindHack antiBlindHack = new AntiBlindHack();
public final AntiCactusHack antiCactusHack = new AntiCactusHack();
public final AntiEntityPushHack antiEntityPushHack =
new AntiEntityPushHack();
public final AntiHungerHack antiHungerHack = new AntiHungerHack();
public final AntiKnockbackHack antiKnockbackHack = new AntiKnockbackHack();
public final AntiSpamHack antiSpamHack = new AntiSpamHack();
@ -42,6 +44,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();
@ -144,7 +147,6 @@ public final class HackList implements UpdateListener
public final PanicHack panicHack = new PanicHack();
public final ParkourHack parkourHack = new ParkourHack();
public final PlayerEspHack playerEspHack = new PlayerEspHack();
public final PlayerFinderHack playerFinderHack = new PlayerFinderHack();
public final PortalGuiHack portalGuiHack = new PortalGuiHack();
public final PotionSaverHack potionSaverHack = new PotionSaverHack();
public final ProphuntEspHack prophuntEspHack = new ProphuntEspHack();

View File

@ -15,14 +15,17 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
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.events.RenderListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.settings.filterlists.EntityFilterList;
import net.wurstclient.settings.filters.*;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RotationUtils;
import net.wurstclient.util.RotationUtils.Rotation;
@ -42,18 +45,32 @@ public final class AimAssistHack extends Hack
+ "360\u00b0 = aims at entities all around you.",
120, 30, 360, 10, ValueDisplay.DEGREES);
private final CheckboxSetting checkLOS = new CheckboxSetting(
"Check line of sight", "Won't aim at entities behind blocks.", true);
private final EntityFilterList entityFilters =
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
FilterFlyingSetting.genericCombat(0),
FilterMonstersSetting.genericCombat(false),
FilterPigmenSetting.genericCombat(false),
FilterEndermenSetting.genericCombat(false),
FilterAnimalsSetting.genericCombat(true),
FilterHostileSetting.genericCombat(false),
FilterNeutralSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterPassiveSetting.genericCombat(true),
FilterPassiveWaterSetting.genericCombat(true),
FilterBabiesSetting.genericCombat(true),
FilterBatsSetting.genericCombat(true),
FilterSlimesSetting.genericCombat(true),
FilterPetsSetting.genericCombat(true),
FilterTradersSetting.genericCombat(true),
FilterVillagersSetting.genericCombat(true),
FilterZombieVillagersSetting.genericCombat(true),
FilterGolemsSetting.genericCombat(false),
FilterPiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterZombiePiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterEndermenSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterShulkersSetting.genericCombat(false),
FilterInvisibleSetting.genericCombat(true),
FilterNamedSetting.genericCombat(false),
FilterShulkerBulletSetting.genericCombat(false),
@ -72,6 +89,7 @@ public final class AimAssistHack extends Hack
addSetting(range);
addSetting(rotationSpeed);
addSetting(fov);
addSetting(checkLOS);
entityFilters.forEach(this::addSetting);
}
@ -87,7 +105,6 @@ public final class AimAssistHack extends Hack
WURST.getHax().killauraLegitHack.setEnabled(false);
WURST.getHax().multiAuraHack.setEnabled(false);
WURST.getHax().protectHack.setEnabled(false);
WURST.getHax().triggerBotHack.setEnabled(false);
WURST.getHax().tpAuraHack.setEnabled(false);
EVENTS.add(UpdateListener.class, this);
@ -126,6 +143,13 @@ public final class AimAssistHack extends Hack
if(target == null)
return;
Vec3d hitVec = target.getBoundingBox().getCenter();
if(checkLOS.isChecked() && !BlockUtils.hasLineOfSight(hitVec))
{
target = null;
return;
}
WURST.getHax().autoSwordHack.setSlot();
faceEntityClient(target);
}

View File

@ -15,6 +15,7 @@ import net.wurstclient.events.RightClickListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.util.InteractionSimulator;
@SearchTags({"air place"})
public final class AirPlaceHack extends Hack implements RightClickListener
@ -32,8 +33,6 @@ public final class AirPlaceHack extends Hack implements RightClickListener
@Override
public void onEnable()
{
WURST.getHax().autoFishHack.setEnabled(false);
EVENTS.add(RightClickListener.class, this);
}
@ -47,11 +46,17 @@ public final class AirPlaceHack extends Hack implements RightClickListener
public void onRightClick(RightClickEvent event)
{
HitResult hitResult = MC.player.raycast(range.getValue(), 0, false);
if(hitResult.getType() != HitResult.Type.MISS)
return;
if(!(hitResult instanceof BlockHitResult blockHitResult))
return;
IMC.getInteractionManager().rightClickBlock(
blockHitResult.getBlockPos(), blockHitResult.getSide(),
blockHitResult.getPos());
MC.itemUseCooldown = 4;
if(MC.player.isRiding())
return;
InteractionSimulator.rightClickBlock(blockHitResult);
event.cancel();
}
}

View File

@ -10,8 +10,6 @@ package net.wurstclient.hacks;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
@ -20,25 +18,21 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.RespawnAnchorBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RaycastContext;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IClientPlayerInteractionManager;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.FacingSetting;
import net.wurstclient.settings.FacingSetting.Facing;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.settings.filterlists.AnchorAuraFilterList;
@ -46,8 +40,8 @@ import net.wurstclient.settings.filterlists.EntityFilterList;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.ChatUtils;
import net.wurstclient.util.FakePlayerEntity;
import net.wurstclient.util.InventoryUtils;
import net.wurstclient.util.RotationUtils;
import net.wurstclient.util.RotationUtils.Rotation;
@SearchTags({"anchor aura", "CrystalAura", "crystal aura"})
public final class AnchorAuraHack extends Hack implements UpdateListener
@ -62,11 +56,12 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
+ "When disabled, AnchorAura will only charge and detonate manually placed anchors.",
true);
private final EnumSetting<FaceBlocks> faceBlocks = new EnumSetting<>(
"Face anchors",
"Whether or not AnchorAura should face the correct direction when placing and right-clicking respawn anchors.\n\n"
+ "Slower but can help with anti-cheat plugins.",
FaceBlocks.values(), FaceBlocks.OFF);
private final FacingSetting faceBlocks =
FacingSetting.withPacketSpam("Face anchors",
"Whether or not AnchorAura should face the correct direction when"
+ " placing and right-clicking respawn anchors.\n\n"
+ "Slower but can help with anti-cheat plugins.",
Facing.OFF);
private final CheckboxSetting checkLOS = new CheckboxSetting(
"Check line of sight",
@ -131,8 +126,10 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
return;
}
int maxInvSlot = takeItemsFrom.getSelected().maxInvSlot;
if(!unchargedAnchors.isEmpty()
&& hasItem(item -> item == Items.GLOWSTONE))
&& InventoryUtils.indexOf(Items.GLOWSTONE, maxInvSlot) >= 0)
{
charge(unchargedAnchors);
// TODO: option to wait until next tick?
@ -141,13 +138,14 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
}
if(!autoPlace.isChecked()
|| !hasItem(item -> item == Items.RESPAWN_ANCHOR))
|| InventoryUtils.indexOf(Items.RESPAWN_ANCHOR, maxInvSlot) == -1)
return;
ArrayList<Entity> targets = getNearbyTargets();
ArrayList<BlockPos> newAnchors = placeAnchorsNear(targets);
if(!newAnchors.isEmpty() && hasItem(item -> item == Items.GLOWSTONE))
if(!newAnchors.isEmpty()
&& InventoryUtils.indexOf(Items.GLOWSTONE, maxInvSlot) >= 0)
{
// TODO: option to wait until next tick?
charge(newAnchors);
@ -186,7 +184,9 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
if(isSneaking())
return;
if(!selectItem(item -> item != Items.GLOWSTONE))
InventoryUtils.selectItem(stack -> !stack.isOf(Items.GLOWSTONE),
takeItemsFrom.getSelected().maxInvSlot);
if(MC.player.isHolding(Items.GLOWSTONE))
return;
boolean shouldSwing = false;
@ -204,7 +204,9 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
if(isSneaking())
return;
if(!selectItem(item -> item == Items.GLOWSTONE))
InventoryUtils.selectItem(Items.GLOWSTONE,
takeItemsFrom.getSelected().maxInvSlot);
if(!MC.player.isHolding(Items.GLOWSTONE))
return;
boolean shouldSwing = false;
@ -217,56 +219,6 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
MC.player.swingHand(Hand.MAIN_HAND);
}
private boolean selectItem(Predicate<Item> item)
{
PlayerInventory inventory = MC.player.getInventory();
IClientPlayerInteractionManager im = IMC.getInteractionManager();
int maxInvSlot = takeItemsFrom.getSelected().maxInvSlot;
for(int slot = 0; slot < maxInvSlot; slot++)
{
ItemStack stack = inventory.getStack(slot);
if(!item.test(stack.getItem()))
continue;
if(slot < 9)
inventory.selectedSlot = slot;
else if(inventory.getEmptySlot() < 9)
im.windowClick_QUICK_MOVE(slot);
else if(inventory.getEmptySlot() != -1)
{
im.windowClick_QUICK_MOVE(inventory.selectedSlot + 36);
im.windowClick_QUICK_MOVE(slot);
}else
{
im.windowClick_PICKUP(inventory.selectedSlot + 36);
im.windowClick_PICKUP(slot);
im.windowClick_PICKUP(inventory.selectedSlot + 36);
}
return true;
}
return false;
}
private boolean hasItem(Predicate<Item> item)
{
PlayerInventory inventory = MC.player.getInventory();
int maxInvSlot = takeItemsFrom.getSelected().maxInvSlot;
for(int slot = 0; slot < maxInvSlot; slot++)
{
ItemStack stack = inventory.getStack(slot);
if(!item.test(stack.getItem()))
continue;
return true;
}
return false;
}
private boolean rightClickBlock(BlockPos pos)
{
Vec3d eyesPos = RotationUtils.getEyesPos();
@ -286,11 +238,8 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
if(distanceSqHitVec >= distanceSqPosVec)
continue;
if(checkLOS.isChecked() && MC.world
.raycast(new RaycastContext(eyesPos, hitVec,
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE, MC.player))
.getType() != HitResult.Type.MISS)
if(checkLOS.isChecked()
&& !BlockUtils.hasLineOfSight(eyesPos, hitVec))
continue;
faceBlocks.getSelected().face(hitVec);
@ -307,7 +256,7 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
private boolean placeAnchor(BlockPos pos)
{
Vec3d eyesPos = RotationUtils.getEyesPos();
double rangeSq = Math.pow(range.getValue(), 2);
double rangeSq = range.getValueSq();
Vec3d posVec = Vec3d.ofCenter(pos);
double distanceSqPosVec = eyesPos.squaredDistanceTo(posVec);
@ -330,14 +279,13 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
if(distanceSqPosVec > eyesPos.squaredDistanceTo(posVec.add(dirVec)))
continue;
if(checkLOS.isChecked() && MC.world
.raycast(new RaycastContext(eyesPos, hitVec,
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE, MC.player))
.getType() != HitResult.Type.MISS)
if(checkLOS.isChecked()
&& !BlockUtils.hasLineOfSight(eyesPos, hitVec))
continue;
if(!selectItem(item -> item == Items.RESPAWN_ANCHOR))
InventoryUtils.selectItem(Items.RESPAWN_ANCHOR,
takeItemsFrom.getSelected().maxInvSlot);
if(!MC.player.isHolding(Items.RESPAWN_ANCHOR))
return false;
faceBlocks.getSelected().face(hitVec);
@ -355,19 +303,15 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
private ArrayList<BlockPos> getNearbyAnchors()
{
Vec3d eyesVec = RotationUtils.getEyesPos().subtract(0.5, 0.5, 0.5);
double rangeD = range.getValue();
int rangeI = (int)Math.ceil(rangeD);
double rangeSq = Math.pow(rangeD + 0.5, 2);
BlockPos center = new BlockPos(RotationUtils.getEyesPos());
BlockPos min = center.add(-rangeI, -rangeI, -rangeI);
BlockPos max = center.add(rangeI, rangeI, rangeI);
BlockPos center = BlockPos.ofFloored(RotationUtils.getEyesPos());
int rangeI = range.getValueCeil();
double rangeSq = MathHelper.square(range.getValue() + 0.5);
Comparator<BlockPos> furthestFromPlayer =
Comparator.<BlockPos> comparingDouble(
pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos))).reversed();
return BlockUtils.getAllInBoxStream(min, max)
return BlockUtils.getAllInBoxStream(center, rangeI)
.filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq)
.filter(pos -> BlockUtils.getBlock(pos) == Blocks.RESPAWN_ANCHOR)
.sorted(furthestFromPlayer)
@ -376,7 +320,7 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
private ArrayList<Entity> getNearbyTargets()
{
double rangeSq = Math.pow(range.getValue(), 2);
double rangeSq = range.getValueSq();
Comparator<Entity> furthestFromPlayer = Comparator
.<Entity> comparingDouble(e -> MC.player.squaredDistanceTo(e))
@ -401,15 +345,12 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
private ArrayList<BlockPos> getFreeBlocksNear(Entity target)
{
Vec3d eyesVec = RotationUtils.getEyesPos().subtract(0.5, 0.5, 0.5);
double rangeD = range.getValue();
double rangeSq = Math.pow(rangeD + 0.5, 2);
int rangeI = 2;
double rangeSq = MathHelper.square(range.getValue() + 0.5);
BlockPos center = target.getBlockPos();
BlockPos min = center.add(-rangeI, -rangeI, -rangeI);
BlockPos max = center.add(rangeI, rangeI, rangeI);
Box targetBB = target.getBoundingBox();
int rangeI = 2;
Box targetBB = target.getBoundingBox();
Vec3d targetEyesVec =
target.getPos().add(0, target.getEyeHeight(target.getPose()), 0);
@ -417,7 +358,7 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
Comparator.<BlockPos> comparingDouble(
pos -> targetEyesVec.squaredDistanceTo(Vec3d.ofCenter(pos)));
return BlockUtils.getAllInBoxStream(min, max)
return BlockUtils.getAllInBoxStream(center, rangeI)
.filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq)
.filter(this::isReplaceable).filter(this::hasClickableNeighbor)
.filter(pos -> !targetBB.intersects(new Box(pos)))
@ -427,7 +368,7 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
private boolean isReplaceable(BlockPos pos)
{
return BlockUtils.getState(pos).getMaterial().isReplaceable();
return BlockUtils.getState(pos).isReplaceable();
}
private boolean hasClickableNeighbor(BlockPos pos)
@ -442,19 +383,13 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
private boolean isClickableNeighbor(BlockPos pos)
{
return BlockUtils.canBeClicked(pos)
&& !BlockUtils.getState(pos).getMaterial().isReplaceable();
&& !BlockUtils.getState(pos).isReplaceable();
}
private boolean isChargedAnchor(BlockPos pos)
{
try
{
return BlockUtils.getState(pos).get(RespawnAnchorBlock.CHARGES) > 0;
}catch(IllegalArgumentException e)
{
return false;
}
return BlockUtils.getState(pos).getOrEmpty(RespawnAnchorBlock.CHARGES)
.orElse(0) > 0;
}
private boolean isSneaking()
@ -462,45 +397,6 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
return MC.player.isSneaking() || WURST.getHax().sneakHack.isEnabled();
}
private enum FaceBlocks
{
OFF("Off", v -> {}),
SERVER("Server-side",
v -> WURST.getRotationFaker().faceVectorPacket(v)),
CLIENT("Client-side",
v -> WURST.getRotationFaker().faceVectorClient(v)),
SPAM("Packet spam", v -> {
Rotation rotation = RotationUtils.getNeededRotations(v);
PlayerMoveC2SPacket.LookAndOnGround packet =
new PlayerMoveC2SPacket.LookAndOnGround(rotation.getYaw(),
rotation.getPitch(), MC.player.isOnGround());
MC.player.networkHandler.sendPacket(packet);
});
private String name;
private Consumer<Vec3d> face;
private FaceBlocks(String name, Consumer<Vec3d> face)
{
this.name = name;
this.face = face;
}
public void face(Vec3d v)
{
face.accept(v);
}
@Override
public String toString()
{
return name;
}
}
private enum TakeItemsFrom
{
HOTBAR("Hotbar", 9),

View File

@ -56,7 +56,7 @@ public final class AntiAfkHack extends Hack
@Override
public void onEnable()
{
start = new BlockPos(MC.player.getPos());
start = BlockPos.ofFloored(MC.player.getPos());
nextBlock = null;
pathFinder = new RandomPathFinder(start);
creativeFlying = MC.player.getAbilities().flying;

View File

@ -23,5 +23,6 @@ public final class AntiBlindHack extends Hack
setCategory(Category.RENDER);
}
// See BackgroundRendererMixin, LightTextureManagerMixin, WorldRendererMixin
// See BackgroundRendererMixin, WorldRendererMixin,
// ClientPlayerEntityMixin.hasStatusEffect()
}

View File

@ -0,0 +1,44 @@
/*
* 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 net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.VelocityFromEntityCollisionListener;
import net.wurstclient.hack.Hack;
@SearchTags({"anti entity push", "NoEntityPush", "no entity push"})
public final class AntiEntityPushHack extends Hack
implements VelocityFromEntityCollisionListener
{
public AntiEntityPushHack()
{
super("AntiEntityPush");
setCategory(Category.MOVEMENT);
}
@Override
protected void onEnable()
{
EVENTS.add(VelocityFromEntityCollisionListener.class, this);
}
@Override
protected void onDisable()
{
EVENTS.remove(VelocityFromEntityCollisionListener.class, this);
}
@Override
public void onVelocityFromEntityCollision(
VelocityFromEntityCollisionEvent event)
{
if(event.getEntity() == MC.player)
event.cancel();
}
}

View File

@ -7,7 +7,7 @@
*/
package net.wurstclient.hacks;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;

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

@ -17,10 +17,10 @@ import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorItem.Type;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket;
import net.wurstclient.Category;
@ -28,7 +28,6 @@ import net.wurstclient.SearchTags;
import net.wurstclient.events.PacketOutputListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IArmorItem;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
@ -176,9 +175,8 @@ public final class AutoArmorHack extends Hack
{
int armorPoints = item.getProtection();
int prtPoints = 0;
int armorToughness = (int)((IArmorItem)item).getToughness();
int armorType =
item.getMaterial().getProtectionAmount(EquipmentSlot.LEGS);
int armorToughness = (int)item.toughness;
int armorType = item.getMaterial().getProtection(Type.LEGGINGS);
if(useEnchantments.isChecked())
{
@ -186,7 +184,8 @@ public final class AutoArmorHack extends Hack
int prtLvl = EnchantmentHelper.getLevel(protection, stack);
ClientPlayerEntity player = MC.player;
DamageSource dmgSource = DamageSource.player(player);
DamageSource dmgSource =
player.getDamageSources().playerAttack(player);
prtPoints = protection.getProtectionAmount(prtLvl, dmgSource);
}

View File

@ -26,7 +26,6 @@ import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RaycastContext;
import net.wurstclient.Category;
import net.wurstclient.events.RenderListener;
import net.wurstclient.events.RightClickListener;
@ -41,6 +40,7 @@ import net.wurstclient.util.AutoBuildTemplate;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.ChatUtils;
import net.wurstclient.util.DefaultAutoBuildTemplates;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;
import net.wurstclient.util.RotationUtils;
import net.wurstclient.util.RotationUtils.Rotation;
@ -198,7 +198,7 @@ public final class AutoBuildHack extends Hack
return;
}
if(!fastPlace.isChecked() && IMC.getItemUseCooldown() > 0)
if(!fastPlace.isChecked() && MC.itemUseCooldown > 0)
return;
placeNextBlock();
@ -211,7 +211,7 @@ public final class AutoBuildHack extends Hack
BlockPos pos = itr.next();
BlockState state = BlockUtils.getState(pos);
if(!state.getMaterial().isReplaceable())
if(!state.isReplaceable())
itr.remove();
}
}
@ -237,7 +237,7 @@ public final class AutoBuildHack extends Hack
// check if neighbor can be right clicked
if(!BlockUtils.canBeClicked(neighbor)
|| BlockUtils.getState(neighbor).getMaterial().isReplaceable())
|| BlockUtils.getState(neighbor).isReplaceable())
continue;
Vec3d dirVec = Vec3d.of(side.getVector());
@ -252,11 +252,8 @@ public final class AutoBuildHack extends Hack
continue;
// check line of sight
if(checkLOS.isChecked() && MC.world
.raycast(new RaycastContext(eyesPos, hitVec,
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE, MC.player))
.getType() != HitResult.Type.MISS)
if(checkLOS.isChecked()
&& !BlockUtils.hasLineOfSight(eyesPos, hitVec))
continue;
// face block
@ -270,7 +267,7 @@ public final class AutoBuildHack extends Hack
IMC.getInteractionManager().rightClickBlock(neighbor,
side.getOpposite(), hitVec);
MC.player.swingHand(Hand.MAIN_HAND);
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
return true;
}
@ -313,7 +310,7 @@ public final class AutoBuildHack extends Hack
for(BlockPos pos : remainingBlocks)
{
if(!BlockUtils.getState(pos).getMaterial().isReplaceable())
if(!BlockUtils.getState(pos).isReplaceable())
continue;
Vec3d posVec = Vec3d.ofCenter(pos);
@ -357,16 +354,13 @@ public final class AutoBuildHack extends Hack
// GL settings
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glDisable(GL11.GL_CULL_FACE);
RenderSystem.setShaderColor(0F, 0F, 0F, 0.5F);
matrixStack.push();
RenderUtils.applyRegionalRenderOffset(matrixStack);
BlockPos camPos = RenderUtils.getCameraBlockPos();
int regionX = (camPos.getX() >> 9) * 512;
int regionZ = (camPos.getZ() >> 9) * 512;
RegionPos region = RenderUtils.getCameraRegion();
RenderUtils.applyRegionalRenderOffset(matrixStack, region);
int blocksDrawn = 0;
RenderSystem.setShader(GameRenderer::getPositionProgram);
@ -374,12 +368,12 @@ public final class AutoBuildHack extends Hack
&& blocksDrawn < 1024;)
{
BlockPos pos = itr.next();
if(!BlockUtils.getState(pos).getMaterial().isReplaceable())
if(!BlockUtils.getState(pos).isReplaceable())
continue;
matrixStack.push();
matrixStack.translate(pos.getX() - regionX, pos.getY(),
pos.getZ() - regionZ);
matrixStack.translate(pos.getX() - region.x(), pos.getY(),
pos.getZ() - region.z());
matrixStack.translate(offset, offset, offset);
matrixStack.scale(scale, scale, scale);
@ -398,7 +392,6 @@ public final class AutoBuildHack extends Hack
// GL resets
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
RenderSystem.setShaderColor(1, 1, 1, 1);
}

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
}

Some files were not shown because too many files have changed in this diff Show More