Skip to content

Commit

Permalink
Merge branch 'Wurst-Imperium:master' into murder-mystery-personal
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueGradientHorizon authored Jun 4, 2024
2 parents 3073a4b + 2e01c02 commit ff85c78
Show file tree
Hide file tree
Showing 74 changed files with 969 additions and 637 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ task github(dependsOn: moveDevLibs) {
def ghRelease = repository.getReleaseByTagName(ghVersion as String)
if(ghRelease == null) {
def releaseBuilder = new GHReleaseBuilder(repository, ghVersion as String)
releaseBuilder.prerelease(ghVersion.contains("pre"))
ghRelease = releaseBuilder.create()
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ org.gradle.parallel=true

# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
# https://modrinth.com/mod/fabric-api/versions
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.10
loader_version=0.15.11

#Fabric api
fabric_version=0.97.8+1.20.6
# Fabric API
fabric_version=0.98.0+1.20.6

# Mod Properties
mod_version = v7.41.2-MC1.20.6
mod_version = v7.42-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.41.2";
public static final String VERSION = "7.42";
public static final String MC_VERSION = "1.20.6";

private WurstAnalytics analytics;
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 @@ -77,6 +77,6 @@ public static final void releaseControls()
{
// reset keys
for(KeyBinding key : CONTROLS)
((IKeyBinding)key).resetPressedState();
IKeyBinding.get(key).resetPressedState();
}
}
11 changes: 11 additions & 0 deletions src/main/java/net/wurstclient/hacks/AimAssistHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public final class AimAssistHack extends Hack
private final CheckboxSetting checkLOS = new CheckboxSetting(
"Check line of sight", "Won't aim at entities behind blocks.", true);

private final CheckboxSetting aimWhileBlocking = new CheckboxSetting(
"Aim while blocking", "Keeps aiming at entities while you're blocking"
+ " with a shield or using items.",
false);

private final EntityFilterList entityFilters =
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
Expand Down Expand Up @@ -90,6 +95,7 @@ public AimAssistHack()
addSetting(rotationSpeed);
addSetting(fov);
addSetting(checkLOS);
addSetting(aimWhileBlocking);

entityFilters.forEach(this::addSetting);
}
Expand Down Expand Up @@ -123,10 +129,15 @@ protected void onDisable()
@Override
public void onUpdate()
{
target = null;

// don't aim when a container/inventory screen is open
if(MC.currentScreen instanceof HandledScreen)
return;

if(!aimWhileBlocking.isChecked() && MC.player.isUsingItem())
return;

Stream<Entity> stream = EntityUtils.getAttackableEntities();
double rangeSq = Math.pow(range.getValue(), 2);
stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq);
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/net/wurstclient/hacks/AnchorAuraHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import net.wurstclient.settings.FacingSetting.Facing;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.settings.SwingHandSetting;
import net.wurstclient.settings.SwingHandSetting.SwingHand;
import net.wurstclient.settings.filterlists.AnchorAuraFilterList;
import net.wurstclient.settings.filterlists.EntityFilterList;
import net.wurstclient.util.BlockUtils;
Expand Down Expand Up @@ -69,6 +71,11 @@ public final class AnchorAuraHack extends Hack implements UpdateListener
+ "Slower but can help with anti-cheat plugins.",
false);

private final SwingHandSetting swingHand = new SwingHandSetting(
"How AnchorAura should swing your hand when placing, charging and"
+ " detonating respawn anchors.",
SwingHand.CLIENT);

private final EnumSetting<TakeItemsFrom> takeItemsFrom = new EnumSetting<>(
"Take items from", "Where to look for respawn anchors and glowstone.",
TakeItemsFrom.values(), TakeItemsFrom.INVENTORY);
Expand All @@ -85,6 +92,7 @@ public AnchorAuraHack()
addSetting(autoPlace);
addSetting(faceBlocks);
addSetting(checkLOS);
addSetting(swingHand);
addSetting(takeItemsFrom);

entityFilters.forEach(this::addSetting);
Expand Down Expand Up @@ -174,7 +182,7 @@ private ArrayList<BlockPos> placeAnchorsNear(ArrayList<Entity> targets)
}

if(shouldSwing)
MC.player.swingHand(Hand.MAIN_HAND);
swingHand.swing(Hand.MAIN_HAND);

return newAnchors;
}
Expand All @@ -196,7 +204,7 @@ private void detonate(ArrayList<BlockPos> chargedAnchors)
shouldSwing = true;

if(shouldSwing)
MC.player.swingHand(Hand.MAIN_HAND);
swingHand.swing(Hand.MAIN_HAND);
}

private void charge(ArrayList<BlockPos> unchargedAnchors)
Expand All @@ -216,7 +224,7 @@ private void charge(ArrayList<BlockPos> unchargedAnchors)
shouldSwing = true;

