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

Merge branch 'master' into master

This commit is contained in:
Alexander01998 2023-11-17 08:34:38 +01:00 committed by GitHub
commit f6805af3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
274 changed files with 3206 additions and 2702 deletions

2
.github/FUNDING.yml vendored
View File

@ -1,3 +1,3 @@
# These are supported funding model platforms
ko_fi: wurst
custom: https://www.wurstclient.net/donate/?utm_source=GitHub&utm_medium=Wurst7&utm_campaign=GitHub+Sponsors&utm_content=Sponsor+this+project

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,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.

View File

@ -18,16 +18,26 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
- 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: 'temurin'
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

@ -12,7 +12,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
- name: Check JSON syntax
uses: limitusus/json-syntax-check@v2
with:

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.3-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
}

View File

@ -5,15 +5,15 @@ 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.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.24
#Fabric api
fabric_version=0.87.0+1.20.1
fabric_version=0.90.7+1.20.2
# Mod Properties
mod_version = v7.37-MC1.20.1
mod_version = v7.39-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-8.1.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

25
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

1
gradlew.bat vendored
View File

@ -26,6 +26,7 @@ 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%

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

@ -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.37";
public static final String MC_VERSION = "1.20.1";
public static final String VERSION = "7.39";
public static final String MC_VERSION = "1.20.2";
private WurstAnalytics analytics;
private EventManager eventManager;
@ -149,7 +150,7 @@ public enum WurstClient
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,
@ -177,7 +178,7 @@ 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

View File

@ -151,4 +151,10 @@ public class FlyPathProcessor extends PathProcessor
}
}
}
@Override
public boolean canBreakBlocks()
{
return 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

@ -138,4 +138,10 @@ public class WalkPathProcessor extends PathProcessor
MC.options.forwardKey.setPressed(true);
}
}
@Override
public boolean canBreakBlocks()
{
return MC.player.isOnGround();
}
}

View File

@ -25,6 +25,7 @@ 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;
@ -41,13 +42,12 @@ 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));
@ -124,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);
@ -255,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);

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

@ -29,6 +29,7 @@ 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;
@ -143,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");
@ -346,7 +344,7 @@ public abstract class AltEditorScreen extends Screen
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
@ -399,7 +397,8 @@ public abstract class AltEditorScreen extends Screen
errorTimer--;
}
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -28,6 +28,7 @@ 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;
@ -49,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;
@ -181,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
@ -412,7 +414,7 @@ public final class AltManagerScreen extends Screen
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
listGui.render(context, mouseX, mouseY, partialTicks);
MatrixStack matrixStack = context.getMatrices();
@ -468,7 +470,9 @@ public final class AltManagerScreen extends Screen
errorTimer--;
}
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
renderButtonTooltip(context, mouseX, mouseY);
renderAltTooltip(context, mouseX, mouseY);
}
@ -521,13 +525,8 @@ public final class AltManagerScreen extends Screen
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.isSelected())
continue;

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

@ -15,6 +15,7 @@ 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;
@ -237,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
@ -281,9 +284,6 @@ 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
@ -303,7 +303,9 @@ public final class AddBookOfferScreen extends Screen
levelField.render(context, mouseX, mouseY, partialTicks);
priceField.render(context, mouseX, mouseY, partialTicks);
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.translate(width / 2 - 100, 0, 0);

View File

@ -8,6 +8,7 @@
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.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(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
gui.render(context, mouseX, mouseY, partialTicks);
}
}

View File

@ -15,6 +15,7 @@ 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;
@ -53,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);
@ -114,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
@ -150,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;
@ -175,7 +175,9 @@ public final class EditBlockListScreen extends Screen
matrixStack.translate(0, 0, 300);
blockNameField.render(context, mouseX, mouseY, partialTicks);
super.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);
@ -188,13 +190,13 @@ public final class EditBlockListScreen extends Screen
int black = 0xff000000;
context.fill(48, height - 56, 64, height - 36, border);
context.fill(49, height - 55, 64, height - 37, black);
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(214, height - 55, 243, height - 52, black);
context.fill(214, height - 40, 243, height - 37, black);
context.fill(214, height - 55, 216, height - 37, black);
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();

View File

@ -13,6 +13,7 @@ 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;
@ -42,13 +43,13 @@ 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);
@ -90,12 +91,6 @@ public final class EditBlockScreen extends Screen
return super.keyPressed(keyCode, scanCode, int_3);
}
@Override
public void tick()
{
blockField.tick();
}
@Override
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
@ -103,12 +98,14 @@ public final class EditBlockScreen extends Screen
MatrixStack matrixStack = context.getMatrices();
TextRenderer tr = client.textRenderer;
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(tr, setting.getName(), width / 2, 20,
0xFFFFFF);
blockField.render(context, mouseX, mouseY, partialTicks);
super.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);

View File

@ -11,6 +11,7 @@ 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;
@ -246,9 +247,6 @@ public final class EditBookOfferScreen extends Screen
offerToSave != null && offerToSave.price() < 64;
priceMinusButton.active =
offerToSave != null && offerToSave.price() > 1;
levelField.tick();
priceField.tick();
}
@Override
@ -296,7 +294,9 @@ public final class EditBookOfferScreen extends Screen
levelField.render(context, mouseX, mouseY, partialTicks);
priceField.render(context, mouseX, mouseY, partialTicks);
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.translate(width / 2 - 100, 112, 0);

View File

@ -14,6 +14,7 @@ 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;
@ -125,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
@ -190,7 +192,8 @@ public final class EditBookOffersScreen extends Screen
bookOffers.getName() + " (" + listGui.getItemCount() + ")",
width / 2, 12, 0xffffff);
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
matrixStack.pop();
}

View File

@ -19,6 +19,7 @@ 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;
@ -155,22 +156,13 @@ public final class EditColorScreen extends Screen
client.setScreen(prevScreen);
}
@Override
public void tick()
{
hexValueField.tick();
redValueField.tick();
greenValueField.tick();
blueValueField.tick();
}
@Override
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
TextRenderer tr = client.textRenderer;
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
colorSetting.getName(), width / 2, 16, 0xF0F0F0);
@ -217,7 +209,8 @@ public final class EditColorScreen extends Screen
context.fill(boxX, boxY, boxX + boxWidth, boxY + boxHeight,
color.getRGB());
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -14,6 +14,7 @@ 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;
@ -55,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);
@ -116,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
@ -152,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;
@ -177,7 +177,9 @@ public final class EditItemListScreen extends Screen
matrixStack.translate(0, 0, 300);
itemNameField.render(context, mouseX, mouseY, partialTicks);
super.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);

View File

