Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 22 #1003

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
faa4f97
AutoLeave totem check
ThisTestUser May 28, 2023
d989726
Merge branch 'master' into autoleave-totem
ThisTestUser Jan 2, 2024
8257cc7
Cleanup
ThisTestUser Jan 2, 2024
1e8f39a
Merge branch 'master' into autoleave-totem
Alexander01998 May 20, 2024
6474a89
Use getOffHandStack() method for slot 40
Alexander01998 May 20, 2024
5cc5a51
Merge #826 (AutoLeave Totems slider) into v7.43
Alexander01998 May 20, 2024
138faa4
Update AutoLeave
Alexander01998 May 20, 2024
97be44a
Update AutoTotem
Alexander01998 May 20, 2024
0a4489e
Further refactor AutoTotemHack
Alexander01998 May 20, 2024
05004d6
Make InventoryUtils.toNetworkSlot() public
Alexander01998 May 20, 2024
d619c2a
Allow AutoTotem to take totems from armor slots
Alexander01998 May 20, 2024
d11b0d6
Add count method to InventoryUtils
Alexander01998 May 20, 2024
4823747
Simplify totem counting with InventoryUtils
Alexander01998 May 20, 2024
8406313
Remove trailing ".0" in decimal slider values
Alexander01998 May 20, 2024
9337710
Fix AutoMineHack
Alexander01998 May 21, 2024
7b0f775
Wrap long description text in AutoToolHack
Alexander01998 May 22, 2024
bddce67
Fix AutoTool Switch back sometimes making it mine with the wrong tool
Alexander01998 May 22, 2024
deeb81e
Make repair mode more reliable
Alexander01998 May 22, 2024
91dc8b4
Clarify unit of repair mode slider
Alexander01998 May 22, 2024
633c9d0
Disable AutoTool's "Switch back" checkbox by default
Alexander01998 May 22, 2024
e178cab
Refactor private AutoTool methods to take BlockState instead of BlockPos
Alexander01998 May 23, 2024
b0111c7
Fix isTooDamaged() check in putAwayDamagedTool()
Alexander01998 May 23, 2024
1edb921
Change version to 7.43pre1
Alexander01998 May 23, 2024
1beb99a
Remove unnecessary MC.player.getInventory()
Alexander01998 May 24, 2024
4c121f0
Add isUnbreakable() helper method
Alexander01998 May 24, 2024
db4ffba
Fix Excavator trying to break bedrock in survival mode
Alexander01998 May 24, 2024
b1d2480
Fix Excavator conflicting with AutoEat
Alexander01998 May 24, 2024
daebd4b
Refactor ExcavatorHack
Alexander01998 May 24, 2024
ec68d44
Fix Excavator still sometimes getting stuck on unbreakable blocks
Alexander01998 May 24, 2024
02f2fb0
Fix Excavator mining slowly with AutoTool
Alexander01998 May 24, 2024
36de1e7
Update zh_cn.json
EastCation May 25, 2024
96a5682
Merge #999 (zh_cn translation update) into v7.43
Alexander01998 May 26, 2024
ff9d918
Fix NPE in MicrosoftLoginManager
Alexander01998 May 26, 2024
4e3e1b4
Add @Unique annotations to PlayerSkinProviderMixin
Alexander01998 May 26, 2024
b634d04
Fix endless retry-loop if downloading Wurst capes list fails
Alexander01998 May 26, 2024
a7b0d71
Mark GameRendererMixin.cancelNextBobView as @Unique
Alexander01998 May 27, 2024
c331277
Fix TriggerBot detection
Alexander01998 May 28, 2024
3a21cbb
Change version to 7.43pre2
Alexander01998 May 28, 2024
92fcaff
Move player abilities for PathFinder to a record
Alexander01998 May 28, 2024
bdb607c
Fix AntiAFK never resetting if it goes off the path
Alexander01998 May 28, 2024
6359b40
Use Gaussian randomness in AntiAFK timer
Alexander01998 May 29, 2024
4181d5a
Add AntiAFK show wait time setting
Alexander01998 May 29, 2024
9849f86
Fix AntiAFK waiting longer than it should
Alexander01998 May 29, 2024
63ab819
Fix AntiAFK drowning protection
Alexander01998 May 29, 2024
a69014b
Add MC constant in PathFinder
Alexander01998 May 29, 2024
4d520a5
Use MC constant in PathProcessor.lockControls()
Alexander01998 May 29, 2024
4bbf17f
Merge branch 'master' into v7.43
Alexander01998 May 29, 2024
324e269
Remove redundant reset of forward and jump keys
Alexander01998 May 29, 2024
7aec736
Use HandleInputListener in KillauraHack
Alexander01998 May 29, 2024
96985c0
Add speed randomization to KillauraHack
Alexander01998 May 29, 2024
a748f3f
Update Fabric stuff
Alexander01998 May 30, 2024
871597f
Fix AimAssist detection
Alexander01998 May 30, 2024
e670662
Update recommendations for input simulation
Alexander01998 May 30, 2024
677c4c4
Add new input simulation and speed randomization to KillauraLegit
Alexander01998 May 30, 2024
8b84386
Update Fabric stuff
Alexander01998 May 30, 2024
a8fcc2a
Update Fabric stuff for the third time today
Alexander01998 May 30, 2024
ed331c3
Sensitivity slider
mdenials Jun 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
buildscript {
dependencies {
classpath 'org.kohsuke:github-api:1.321'
classpath "org.kohsuke:github-api:1.321"
}
}

plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.25.0'
id "fabric-loom" version "1.6-SNAPSHOT"
id "com.diffplug.spotless" version "6.25.0"
}

def ENV = System.getenv()
Expand Down Expand Up @@ -85,23 +84,6 @@ spotless {
}
}

// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

task moveDevLibs(dependsOn: [remapJar, remapSourcesJar]) {
doLast {
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-dev.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ org.gradle.parallel=true
# check these at https://fabricmc.net/develop/ and
# https://modrinth.com/mod/fabric-api/versions
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

# Fabric API
fabric_version=0.98.0+1.20.6
fabric_version=0.99.4+1.20.6

# Mod Properties
mod_version = v7.42-MC1.20.6
mod_version = v7.43pre2-MC1.20.6
maven_group = net.wurstclient
archives_base_name = Wurst-Client

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/WurstClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;

public static final String VERSION = "7.42";
public static final String VERSION = "7.43pre2";
public static final String MC_VERSION = "1.20.6";

private WurstAnalytics analytics;
Expand Down
66 changes: 23 additions & 43 deletions src/main/java/net/wurstclient/ai/PathFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.mojang.blaze3d.systems.RenderSystem;

import net.minecraft.block.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.LavaFluid;
Expand All @@ -31,20 +32,9 @@

public class PathFinder
{
private final WurstClient wurst = WurstClient.INSTANCE;

private final boolean invulnerable =
WurstClient.MC.player.getAbilities().creativeMode;
private final boolean creativeFlying =
WurstClient.MC.player.getAbilities().flying;
protected final boolean flying =
creativeFlying || wurst.getHax().flightHack.isEnabled();
private final boolean immuneToFallDamage =
invulnerable || wurst.getHax().noFallHack.isEnabled();
private final boolean noWaterSlowdown =
wurst.getHax().antiWaterPushHack.isPreventingSlowdown();
private final boolean jesus = wurst.getHax().jesusHack.isEnabled();
private final boolean spider = wurst.getHax().spiderHack.isEnabled();
private static final MinecraftClient MC = WurstClient.MC;

private final PlayerAbilities abilities = PlayerAbilities.get();
protected boolean fallingAllowed = true;
protected boolean divingAllowed = true;

Expand All @@ -66,13 +56,11 @@ public class PathFinder

public PathFinder(BlockPos goal)
{
if(WurstClient.MC.player.isOnGround())
start = new PathPos(BlockPos.ofFloored(WurstClient.MC.player.getX(),
WurstClient.MC.player.getY() + 0.5,
WurstClient.MC.player.getZ()));
if(MC.player.isOnGround())
start = new PathPos(BlockPos.ofFloored(MC.player.getX(),
MC.player.getY() + 0.5, MC.player.getZ()));
else
start =
new PathPos(BlockPos.ofFloored(WurstClient.MC.player.getPos()));
start = new PathPos(BlockPos.ofFloored(MC.player.getPos()));
this.goal = goal;

costMap.put(start, 0F);
Expand Down Expand Up @@ -196,7 +184,7 @@ private ArrayList<PathPos> getNeighbors(PathPos pos)
}

// up
if(pos.getY() < WurstClient.MC.world.getTopY() && canGoThrough(up.up())
if(pos.getY() < MC.world.getTopY() && canGoThrough(up.up())
&& (flying || onGround || canClimbUpAt(pos))
&& (flying || canClimbUpAt(pos) || goal.equals(up)
|| canSafelyStandOn(north) || canSafelyStandOn(east)
Expand All @@ -205,7 +193,7 @@ private ArrayList<PathPos> getNeighbors(PathPos pos)
neighbors.add(new PathPos(up, onGround));

// down
if(pos.getY() > WurstClient.MC.world.getBottomY() && canGoThrough(down)
if(pos.getY() > MC.world.getBottomY() && canGoThrough(down)
&& canGoAbove(down.down()) && (flying || canFallBelow(pos))
&& (divingAllowed || BlockUtils.getBlock(pos) != Blocks.WATER))
neighbors.add(new PathPos(down));
Expand Down Expand Up @@ -285,8 +273,8 @@ protected boolean canBeSolid(BlockPos pos)
Block block = state.getBlock();

return state.blocksMovement() && !(block instanceof AbstractSignBlock)
|| block instanceof LadderBlock
|| jesus && (block == Blocks.WATER || block == Blocks.LAVA);
|| block instanceof LadderBlock || abilities.jesus()
&& (block == Blocks.WATER || block == Blocks.LAVA);
}

@SuppressWarnings("deprecation")
Expand All @@ -295,7 +283,7 @@ private boolean canGoThrough(BlockPos pos)
// check if loaded
// Can't see why isChunkLoaded() is deprecated. Still seems to be widely
// used with no replacement.
if(!WurstClient.MC.world.isChunkLoaded(pos))
if(!MC.world.isChunkLoaded(pos))
return false;

// check if solid
Expand All @@ -310,7 +298,7 @@ private boolean canGoThrough(BlockPos pos)
return false;

// check if safe
if(!invulnerable
if(!abilities.invulnerable()
&& (block == Blocks.LAVA || block instanceof AbstractFireBlock))
return false;

Expand All @@ -337,7 +325,7 @@ private boolean canSafelyStandOn(BlockPos pos)
// check if safe
BlockState state = BlockUtils.getState(pos);
Fluid fluid = state.getFluidState().getFluid();
if(!invulnerable && (state.getBlock() instanceof CactusBlock
if(!abilities.invulnerable() && (state.getBlock() instanceof CactusBlock
|| fluid instanceof LavaFluid))
return false;

Expand All @@ -356,7 +344,7 @@ private boolean canFallBelow(PathPos pos)
return false;

// check if fall damage is off
if(immuneToFallDamage && fallingAllowed)
if(abilities.immuneToFallDamage() && fallingAllowed)
return true;

// check if fall ends with slime block
Expand Down Expand Up @@ -395,15 +383,15 @@ private boolean canFallBelow(PathPos pos)

private boolean canFlyAt(BlockPos pos)
{
return flying
|| !noWaterSlowdown && BlockUtils.getBlock(pos) == Blocks.WATER;
return abilities.flying() || !abilities.noWaterSlowdown()
&& BlockUtils.getBlock(pos) == Blocks.WATER;
}

private boolean canClimbUpAt(BlockPos pos)
{
// check if this block works for climbing
Block block = BlockUtils.getBlock(pos);
if(!spider && !(block instanceof LadderBlock)
if(!abilities.spider() && !(block instanceof LadderBlock)
&& !(block instanceof VineBlock))
return false;

Expand Down Expand Up @@ -448,7 +436,7 @@ private float getCost(BlockPos current, BlockPos next)
Block block = BlockUtils.getBlock(pos);

// liquids
if(block == Blocks.WATER && !noWaterSlowdown)
if(block == Blocks.WATER && !abilities.noWaterSlowdown())
costs[i] *= 1.3164437838225804F;
else if(block == Blocks.LAVA)
costs[i] *= 4.539515393656079F;
Expand Down Expand Up @@ -624,15 +612,7 @@ public boolean isPathStillValid(int index)
throw new IllegalStateException("Path is not formatted!");

// check player abilities
if(invulnerable != WurstClient.MC.player.getAbilities().creativeMode
|| flying != (creativeFlying
|| wurst.getHax().flightHack.isEnabled())
|| immuneToFallDamage != (invulnerable
|| wurst.getHax().noFallHack.isEnabled())
|| noWaterSlowdown != wurst.getHax().antiWaterPushHack
.isPreventingSlowdown()
|| jesus != wurst.getHax().jesusHack.isEnabled()
|| spider != wurst.getHax().spiderHack.isEnabled())
if(!abilities.equals(PlayerAbilities.get()))
return false;

// if index is zero, check if first pos is safe
Expand All @@ -654,8 +634,8 @@ public boolean isPathStillValid(int index)

public PathProcessor getProcessor()
{
if(flying)
return new FlyPathProcessor(path, creativeFlying);
if(abilities.flying())
return new FlyPathProcessor(path, abilities.creativeFlying());

return new WalkPathProcessor(path);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/ai/PathProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static final void lockControls()
key.setPressed(false);

// disable sprinting
WurstClient.MC.player.setSprinting(false);
MC.player.setSprinting(false);
}

public static final void releaseControls()
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/net/wurstclient/ai/PlayerAbilities.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2014-2024 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.ai;

import net.minecraft.client.MinecraftClient;
import net.wurstclient.WurstClient;
import net.wurstclient.hack.HackList;

public record PlayerAbilities(boolean invulnerable, boolean creativeFlying,
boolean flying, boolean immuneToFallDamage, boolean noWaterSlowdown,
boolean jesus, boolean spider)
{

private static final WurstClient WURST = WurstClient.INSTANCE;
private static final MinecraftClient MC = WurstClient.MC;

public static PlayerAbilities get()
{
HackList hax = WURST.getHax();
net.minecraft.entity.player.PlayerAbilities mcAbilities =
MC.player.getAbilities();

boolean invulnerable =
mcAbilities.invulnerable || mcAbilities.creativeMode;
boolean creativeFlying = mcAbilities.flying;
boolean flying = creativeFlying || hax.flightHack.isEnabled();
boolean immuneToFallDamage = invulnerable || hax.noFallHack.isEnabled();
boolean noWaterSlowdown = hax.antiWaterPushHack.isPreventingSlowdown();
boolean jesus = hax.jesusHack.isEnabled();
boolean spider = hax.spiderHack.isEnabled();

return new PlayerAbilities(invulnerable, creativeFlying, flying,
immuneToFallDamage, noWaterSlowdown, jesus, spider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
Expand Down Expand Up @@ -153,7 +155,13 @@ private static String getAuthorizationCode(String email, String password)

System.out.println("Getting login cookies...");
cookie = "";
for(String c : connection.getHeaderFields().get("Set-Cookie"))
List<String> cookies =
connection.getHeaderFields().get("Set-Cookie");

if(cookies == null)
cookies = Collections.emptyList();

for(String c : cookies)
{
String cookieTrimmed = c.substring(0, c.indexOf(";") + 1);
cookie += cookieTrimmed;
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/net/wurstclient/events/HandleInputListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2014-2024 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.client.MinecraftClient;
import net.wurstclient.event.Event;
import net.wurstclient.event.Listener;

/**
* Fired at the beginning of {@link MinecraftClient#handleInputEvents()}.
* This is the ideal time to simulate keyboard input.
*/
public interface HandleInputListener extends Listener
{
/**
* Fired at the beginning of {@link MinecraftClient#handleInputEvents()}.
* This is the ideal time to simulate keyboard input.
*/
public void onHandleInput();

/**
* Fired at the beginning of {@link MinecraftClient#handleInputEvents()}.
* This is the ideal time to simulate keyboard input.
*/
public static class HandleInputEvent extends Event<HandleInputListener>
{
public static final HandleInputEvent INSTANCE = new HandleInputEvent();

@Override
public void fire(ArrayList<HandleInputListener> listeners)
{
for(HandleInputListener listener : listeners)
listener.onHandleInput();
}

@Override
public Class<HandleInputListener> getListenerType()
{
return HandleInputListener.class;
}
}
}
Loading
Loading