if(shouldSwing)
MC.player.swingHand(Hand.MAIN_HAND);
swingHand.swing(Hand.MAIN_HAND);
}

private boolean rightClickBlock(BlockPos pos)
Expand Down
69 changes: 58 additions & 11 deletions src/main/java/net/wurstclient/hacks/AntiAfkHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,39 @@
import net.wurstclient.hack.Hack;
import net.wurstclient.mixinterface.IKeyBinding;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;

@SearchTags({"anti afk", "AFKBot", "afk bot"})
@DontSaveState
public final class AntiAfkHack extends Hack
implements UpdateListener, RenderListener
{
private final CheckboxSetting useAi = new CheckboxSetting("Use AI", true);
private final CheckboxSetting useAi = new CheckboxSetting("Use AI",
"Uses a pathfinding AI to move around naturally and avoid hazards.\n"
+ "Can sometimes get stuck.",
true);

private final SliderSetting aiRange = new SliderSetting("AI range",
"The area in which AntiAFK can move when Use AI is turned on.", 16, 1,
64, 1, ValueDisplay.AREA_FROM_RADIUS);

private final SliderSetting nonAiRange = new SliderSetting("Non-AI range",
"The area in which AntiAFK can move when Use AI is turned off.\n\n"
+ "\u00a7c\u00a7lWARNING:\u00a7r This area must be completely"
+ " unobstructed and free of hazards.",
1, 1, 64, 1, ValueDisplay.AREA_FROM_RADIUS);

private final SliderSetting waitTime =
new SliderSetting("Wait time", "Time between movements in seconds.",
2.5, 0, 60, 0.05, ValueDisplay.DECIMAL.withSuffix("s"));

private final SliderSetting waitTimeRand =
new SliderSetting("Wait time randomization",
"How much time can be randomly added or subtracted from the wait"
+ " time, in seconds.",
0.5, 0, 60, 0.05,
ValueDisplay.DECIMAL.withPrefix("\u00b1").withSuffix("s"));

private int timer;
private Random random = new Random();
Expand All @@ -51,14 +77,19 @@ public AntiAfkHack()

setCategory(Category.OTHER);
addSetting(useAi);
addSetting(aiRange);
addSetting(nonAiRange);
addSetting(waitTime);
addSetting(waitTimeRand);
}

@Override
protected void onEnable()
{
start = BlockPos.ofFloored(MC.player.getPos());
nextBlock = null;
pathFinder = new RandomPathFinder(start);
pathFinder =
new RandomPathFinder(randomize(start, aiRange.getValueI(), true));
creativeFlying = MC.player.getAbilities().flying;

WURST.getHax().autoFishHack.setEnabled(false);
Expand All @@ -73,14 +104,23 @@ protected void onDisable()
EVENTS.remove(UpdateListener.class, this);
EVENTS.remove(RenderListener.class, this);

((IKeyBinding)MC.options.forwardKey).resetPressedState();
((IKeyBinding)MC.options.jumpKey).resetPressedState();
IKeyBinding.get(MC.options.forwardKey).resetPressedState();
IKeyBinding.get(MC.options.jumpKey).resetPressedState();

pathFinder = null;
processor = null;
PathProcessor.releaseControls();
}

private void setTimer()
{
int baseTime = (int)(waitTime.getValue() * 20);
int randTime = (int)(waitTimeRand.getValue() * 20);
int randOffset = random.nextInt(randTime * 2 + 1) - randTime;
randOffset = Math.max(randOffset, -baseTime);
timer = baseTime + randOffset;
}

@Override
public void onUpdate()
{
Expand Down Expand Up @@ -132,22 +172,22 @@ public void onUpdate()
if(!processor.isDone())
processor.process();
else
pathFinder = new RandomPathFinder(start);
pathFinder = new RandomPathFinder(
randomize(start, aiRange.getValueI(), true));

// wait 2 - 3 seconds (40 - 60 ticks)
if(processor.isDone())
{
PathProcessor.releaseControls();
timer = 40 + random.nextInt(21);
setTimer();
}
}else
{
// set next block
if(timer <= 0 || nextBlock == null)
{
nextBlock =
start.add(random.nextInt(3) - 1, 0, random.nextInt(3) - 1);
timer = 40 + random.nextInt(21);
nextBlock = randomize(start, nonAiRange.getValueI(), false);
setTimer();
}

// face block
Expand Down Expand Up @@ -181,12 +221,19 @@ public void onRender(MatrixStack matrixStack, float partialTicks)
pathCmd.isDepthTest());
}

private BlockPos randomize(BlockPos pos, int range, boolean includeY)
{
int x = random.nextInt(2 * range + 1) - range;
int y = includeY ? random.nextInt(2 * range + 1) - range : 0;
int z = random.nextInt(2 * range + 1) - range;
return pos.add(x, y, z);
}