@ -11,6 +11,7 @@ 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;
@ -85,22 +86,18 @@ public final class EditSliderScreen extends Screen
return super.keyPressed(keyCode, scanCode, int_3);
}
@Override
public void tick()
{
valueField.tick();
}
@Override
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
slider.getName(), width / 2, 20, 0xFFFFFF);
valueField.render(context, mouseX, mouseY, partialTicks);
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -11,6 +11,7 @@ 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;
@ -80,22 +81,18 @@ public final class EditTextFieldScreen extends Screen
return super.keyPressed(keyCode, scanCode, int_3);
}
@Override
public void tick()
{
valueField.tick();
}
@Override
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
setting.getName(), width / 2, 20, 0xFFFFFF);
valueField.render(context, mouseX, mouseY, partialTicks);
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}
@Override

View File

@ -17,6 +17,7 @@ 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;
@ -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
@ -165,13 +167,14 @@ public final class SelectFileScreen extends Screen
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);
listGui.render(context, mouseX, mouseY, partialTicks);
context.drawCenteredTextWithShadow(client.textRenderer,
setting.getName(), width / 2, 12, 0xffffff);
super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
if(doneButton.isSelected() && !doneButton.active)
context.drawTooltip(textRenderer,

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

@ -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

@ -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

@ -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))

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))

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

@ -67,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))

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

@ -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

@ -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,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,6 +8,7 @@
package net.wurstclient.events;
import java.util.ArrayList;
import java.util.Objects;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
@ -27,7 +28,7 @@ public interface ShouldDrawSideListener extends Listener
public ShouldDrawSideEvent(BlockState state, BlockPos pos)
{
this.state = state;
this.state = Objects.requireNonNull(state);
this.pos = pos;
}

View File

@ -1,61 +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.minecraft.util.math.BlockPos;
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;
private final BlockPos pos;
public TesselateBlockEvent(BlockState state, BlockPos pos)
{
this.state = state;
this.pos = pos;
}
public BlockState getState()
{
return state;
}
public BlockPos getPos()
{
return pos;
}
@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

@ -65,6 +65,7 @@ public final class HackList implements UpdateListener
public final AutoToolHack autoToolHack = new AutoToolHack();
public final AutoTotemHack autoTotemHack = new AutoTotemHack();
public final AutoWalkHack autoWalkHack = new AutoWalkHack();
public final BarrierEspHack barrierEspHack = new BarrierEspHack();
public final BaseFinderHack baseFinderHack = new BaseFinderHack();
public final BlinkHack blinkHack = new BlinkHack();
public final BoatFlyHack boatFlyHack = new BoatFlyHack();

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

@ -20,13 +20,11 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Items;
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;
@ -240,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);
@ -284,11 +279,8 @@ 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;
InventoryUtils.selectItem(Items.RESPAWN_ANCHOR,

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

@ -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,7 +175,7 @@ public final class AutoArmorHack extends Hack
{
int armorPoints = item.getProtection();
int prtPoints = 0;
int armorToughness = (int)((IArmorItem)item).getToughness();
int armorToughness = (int)item.toughness;
int armorType = item.getMaterial().getProtection(Type.LEGGINGS);
if(useEnchantments.isChecked())

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;
@ -199,7 +198,7 @@ public final class AutoBuildHack extends Hack
return;
}
if(!fastPlace.isChecked() && IMC.getItemUseCooldown() > 0)
if(!fastPlace.isChecked() && MC.itemUseCooldown > 0)
return;
placeNextBlock();
@ -253,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
@ -271,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;
}

View File

@ -95,7 +95,7 @@ public final class AutoFarmHack extends Hack
if(currentlyHarvesting != null)
{
IMC.getInteractionManager().setBreakingBlock(true);
MC.interactionManager.breakingBlock = true;
MC.interactionManager.cancelBlockBreaking();
currentlyHarvesting = null;
}
@ -266,7 +266,7 @@ public final class AutoFarmHack extends Hack
private boolean replant(List<BlockPos> blocksToReplant)
{
// check cooldown
if(IMC.getItemUseCooldown() > 0)
if(MC.itemUseCooldown > 0)
return false;
// check if already holding one of the seeds needed for blocksToReplant
@ -307,7 +307,7 @@ public final class AutoFarmHack extends Hack
.sendPacket(new HandSwingC2SPacket(hand));
// reset cooldown
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
return true;
}
}

View File

@ -41,12 +41,13 @@ public final class AutoFishHack extends Hack
private final SliderSetting catchDelay = new SliderSetting("Catch delay",
"How long AutoFish will wait after a bite before reeling in.", 0, 0, 60,
1, ValueDisplay.INTEGER.withSuffix(" ticks"));
1, ValueDisplay.INTEGER.withSuffix(" ticks").withLabel(1, "1 tick"));
private final SliderSetting retryDelay = new SliderSetting("Retry delay",
"If casting or reeling in the fishing rod fails, this is how long"
+ " AutoFish will wait before trying again.",
15, 0, 100, 1, ValueDisplay.INTEGER.withSuffix(" ticks"));
15, 0, 100, 1,
ValueDisplay.INTEGER.withSuffix(" ticks").withLabel(1, "1 tick"));
private final SliderSetting patience = new SliderSetting("Patience",
"How long AutoFish will wait if it doesn't get a bite before reeling in.",
@ -95,8 +96,6 @@ public final class AutoFishHack extends Hack
@Override
public void onEnable()
{
WURST.getHax().airPlaceHack.setEnabled(false);
castRodTimer = 0;
reelInTimer = 0;
rodSelector.reset();
@ -148,7 +147,7 @@ public final class AutoFishHack extends Hack
if(castRodTimer > 0)
return;
IMC.rightClick();
MC.doItemUse();
castRodTimer = retryDelay.getValueI();
reelInTimer = 20 * patience.getValueI();
return;
@ -157,7 +156,7 @@ public final class AutoFishHack extends Hack
// otherwise, reel in when it's time
if(reelInTimer == 0)
{
IMC.rightClick();
MC.doItemUse();
reelInTimer = retryDelay.getValueI();
castRodTimer = retryDelay.getValueI();
}

View File

@ -13,6 +13,7 @@ import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
@ -36,13 +37,18 @@ public final class AutoLeaveHack extends Hack implements UpdateListener
+ "Bypasses both CombatLog and NoCheat+.",
Mode.values(), Mode.QUIT);
private final CheckboxSetting disableAutoReconnect = new CheckboxSetting(
"Disable AutoReconnect", "Automatically turns off AutoReconnect when"
+ " AutoLeave makes you leave the server.",
true);
public AutoLeaveHack()
{
super("AutoLeave");
setCategory(Category.COMBAT);
addSetting(health);
addSetting(mode);
addSetting(disableAutoReconnect);
}
@Override
@ -76,7 +82,8 @@ public final class AutoLeaveHack extends Hack implements UpdateListener
return;
// check health
if(MC.player.getHealth() > health.getValueF() * 2F)
float currentHealth = MC.player.getHealth();
if(currentHealth <= 0F || currentHealth > health.getValueF() * 2F)
return;
// leave server
@ -104,6 +111,9 @@ public final class AutoLeaveHack extends Hack implements UpdateListener
// disable
setEnabled(false);
if(disableAutoReconnect.isChecked())
WURST.getHax().autoReconnectHack.setEnabled(false);
}
public static enum Mode

View File

@ -154,7 +154,7 @@ public final class AutoLibrarianHack extends Hack
if(breakingJobSite)
{
IMC.getInteractionManager().setBreakingBlock(true);
MC.interactionManager.breakingBlock = true;
MC.interactionManager.cancelBlockBreaking();
breakingJobSite = false;
}
@ -367,7 +367,7 @@ public final class AutoLibrarianHack extends Hack
private void openTradeScreen()
{
if(IMC.getItemUseCooldown() > 0)
if(MC.itemUseCooldown > 0)
return;
ClientPlayerInteractionManager im = MC.interactionManager;
@ -404,13 +404,13 @@ public final class AutoLibrarianHack extends Hack
swingHand.getSelected().swing(hand);
// set cooldown
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
}
private void closeTradeScreen()
{
MC.player.closeHandledScreen();
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
}
private BookOffer findEnchantedBookOffer(TradeOfferList tradeOffers)
@ -452,7 +452,7 @@ public final class AutoLibrarianHack extends Hack
Stream<VillagerEntity> stream =
StreamSupport.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> !e.isRemoved())
.filter(e -> e instanceof VillagerEntity)
.filter(VillagerEntity.class::isInstance)
.map(e -> (VillagerEntity)e).filter(e -> e.getHealth() > 0)
.filter(e -> player.squaredDistanceTo(e) <= rangeSq)
.filter(e -> e.getVillagerData()

View File

@ -83,7 +83,7 @@ public final class AutoMineHack extends Hack implements UpdateListener
if(currentBlock == null)
return;
IMC.getInteractionManager().setBreakingBlock(true);
MC.interactionManager.breakingBlock = true;
MC.interactionManager.cancelBlockBreaking();
currentBlock = null;
}

View File

@ -9,16 +9,23 @@ package net.wurstclient.hacks;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.WurstClient;
import net.wurstclient.events.DeathListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.CheckboxSetting;
@SearchTags({"auto respawn", "AutoRevive", "auto revive"})
public final class AutoRespawnHack extends Hack implements DeathListener
{
private final CheckboxSetting button =
new CheckboxSetting("Death screen button", "Shows a button on the death"
+ " screen that lets you quickly enable AutoRespawn.", true);
public AutoRespawnHack()
{
super("AutoRespawn");
setCategory(Category.COMBAT);
addSetting(button);
}
@Override
@ -39,4 +46,10 @@ public final class AutoRespawnHack extends Hack implements DeathListener
MC.player.requestRespawn();
MC.setScreen(null);
}
public boolean shouldShowButton()
{
return WurstClient.INSTANCE.isEnabled() && !isEnabled()
&& button.isChecked();
}
}

View File

@ -12,18 +12,19 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Item;
import net.minecraft.item.MiningToolItem;
import net.minecraft.item.SwordItem;
import net.minecraft.item.ToolItem;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IMiningToolItem;
import net.wurstclient.mixinterface.ISwordItem;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.ItemUtils;
@SearchTags({"auto sword"})
public final class AutoSwordHack extends Hack implements UpdateListener
@ -39,7 +40,8 @@ public final class AutoSwordHack extends Hack implements UpdateListener
private final SliderSetting releaseTime = new SliderSetting("Release time",
"Time until AutoSword will switch back from the weapon to the previously selected slot.\n\n"
+ "Only works when \u00a7lSwitch back\u00a7r is checked.",
10, 1, 200, 1, ValueDisplay.INTEGER.withSuffix(" ticks"));
10, 1, 200, 1,
ValueDisplay.INTEGER.withSuffix(" ticks").withLabel(1, "1 tick"));
private int oldSlot;
private int timer;
@ -47,7 +49,6 @@ public final class AutoSwordHack extends Hack implements UpdateListener
public AutoSwordHack()
{
super("AutoSword");
setCategory(Category.COMBAT);
addSetting(priority);
@ -78,7 +79,7 @@ public final class AutoSwordHack extends Hack implements UpdateListener
Entity entity = ((EntityHitResult)MC.crosshairTarget).getEntity();
if(entity instanceof LivingEntity
&& ((LivingEntity)entity).getHealth() > 0)
&& EntityUtils.IS_ATTACKABLE.test(entity))
setSlot();
}
@ -144,17 +145,15 @@ public final class AutoSwordHack extends Hack implements UpdateListener
switch(priority.getSelected())
{
case SPEED:
if(item instanceof SwordItem)
return ((ISwordItem)item).fuckMcAfee();
if(item instanceof MiningToolItem)
return ((IMiningToolItem)item).fuckMcAfee2();
if(item instanceof ToolItem tool)
return ItemUtils.getAttackSpeed(tool);
break;
case DAMAGE:
if(item instanceof SwordItem)
return ((SwordItem)item).getAttackDamage();
if(item instanceof MiningToolItem)
return ((IMiningToolItem)item).fuckMcAfee1();
if(item instanceof SwordItem sword)
return sword.getAttackDamage();
if(item instanceof MiningToolItem miningTool)
return miningTool.getAttackDamage();
break;
}

View File