private class RandomPathFinder extends PathFinder
{
public RandomPathFinder(BlockPos goal)
{
super(goal.add(random.nextInt(33) - 16, random.nextInt(33) - 16,
random.nextInt(33) - 16));
super(goal);
setThinkTime(10);
setFallingAllowed(false);
setDivingAllowed(false);
Expand Down
33 changes: 17 additions & 16 deletions src/main/java/net/wurstclient/hacks/AutoCompleteHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
import net.wurstclient.events.ChatOutputListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.hacks.autocomplete.ApiProviderSetting;
import net.wurstclient.hacks.autocomplete.MessageCompleter;
import net.wurstclient.hacks.autocomplete.ModelSettings;
import net.wurstclient.hacks.autocomplete.OobaboogaMessageCompleter;
import net.wurstclient.hacks.autocomplete.OpenAiMessageCompleter;
import net.wurstclient.hacks.autocomplete.SuggestionHandler;
import net.wurstclient.util.ChatUtils;
Expand All @@ -32,7 +30,6 @@ public final class AutoCompleteHack extends Hack
{
private final ModelSettings modelSettings = new ModelSettings();
private final SuggestionHandler suggestionHandler = new SuggestionHandler();
private final ApiProviderSetting apiProvider = new ApiProviderSetting();

private MessageCompleter completer;
private String draftMessage;
Expand All @@ -47,19 +44,14 @@ public AutoCompleteHack()
super("AutoComplete");
setCategory(Category.CHAT);

addSetting(apiProvider);
modelSettings.forEach(this::addSetting);
suggestionHandler.getSettings().forEach(this::addSetting);
}

@Override
protected void onEnable()
{
completer = switch(apiProvider.getSelected())
{
case OPENAI -> new OpenAiMessageCompleter(modelSettings);
case OOBABOOGA -> new OobaboogaMessageCompleter(modelSettings);
};
completer = new OpenAiMessageCompleter(modelSettings);

if(completer instanceof OpenAiMessageCompleter
&& System.getenv("WURST_OPENAI_KEY") == null)
Expand Down Expand Up @@ -117,7 +109,9 @@ public void onUpdate()
return;

// check if we already have a suggestion for the current draft message
if(suggestionHandler.hasEnoughSuggestionFor(draftMessage))
int maxSuggestions =
suggestionHandler.getMaxSuggestionsFor(draftMessage);
if(maxSuggestions < 1)
return;

// copy fields to local variables, in case they change
Expand All @@ -129,14 +123,21 @@ public void onUpdate()
// build thread
apiCallThread = new Thread(() -> {

// get suggestion
String suggestion = completer.completeChatMessage(draftMessage2);
if(suggestion.isEmpty())
// get suggestions
String[] suggestions =
completer.completeChatMessage(draftMessage2, maxSuggestions);
if(suggestions.length < 1)
return;

// apply suggestion
suggestionHandler.addSuggestion(suggestion, draftMessage2,
suggestionsUpdater2);
for(String suggestion : suggestions)
{
if(suggestion.isEmpty())
continue;

// apply suggestion
suggestionHandler.addSuggestion(suggestion, draftMessage2,
suggestionsUpdater2);
}
});
apiCallThread.setName("AutoComplete API Call");
apiCallThread.setPriority(Thread.MIN_PRIORITY);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hacks/AutoEatHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public AutoEatHack()
@Override
protected void onEnable()
{
WURST.getHax().autoSoupHack.setEnabled(false);
EVENTS.add(UpdateListener.class, this);
}

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,16 @@ private void placeJobSite()
? Hand.MAIN_HAND : Hand.OFF_HAND;

// sneak-place to avoid activating trapdoors/chests/etc.
MC.options.sneakKey.setPressed(true);
IKeyBinding sneakKey = IKeyBinding.get(MC.options.sneakKey);
sneakKey.setPressed(true);
if(!MC.player.isSneaking())
return;

// get block placing params
BlockPlacingParams params = BlockPlacer.getBlockPlacingParams(jobSite);
if(params == null)
{
((IKeyBinding)MC.options.sneakKey).resetPressedState();
sneakKey.resetPressedState();
return;
}

Expand All @@ -361,7 +362,7 @@ private void placeJobSite()
swingHand.swing(hand);

// reset sneak
((IKeyBinding)MC.options.sneakKey).resetPressedState();
sneakKey.resetPressedState();
}

private void openTradeScreen()
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hacks/AutoSoupHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public AutoSoupHack()
@Override
protected void onEnable()
{
WURST.getHax().autoEatHack.setEnabled(false);
EVENTS.add(UpdateListener.class, this);
}

Expand Down
Loading

0 comments on commit ff85c78

Please sign in to comment.