@ -0,0 +1,24 @@
/*
* 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.hack.Hack;
@SearchTags({"barrier esp"})
public class BarrierEspHack extends Hack
{
public BarrierEspHack()
{
super("BarrierESP");
setCategory(Category.RENDER);
}
// See ClientWorldMixin
}

View File

@ -18,11 +18,9 @@ import net.minecraft.client.world.ClientWorld;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
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.SearchTags;
import net.wurstclient.events.UpdateListener;
@ -94,7 +92,7 @@ public final class BonemealAuraHack extends Hack implements UpdateListener
public void onUpdate()
{
// wait for right click timer
if(IMC.getItemUseCooldown() > 0)
if(MC.itemUseCooldown > 0)
return;
// get valid blocks
@ -210,16 +208,16 @@ public final class BonemealAuraHack extends Hack implements UpdateListener
return false;
if(block instanceof SaplingBlock
&& ((SaplingBlock)block).isFertilizable(world, pos, state, true))
&& ((SaplingBlock)block).isFertilizable(world, pos, state))
return saplings.isChecked();
if(block instanceof CropBlock
&& ((CropBlock)block).isFertilizable(world, pos, state, true))
&& ((CropBlock)block).isFertilizable(world, pos, state))
return crops.isChecked();
if(block instanceof StemBlock
&& ((StemBlock)block).isFertilizable(world, pos, state, true))
&& ((StemBlock)block).isFertilizable(world, pos, state))
return stems.isChecked();
if(block instanceof CocoaBlock
&& ((CocoaBlock)block).isFertilizable(world, pos, state, true))
&& ((CocoaBlock)block).isFertilizable(world, pos, state))
return cocoa.isChecked();
return other.isChecked();
}
@ -244,11 +242,7 @@ public final class BonemealAuraHack extends Hack implements UpdateListener
continue;
// check line of sight
if(MC.world
.raycast(new RaycastContext(eyesPos, hitVec,
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE, MC.player))
.getType() != HitResult.Type.MISS)
if(!BlockUtils.hasLineOfSight(eyesPos, hitVec))
continue;
// face block
@ -257,7 +251,7 @@ public final class BonemealAuraHack extends Hack implements UpdateListener
// place block
IMC.getInteractionManager().rightClickBlock(pos, side, hitVec);
MC.player.swingHand(Hand.MAIN_HAND);
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
return true;
}

View File

@ -16,8 +16,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.BlockItem;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
@ -32,6 +30,7 @@ import net.wurstclient.settings.SwingHandSetting;
import net.wurstclient.util.BlockPlacer;
import net.wurstclient.util.BlockPlacer.BlockPlacingParams;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.InteractionSimulator;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;
import net.wurstclient.util.RotationUtils;
@ -145,7 +144,7 @@ public final class BuildRandomHack extends Hack
if(WURST.getHax().freecamHack.isEnabled())
return;
if(!fastPlace.isChecked() && IMC.getItemUseCooldown() > 0)
if(!fastPlace.isChecked() && MC.itemUseCooldown > 0)
return;
if(checkItem.isChecked() && !MC.player.isHolding(
@ -188,38 +187,12 @@ public final class BuildRandomHack extends Hack
if(checkLOS.isChecked() && !params.lineOfSight())
return false;
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
facing.getSelected().face(params.hitVec());
lastPos = pos;
// right-click the block in the same way vanilla Minecraft would
for(Hand hand : Hand.values())
{
// place block and return true if successful
ActionResult blockResult = MC.interactionManager
.interactBlock(MC.player, hand, params.toHitResult());
if(blockResult.isAccepted())
{
if(blockResult.shouldSwingHand())
swingHand.getSelected().swing(hand);
return true;
}
// return on ActionResult.FAIL without trying the other hand
if(blockResult == ActionResult.FAIL)
return true;
// if ActionResult.PASS and hand is not empty, call interactItem()
if(!MC.player.getStackInHand(hand).isEmpty())
{
ActionResult itemResult =
MC.interactionManager.interactItem(MC.player, hand);
if(itemResult.isAccepted() && itemResult.shouldSwingHand())
swingHand.getSelected().swing(hand);
}
}
InteractionSimulator.rightClickBlock(params.toHitResult(),
swingHand.getSelected());
return true;
}

View File

@ -23,9 +23,6 @@ import net.wurstclient.util.GoogleTranslate;
"google translator", "GoogleTranslation", "google translation"})
public final class ChatTranslatorHack extends Hack implements ChatInputListener
{
private static final GoogleTranslate googleTranslate =
new GoogleTranslate();
private final EnumSetting<FromLanguage> langFrom = new EnumSetting<>(
"Translate from", FromLanguage.values(), FromLanguage.AUTO_DETECT);
@ -79,7 +76,7 @@ public final class ChatTranslatorHack extends Hack implements ChatInputListener
|| incomingMsg.startsWith(translatorPrefix))
return;
String translated = googleTranslate.translate(incomingMsg,
String translated = GoogleTranslate.translate(incomingMsg,
langFrom.getSelected().value, langTo.getSelected().value);
if(translated == null)

View File

@ -192,7 +192,7 @@ public class ChestEspHack extends Hack implements UpdateListener,
public void onCameraTransformViewBobbing(
CameraTransformViewBobbingEvent event)
{
if(style.getSelected().hasLines())
if(style.hasLines())
event.cancel();
}
@ -211,16 +211,17 @@ public class ChestEspHack extends Hack implements UpdateListener,
entityGroups.stream().filter(ChestEspGroup::isEnabled)
.forEach(g -> g.updateBoxes(partialTicks));
ChestEspRenderer espRenderer = new ChestEspRenderer(matrixStack);
ChestEspRenderer espRenderer =
new ChestEspRenderer(matrixStack, partialTicks);
if(style.getSelected().hasBoxes())
if(style.hasBoxes())
{
RenderSystem.setShader(GameRenderer::getPositionProgram);
groups.stream().filter(ChestEspGroup::isEnabled)
.forEach(espRenderer::renderBoxes);
}
if(style.getSelected().hasLines())
if(style.hasLines())
{
RenderSystem.setShader(GameRenderer::getPositionProgram);
groups.stream().filter(ChestEspGroup::isEnabled)

View File

@ -31,8 +31,8 @@ public final class CreativeFlightHack extends Hack implements UpdateListener
new SliderSetting("Anti-Kick Interval",
"How often Anti-Kick should prevent you from getting kicked.\n"
+ "Most servers will kick you after 80 ticks.",
30, 5, 80, 1,
SliderSetting.ValueDisplay.INTEGER.withSuffix(" ticks"));
30, 5, 80, 1, SliderSetting.ValueDisplay.INTEGER
.withSuffix(" ticks").withLabel(1, "1 tick"));
private final SliderSetting antiKickDistance = new SliderSetting(
"Anti-Kick Distance",

View File

@ -21,12 +21,10 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.item.Items;
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.Vec3d;
import net.minecraft.world.RaycastContext;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.UpdateListener;
@ -200,11 +198,8 @@ public final class CrystalAuraHack 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;
InventoryUtils.selectItem(Items.END_CRYSTAL,
@ -234,7 +229,7 @@ public final class CrystalAuraHack extends Hack implements UpdateListener
.reversed();
return StreamSupport.stream(MC.world.getEntities().spliterator(), true)
.filter(e -> e instanceof EndCrystalEntity)
.filter(EndCrystalEntity.class::isInstance)
.filter(e -> !e.isRemoved())
.filter(e -> player.squaredDistanceTo(e) <= rangeSq)
.sorted(furthestFromPlayer)

View File

@ -40,7 +40,7 @@ public final class DolphinHack extends Hack implements UpdateListener
public void onUpdate()
{
ClientPlayerEntity player = MC.player;
if(!player.isWet() || player.isSneaking())
if(!player.isTouchingWater() || player.isSneaking())
return;
Vec3d velocity = player.getVelocity();

View File

@ -295,8 +295,7 @@ public final class ExcavatorHack extends Hack
// get progress
float progress;
if(BlockUtils.getHardness(currentBlock) < 1)
progress =
IMC.getInteractionManager().getCurrentBreakingProgress();
progress = MC.interactionManager.currentBreakingProgress;
else
progress = 1;

View File

@ -18,7 +18,6 @@ import net.wurstclient.SearchTags;
import net.wurstclient.events.BlockBreakingProgressListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IClientPlayerInteractionManager;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
@ -82,7 +81,7 @@ public final class FastBreakHack extends Hack
@Override
public void onUpdate()
{
IMC.getInteractionManager().setBlockHitDelay(0);
MC.interactionManager.blockBreakingCooldown = 0;
}
@Override
@ -91,9 +90,7 @@ public final class FastBreakHack extends Hack
if(legitMode.isChecked())
return;
IClientPlayerInteractionManager im = IMC.getInteractionManager();
if(im.getCurrentBreakingProgress() >= 1)
if(MC.interactionManager.currentBreakingProgress >= 1)
return;
BlockPos blockPos = event.getBlockPos();
@ -108,6 +105,7 @@ public final class FastBreakHack extends Hack
Action action = PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK;
Direction direction = event.getDirection();
im.sendPlayerActionC2SPacket(action, blockPos, direction);
IMC.getInteractionManager().sendPlayerActionC2SPacket(action, blockPos,
direction);
}
}

View File

@ -36,6 +36,6 @@ public final class FastPlaceHack extends Hack implements UpdateListener
@Override
public void onUpdate()
{
IMC.setItemUseCooldown(0);
MC.itemUseCooldown = 0;
}
}

View File

@ -40,7 +40,7 @@ public final class FishHack extends Hack implements UpdateListener
public void onUpdate()
{
ClientPlayerEntity player = MC.player;
if(!player.isWet() || player.isSneaking())
if(!player.isTouchingWater() || player.isSneaking())
return;
Vec3d velocity = player.getVelocity();

View File

@ -44,7 +44,8 @@ public final class FlightHack extends Hack
new SliderSetting("Anti-Kick Interval",
"How often Anti-Kick should prevent you from getting kicked.\n"
+ "Most servers will kick you after 80 ticks.",
30, 5, 80, 1, ValueDisplay.INTEGER.withSuffix(" ticks"));
30, 5, 80, 1,
ValueDisplay.INTEGER.withSuffix(" ticks").withLabel(1, "1 tick"));
private final SliderSetting antiKickDistance = new SliderSetting(
"Anti-Kick Distance",

View File

@ -150,7 +150,7 @@ public final class FollowHack extends Hack
{
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)

View File

@ -206,7 +206,7 @@ public final class FreecamHack extends Hack implements UpdateListener,
// line
Vec3d regionVec = region.toVec3d();
Vec3d start = RotationUtils.getClientLookVec()
Vec3d start = RotationUtils.getClientLookVec(partialTicks)
.add(RenderUtils.getCameraPos()).subtract(regionVec);
Vec3d end = fakePlayer.getBoundingBox().getCenter().subtract(regionVec);

View File

@ -85,7 +85,7 @@ public final class GlideHack extends Hack
// manual collision check, since liquids don't have bounding boxes
if(stream.map(BlockUtils::getBlock)
.anyMatch(b -> b instanceof FluidBlock))
.anyMatch(FluidBlock.class::isInstance))
return;
}

View File

@ -100,7 +100,7 @@ public final class InstantBunkerHack extends Hack
// initialize building process
blockIndex = 0;
building = true;
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
}
startTimer = 2;
@ -240,7 +240,7 @@ public final class InstantBunkerHack extends Hack
.sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
// reset timer
IMC.setItemUseCooldown(4);
MC.itemUseCooldown = 4;
}
@Override

View File

@ -124,6 +124,6 @@ public final class InvWalkHack extends Hack implements UpdateListener
private boolean hasTextBox(Screen screen)
{
return screen.children().stream()
.anyMatch(e -> e instanceof TextFieldWidget);
.anyMatch(TextFieldWidget.class::isInstance);
}
}

View File

@ -32,7 +32,7 @@ import net.wurstclient.events.RenderListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.ColorSetting;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.EspBoxSizeSetting;
import net.wurstclient.settings.EspStyleSetting;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RegionPos;
@ -45,10 +45,9 @@ public final class ItemEspHack extends Hack implements UpdateListener,
{
private final EspStyleSetting style = new EspStyleSetting();
private final EnumSetting<BoxSize> boxSize = new EnumSetting<>("Box size",
private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting(
"\u00a7lAccurate\u00a7r mode shows the exact hitbox of each item.\n"
+ "\u00a7lFancy\u00a7r mode shows larger boxes that look better.",
BoxSize.values(), BoxSize.FANCY);
+ "\u00a7lFancy\u00a7r mode shows larger boxes that look better.");
private final ColorSetting color = new ColorSetting("Color",
"Items will be highlighted in this color.", Color.YELLOW);
@ -94,7 +93,7 @@ public final class ItemEspHack extends Hack implements UpdateListener,
public void onCameraTransformViewBobbing(
CameraTransformViewBobbingEvent event)
{
if(style.getSelected().hasLines())
if(style.hasLines())
event.cancel();
}
@ -111,7 +110,7 @@ public final class ItemEspHack extends Hack implements UpdateListener,
renderBoxes(matrixStack, partialTicks, region);
if(style.getSelected().hasLines())
if(style.hasLines())
renderTracers(matrixStack, partialTicks, region);
matrixStack.pop();
@ -125,7 +124,7 @@ public final class ItemEspHack extends Hack implements UpdateListener,
private void renderBoxes(MatrixStack matrixStack, float partialTicks,
RegionPos region)
{
float extraSize = boxSize.getSelected().extraSize;
float extraSize = boxSize.getExtraSize();
for(ItemEntity e : items)
{
@ -135,7 +134,7 @@ public final class ItemEspHack extends Hack implements UpdateListener,
.subtract(region.toVec3d());
matrixStack.translate(lerpedPos.x, lerpedPos.y, lerpedPos.z);
if(style.getSelected().hasBoxes())
if(style.hasBoxes())
{
matrixStack.push();
matrixStack.scale(e.getWidth() + extraSize,
@ -170,7 +169,7 @@ public final class ItemEspHack extends Hack implements UpdateListener,
RenderSystem.setShader(GameRenderer::getPositionProgram);
Vec3d regionVec = region.toVec3d();
Vec3d start = RotationUtils.getClientLookVec()
Vec3d start = RotationUtils.getClientLookVec(partialTicks)
.add(RenderUtils.getCameraPos()).subtract(regionVec);
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES,
@ -189,25 +188,4 @@ public final class ItemEspHack extends Hack implements UpdateListener,
}
tessellator.draw();
}
private enum BoxSize
{
ACCURATE("Accurate", 0),
FANCY("Fancy", 0.1F);
private final String name;
private final float extraSize;
private BoxSize(String name, float extraSize)
{
this.name = name;
this.extraSize = extraSize;
}
@Override
public String toString()
{
return name;
}
}
}

View File

@ -19,7 +19,6 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.PacketOutputListener;
@ -157,25 +156,19 @@ public final class JesusHack extends Hack
{
boolean foundLiquid = false;
boolean foundSolid = false;
Box box = MC.player.getBoundingBox().offset(0, -0.5, 0);
// check collision boxes below player
ArrayList<Box> blockCollisions = IMC.getWorld()
.getBlockCollisionsStream(MC.player,
MC.player.getBoundingBox().offset(0, -0.5, 0))
.map(VoxelShape::getBoundingBox)
ArrayList<Block> blockCollisions = BlockUtils.getBlockCollisions(box)
.map(bb -> BlockUtils.getBlock(BlockPos.ofFloored(bb.getCenter())))
.collect(Collectors.toCollection(ArrayList::new));
for(Box bb : blockCollisions)
{
BlockPos pos = BlockPos.ofFloored(bb.getCenter());
Block block = BlockUtils.getBlock(pos);
for(Block block : blockCollisions)
if(block instanceof FluidBlock)
foundLiquid = true;
else if(!(block instanceof AirBlock))
foundSolid = true;
}
return foundLiquid && !foundSolid;
}

View File

@ -107,15 +107,15 @@ public final class KillPotionHack extends Hack
ItemStack stack = new ItemStack(item);
NbtCompound effect = new NbtCompound();
effect.putInt("Amplifier", 125);
effect.putInt("Duration", 2000);
effect.putInt("Id", 6);
effect.putInt("amplifier", 125);
effect.putInt("duration", 2000);
effect.putString("id", "instant_health");
NbtList effects = new NbtList();
effects.add(effect);
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects);
nbt.put("custom_potion_effects", effects);
stack.setNbt(nbt);
String name =

View File

@ -21,11 +21,9 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
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.Vec3d;
import net.minecraft.world.RaycastContext;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.PostMotionListener;
@ -39,6 +37,7 @@ import net.wurstclient.settings.PauseAttackOnContainersSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.settings.filterlists.EntityFilterList;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;
@ -161,13 +160,8 @@ public final class KillauraHack extends Hack
WURST.getHax().autoSwordHack.setSlot();
Vec3d eyesPos = RotationUtils.getEyesPos();
Vec3d hitVec = target.getBoundingBox().getCenter();
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(hitVec))
{
target = null;
return;

View File

@ -37,6 +37,7 @@ 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.RegionPos;
import net.wurstclient.util.RenderUtils;
@ -78,14 +79,25 @@ public final class KillauraLegitHack extends Hack
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(true),
FilterFlyingSetting.genericCombat(0.5),
FilterMonstersSetting.genericCombat(false),
FilterPigmenSetting.genericCombat(false),
FilterEndermenSetting.genericCombat(false),
FilterAnimalsSetting.genericCombat(false),
FilterHostileSetting.genericCombat(false),
FilterNeutralSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterPassiveSetting.genericCombat(false),
FilterPassiveWaterSetting.genericCombat(false),
FilterBabiesSetting.genericCombat(false),
FilterBatsSetting.genericCombat(false),
FilterSlimesSetting.genericCombat(false),
FilterPetsSetting.genericCombat(false),
FilterTradersSetting.genericCombat(false),
FilterVillagersSetting.genericCombat(false),
FilterZombieVillagersSetting.genericCombat(false),
FilterGolemsSetting.genericCombat(false),
FilterPiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterZombiePiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterEndermenSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterShulkersSetting.genericCombat(false),
FilterAllaysSetting.genericCombat(false),
FilterInvisibleSetting.genericCombat(true),
FilterNamedSetting.genericCombat(false),
@ -168,6 +180,13 @@ public final class KillauraLegitHack extends Hack
WURST.getHax().autoSwordHack.setSlot();
// check line of sight
if(!BlockUtils.hasLineOfSight(target.getBoundingBox().getCenter()))
{
target = null;
return;
}
// face entity
if(!faceEntityClient(target))
return;

View File

@ -32,9 +32,10 @@ public final class LiquidsHack extends Hack implements HitResultRayTraceListener
}
@Override
public void onHitResultRayTrace(float float_1)
public void onHitResultRayTrace(float partialTicks)
{
MC.crosshairTarget = MC.getCameraEntity()
.raycast(MC.interactionManager.getReachDistance(), float_1, true);
float reach = MC.interactionManager.getReachDistance();
MC.crosshairTarget =
MC.getCameraEntity().raycast(reach, partialTicks, true);
}
}

View File

@ -12,7 +12,6 @@ import net.minecraft.util.Identifier;
import net.wurstclient.Category;
import net.wurstclient.hack.DontSaveState;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IGameRenderer;
@DontSaveState
public final class LsdHack extends Hack
@ -35,8 +34,8 @@ public final class LsdHack extends Hack
if(MC.gameRenderer.getPostProcessor() != null)
MC.gameRenderer.disablePostProcessor();
((IGameRenderer)MC.gameRenderer)
.loadWurstShader(new Identifier("shaders/post/wobble.json"));
MC.gameRenderer
.loadPostProcessor(new Identifier("shaders/post/wobble.json"));
}
@Override

View File

@ -10,6 +10,7 @@ package net.wurstclient.hacks;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import java.util.regex.Pattern;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.util.StringHelper;
@ -19,6 +20,10 @@ import net.wurstclient.events.ChatInputListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.DontSaveState;
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.TextFieldSetting;
import net.wurstclient.util.ChatUtils;
@SearchTags({"mass tpa"})
@ -26,9 +31,36 @@ import net.wurstclient.util.ChatUtils;
public final class MassTpaHack extends Hack
implements UpdateListener, ChatInputListener
{
private static final Pattern ALLOWED_COMMANDS =
Pattern.compile("^/+[a-zA-Z0-9_\\-]+$");
private final TextFieldSetting commandSetting =
new TextFieldSetting("Command",
"The command to use for teleporting.\n"
+ "Examples: /tp, /tpa, /tpahere, /tpo",
"/tpa",
s -> s.length() < 64 && ALLOWED_COMMANDS.matcher(s).matches());
private final SliderSetting delay = new SliderSetting("Delay",
"The delay between each teleportation request.", 20, 1, 200, 1,
ValueDisplay.INTEGER.withSuffix(" ticks").withLabel(1, "1 tick"));
private final CheckboxSetting ignoreErrors =
new CheckboxSetting("Ignore errors",
"Whether to ignore messages from the server telling you that the"
+ " teleportation command isn't valid or that you don't have"
+ " permission to use it.",
false);
private final CheckboxSetting stopWhenAccepted = new CheckboxSetting(
"Stop when accepted", "Whether to stop sending more teleportation"
+ " requests when someone accepts one of them.",
true);
private final Random random = new Random();
private final ArrayList<String> players = new ArrayList<>();
private String command;
private int index;
private int timer;
@ -36,17 +68,25 @@ public final class MassTpaHack extends Hack
{
super("MassTPA");
setCategory(Category.CHAT);
addSetting(commandSetting);
addSetting(delay);
addSetting(ignoreErrors);
addSetting(stopWhenAccepted);
}
@Override
public void onEnable()
{
index = 0;
timer = -1;
// reset state
players.clear();
String playerName = MC.getSession().getProfile().getName();
index = 0;
timer = 0;
// cache command in case the setting is changed mid-run
command = commandSetting.getValue().substring(1);
// collect player names
String playerName = MC.getSession().getUsername();
for(PlayerListEntry info : MC.player.networkHandler.getPlayerList())
{
String name = info.getProfile().getName();
@ -80,7 +120,7 @@ public final class MassTpaHack extends Hack
@Override
public void onUpdate()
{
if(timer > -1)
if(timer > 0)
{
timer--;
return;
@ -92,9 +132,11 @@ public final class MassTpaHack extends Hack
return;
}
MC.getNetworkHandler().sendChatCommand("tpa " + players.get(index));
MC.getNetworkHandler()
.sendChatCommand(command + " " + players.get(index));
index++;
timer = 20;
timer = delay.getValueI() - 1;
}
@Override
@ -106,15 +148,23 @@ public final class MassTpaHack extends Hack
if(message.contains("/help") || message.contains("permission"))
{
if(ignoreErrors.isChecked())
return;
event.cancel();
ChatUtils.error("This server doesn't have TPA.");
ChatUtils.error("This server doesn't have a "
+ command.toUpperCase() + " command.");
setEnabled(false);
}else if(message.contains("accepted") && message.contains("request")
|| message.contains("akzeptiert") && message.contains("anfrage"))
{
if(!stopWhenAccepted.isChecked())
return;
event.cancel();
ChatUtils.message("Someone accepted your TPA request. Stopping.");
ChatUtils.message("Someone accepted your " + command.toUpperCase()
+ " request. Stopping.");
setEnabled(false);
}
}

View File

@ -25,7 +25,8 @@ import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
@ -35,9 +36,10 @@ import net.wurstclient.events.CameraTransformViewBobbingListener;
import net.wurstclient.events.RenderListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.EspBoxSizeSetting;
import net.wurstclient.settings.EspStyleSetting;
import net.wurstclient.settings.filters.FilterInvisibleSetting;
import net.wurstclient.settings.filterlists.EntityFilterList;
import net.wurstclient.settings.filters.*;
import net.wurstclient.util.EntityUtils;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;
@ -49,15 +51,35 @@ public final class MobEspHack extends Hack implements UpdateListener,
{
private final EspStyleSetting style = new EspStyleSetting();
private final EnumSetting<BoxSize> boxSize = new EnumSetting<>("Box size",
private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting(
"\u00a7lAccurate\u00a7r mode shows the exact hitbox of each mob.\n"
+ "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.",
BoxSize.values(), BoxSize.FANCY);
+ "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.");
private final FilterInvisibleSetting filterInvisible =
new FilterInvisibleSetting("Won't show invisible mobs.", false);
private final EntityFilterList entityFilters =
new EntityFilterList(FilterHostileSetting.genericVision(false),
FilterNeutralSetting
.genericVision(AttackDetectingEntityFilter.Mode.OFF),
FilterPassiveSetting.genericVision(false),
FilterPassiveWaterSetting.genericVision(false),
FilterBatsSetting.genericVision(false),
FilterSlimesSetting.genericVision(false),
FilterPetsSetting.genericVision(false),
FilterVillagersSetting.genericVision(false),
FilterZombieVillagersSetting.genericVision(false),
FilterGolemsSetting.genericVision(false),
FilterPiglinsSetting
.genericVision(AttackDetectingEntityFilter.Mode.OFF),
FilterZombiePiglinsSetting
.genericVision(AttackDetectingEntityFilter.Mode.OFF),
FilterEndermenSetting
.genericVision(AttackDetectingEntityFilter.Mode.OFF),
FilterShulkersSetting.genericVision(false),
FilterAllaysSetting.genericVision(false),
FilterInvisibleSetting.genericVision(false),
FilterNamedSetting.genericVision(false),
FilterArmorStandsSetting.genericVision(true));
private final ArrayList<MobEntity> mobs = new ArrayList<>();
private final ArrayList<LivingEntity> mobs = new ArrayList<>();
private VertexBuffer mobBox;
public MobEspHack()
@ -66,7 +88,7 @@ public final class MobEspHack extends Hack implements UpdateListener,
setCategory(Category.RENDER);
addSetting(style);
addSetting(boxSize);
addSetting(filterInvisible);
entityFilters.forEach(this::addSetting);
}
@Override
@ -97,13 +119,13 @@ public final class MobEspHack extends Hack implements UpdateListener,
{
mobs.clear();
Stream<MobEntity> stream =
StreamSupport.stream(MC.world.getEntities().spliterator(), false)
.filter(e -> e instanceof MobEntity).map(e -> (MobEntity)e)
.filter(e -> !e.isRemoved() && e.getHealth() > 0);
Stream<LivingEntity> stream = StreamSupport
.stream(MC.world.getEntities().spliterator(), false)
.filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e)
.filter(e -> !(e instanceof PlayerEntity))
.filter(e -> !e.isRemoved() && e.getHealth() > 0);
if(filterInvisible.isChecked())
stream = stream.filter(filterInvisible);
stream = entityFilters.applyTo(stream);
mobs.addAll(stream.collect(Collectors.toList()));
}
@ -112,7 +134,7 @@ public final class MobEspHack extends Hack implements UpdateListener,
public void onCameraTransformViewBobbing(
CameraTransformViewBobbingEvent event)
{
if(style.getSelected().hasLines())
if(style.hasLines())
event.cancel();
}
@ -129,10 +151,10 @@ public final class MobEspHack extends Hack implements UpdateListener,
RegionPos region = RenderUtils.getCameraRegion();
RenderUtils.applyRegionalRenderOffset(matrixStack, region);
if(style.getSelected().hasBoxes())
if(style.hasBoxes())
renderBoxes(matrixStack, partialTicks, region);
if(style.getSelected().hasLines())
if(style.hasLines())
renderTracers(matrixStack, partialTicks, region);
matrixStack.pop();
@ -146,10 +168,10 @@ public final class MobEspHack extends Hack implements UpdateListener,
private void renderBoxes(MatrixStack matrixStack, float partialTicks,
RegionPos region)
{
float extraSize = boxSize.getSelected().extraSize;
float extraSize = boxSize.getExtraSize();
RenderSystem.setShader(GameRenderer::getPositionProgram);
for(MobEntity e : mobs)
for(LivingEntity e : mobs)
{
matrixStack.push();
@ -163,11 +185,11 @@ public final class MobEspHack extends Hack implements UpdateListener,
float f = MC.player.distanceTo(e) / 20F;
RenderSystem.setShaderColor(2 - f, f, 0, 0.5F);
Matrix4f viewMatrix = matrixStack.peek().getPositionMatrix();
Matrix4f projMatrix = RenderSystem.getProjectionMatrix();
ShaderProgram shader = RenderSystem.getShader();
Matrix4f matrix4f = RenderSystem.getProjectionMatrix();
mobBox.bind();
mobBox.draw(matrixStack.peek().getPositionMatrix(), matrix4f,
shader);
mobBox.draw(viewMatrix, projMatrix, shader);
VertexBuffer.unbind();
matrixStack.pop();
@ -188,10 +210,10 @@ public final class MobEspHack extends Hack implements UpdateListener,
VertexFormats.POSITION_COLOR);
Vec3d regionVec = region.toVec3d();
Vec3d start = RotationUtils.getClientLookVec()
Vec3d start = RotationUtils.getClientLookVec(partialTicks)
.add(RenderUtils.getCameraPos()).subtract(regionVec);
for(MobEntity e : mobs)
for(LivingEntity e : mobs)
{
Vec3d end = EntityUtils.getLerpedBox(e, partialTicks).getCenter()
.subtract(regionVec);
@ -210,27 +232,5 @@ public final class MobEspHack extends Hack implements UpdateListener,
}
tessellator.draw();
}
private enum BoxSize
{
ACCURATE("Accurate", 0),
FANCY("Fancy", 0.1F);
private final String name;
private final float extraSize;
private BoxSize(String name, float extraSize)
{
this.name = name;
this.extraSize = extraSize;
}
@Override
public String toString()
{
return name;
}
}
}

View File

@ -16,7 +16,6 @@ import net.wurstclient.events.PlayerMoveListener;
import net.wurstclient.events.SetOpaqueCubeListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IClientPlayerEntity;
@SearchTags({"no clip"})
public final class NoClipHack extends Hack
@ -77,9 +76,9 @@ public final class NoClipHack extends Hack
}
@Override
public void onPlayerMove(IClientPlayerEntity player)
public void onPlayerMove()
{
player.setNoClip(true);
MC.player.noClip = true;
}
@Override

View File

@ -35,6 +35,6 @@ public final class NoWebHack extends Hack implements UpdateListener
@Override
public void onUpdate()
{
IMC.getPlayer().setMovementMultiplier(Vec3d.ZERO);
MC.player.movementMultiplier = Vec3d.ZERO;
}
}

View File

@ -123,7 +123,7 @@ public final class NukerHack extends Hack
if(currentBlock != null)
{
IMC.getInteractionManager().setBreakingBlock(true);
MC.interactionManager.breakingBlock = true;
MC.interactionManager.cancelBlockBreaking();
currentBlock = null;
}

View File

@ -19,7 +19,6 @@ import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.RenderListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IFishingBobberEntity;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;
@ -37,13 +36,10 @@ public final class OpenWaterEspHack extends Hack implements RenderListener
public String getRenderName()
{
FishingBobberEntity bobber = MC.player.fishHook;
if(bobber == null)
return getName();
if(isInOpenWater(bobber))
return getName() + " [open]";
return getName() + " [shallow]";
return getName() + (isInOpenWater(bobber) ? " [open]" : " [shallow]");
}
@Override
@ -107,7 +103,6 @@ public final class OpenWaterEspHack extends Hack implements RenderListener
private boolean isInOpenWater(FishingBobberEntity bobber)
{
return ((IFishingBobberEntity)bobber)
.checkOpenWaterAround(bobber.getBlockPos());
return bobber.isOpenOrWaterAround(bobber.getBlockPos());
}
}

View File

@ -34,7 +34,7 @@ import net.wurstclient.events.CameraTransformViewBobbingListener;
import net.wurstclient.events.RenderListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.EnumSetting;
import net.wurstclient.settings.EspBoxSizeSetting;
import net.wurstclient.settings.EspStyleSetting;
import net.wurstclient.settings.EspStyleSetting.EspStyle;
import net.wurstclient.settings.filterlists.EntityFilterList;
@ -53,10 +53,9 @@ public final class PlayerEspHack extends Hack implements UpdateListener,
private final EspStyleSetting style =
new EspStyleSetting(EspStyle.LINES_AND_BOXES);
private final EnumSetting<BoxSize> boxSize = new EnumSetting<>("Box size",
private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting(
"\u00a7lAccurate\u00a7r mode shows the exact hitbox of each player.\n"
+ "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.",
BoxSize.values(), BoxSize.FANCY);
+ "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.");
private final EntityFilterList entityFilters = new EntityFilterList(
new FilterSleepingSetting("Won't show sleeping players.", false),
@ -112,7 +111,7 @@ public final class PlayerEspHack extends Hack implements UpdateListener,
public void onCameraTransformViewBobbing(
CameraTransformViewBobbingEvent event)
{
if(style.getSelected().hasLines())
if(style.hasLines())
event.cancel();
}
@ -130,10 +129,10 @@ public final class PlayerEspHack extends Hack implements UpdateListener,
RenderUtils.applyRegionalRenderOffset(matrixStack, region);
// draw boxes
if(style.getSelected().hasBoxes())
if(style.hasBoxes())
renderBoxes(matrixStack, partialTicks, region);
if(style.getSelected().hasLines())
if(style.hasLines())
renderTracers(matrixStack, partialTicks, region);
matrixStack.pop();
@ -147,7 +146,7 @@ public final class PlayerEspHack extends Hack implements UpdateListener,
private void renderBoxes(MatrixStack matrixStack, float partialTicks,
RegionPos region)
{
float extraSize = boxSize.getSelected().extraSize;
float extraSize = boxSize.getExtraSize();
for(PlayerEntity e : players)
{
@ -190,7 +189,7 @@ public final class PlayerEspHack extends Hack implements UpdateListener,
VertexFormats.POSITION_COLOR);
Vec3d regionVec = region.toVec3d();
Vec3d start = RotationUtils.getClientLookVec()
Vec3d start = RotationUtils.getClientLookVec(partialTicks)
.add(RenderUtils.getCameraPos()).subtract(regionVec);
for(PlayerEntity e : players)
@ -225,25 +224,4 @@ public final class PlayerEspHack extends Hack implements UpdateListener,
tessellator.draw();
}
private enum BoxSize
{
ACCURATE("Accurate", 0),
FANCY("Fancy", 0.1F);
private final String name;
private final float extraSize;
private BoxSize(String name, float extraSize)
{
this.name = name;
this.extraSize = extraSize;
}
@Override
public String toString()
{
return name;
}
}
}

View File

@ -52,14 +52,25 @@ public final class ProtectHack extends Hack
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
FilterFlyingSetting.genericCombat(0),
FilterMonstersSetting.genericCombat(false),
FilterPigmenSetting.genericCombat(false),
FilterEndermenSetting.genericCombat(false),
FilterAnimalsSetting.genericCombat(false),
FilterHostileSetting.genericCombat(false),
FilterNeutralSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterPassiveSetting.genericCombat(false),
FilterPassiveWaterSetting.genericCombat(false),
FilterBabiesSetting.genericCombat(false),
FilterBatsSetting.genericCombat(false),
FilterSlimesSetting.genericCombat(false),
FilterPetsSetting.genericCombat(false),
FilterTradersSetting.genericCombat(false),
FilterVillagersSetting.genericCombat(false),
FilterZombieVillagersSetting.genericCombat(false),
FilterGolemsSetting.genericCombat(false),
FilterPiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterZombiePiglinsSetting
.genericCombat(FilterZombiePiglinsSetting.Mode.OFF),
FilterEndermenSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterShulkersSetting.genericCombat(false),
FilterAllaysSetting.genericCombat(false),
FilterInvisibleSetting.genericCombat(false),
FilterNamedSetting.genericCombat(false),
@ -119,7 +130,7 @@ public final class ProtectHack extends Hack
{
Stream<Entity> stream = 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)

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