-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
new hack: AutoMLGHack #557
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, a short fall distance fails to reduce/negate damage. Also, the player drops straight down whether or not the player has a MLG-able item in their inventory, and items in the offhand are not detected. Otherwise works.
@InfinitePower563 Placing water bucket in your offhand is generally not a good idea since you're likely to interact with the item in your main hand instead of placing water down, making the whole thing much more unreliable. |
Now the hack can make use of offhand or inventory. Also the short fall distance issue is fixed. |
@isjerryxiao #559 , #558 ,#557 和 #556 为啥不放在一起? |
@buiawpkgew1 https://github.com/Wurst-Imperium/Wurst7#note-about-pull-requests |
好的 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it activates when elytra is activated. Kind of glitches out when gliding downward.
You can't use elytra with NoFall either, but adding a check is better. |
cant build anymore |
WalkthroughWalkthroughThe changes involve the addition of a new feature to the Wurst Client, a Minecraft hack client. A new hack called Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to filter (2)
- src/main/resources/assets/wurst/lang/en_us.json
- src/main/resources/assets/wurst/lang/zh_cn.json
Files selected for processing (4)
- src/main/java/net/wurstclient/hack/HackList.java (1 hunks)
- src/main/java/net/wurstclient/hacks/AutoMLGHack.java (1 hunks)
- src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java (1 hunks)
- src/main/java/net/wurstclient/mixinterface/IClientPlayerInteractionManager.java (1 hunks)
Files skipped from review due to trivial changes (2)
- src/main/java/net/wurstclient/hack/HackList.java
- src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java
Additional comments: 1
src/main/java/net/wurstclient/mixinterface/IClientPlayerInteractionManager.java (1)
- 19-25: The addition of the
windowClick_THROW
method to theIClientPlayerInteractionManager
interface will require all implementing classes to provide an implementation for this method. Ensure that all necessary implementations are updated accordingly to avoid compilation errors.
if (!placedWater) { | ||
float minfallDistance = minFall.getValueF(); | ||
if (MC.player.fallDistance > minfallDistance - 2.0f && !MC.player.hasStatusEffect(StatusEffects.SLOW_FALLING) | ||
&& !(checkElytra.isChecked() && MC.player.isFallFlying())) { | ||
Vec3d playerPos = MC.player.getPos(); | ||
if (lastPlayerPos == null) lastPlayerPos = playerPos; | ||
if (playerPos.y - lastPlayerPos.y < 0.0D) { | ||
BlockHitResult result = MC.world.raycast(new RaycastContext(MC.player.getPos(), playerPos.subtract(0, 5, 0), RaycastContext.ShapeType.OUTLINE, RaycastContext.FluidHandling.NONE, MC.player)); | ||
BlockPos bp = result.getBlockPos(); | ||
if (result != null && result.getType() == HitResult.Type.BLOCK | ||
&& Math.max(0.0, (float)playerPos.y - (float)(bp.getY())) - 1.3f + MC.player.fallDistance > minfallDistance | ||
&& causeFallDamage(BlockUtils.getState(result.getBlockPos())) | ||
&& causeFallDamage(BlockUtils.getState(result.getBlockPos().up())) | ||
) { | ||
for (ItemStack bucket : (snowFirst.isChecked() ? Lists.reverse(BUCKETS) : BUCKETS)) { | ||
if (MC.world.getDimension().ultrawarm() && bucket.getItem().equals(Items.WATER_BUCKET)) | ||
continue; | ||
int location = takeStackOut(bucket); | ||
if (location == 0) continue; | ||
offHand = location < 0; | ||
waterBucket = bucket.getItem().equals(Items.WATER_BUCKET); | ||
if (anchor.isChecked()) { | ||
double x = MathHelper.floor(MC.player.getX()) + 0.5; | ||
double z = MathHelper.floor(MC.player.getZ()) + 0.5; | ||
if ((Math.abs(MC.player.getX() - x) > 1e-5) || (Math.abs(MC.player.getZ() - z) > 1e-5)) { | ||
MC.player.setPosition(x, MC.player.getY(), z); | ||
MC.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(MC.player.getX(), MC.player.getY(), MC.player.getZ(), MC.player.isOnGround())); | ||
} | ||
MC.player.setVelocity(0, MC.player.getVelocity().y, 0); | ||
} | ||
if (lastRot == null) lastRot = MC.player.getRotationClient(); | ||
if (rightClickBlock(bp)) { | ||
placedWater = true; | ||
targetBlock = bp; | ||
pickupRetry = 0; | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
lastPlayerPos = playerPos; | ||
} | ||
else { | ||
lastRot = null; | ||
} | ||
} else { | ||
if (MC.player.isOnGround() || MC.player.isTouchingWater() && MC.itemUseCooldown < 1) { | ||
int location = takeStackOut(new ItemStack(Items.BUCKET)); | ||
if (location != 0) { | ||
offHand = location < 0; | ||
rightClickBlock(targetBlock); | ||
if ((offHand ? MC.player.getOffHandStack() : MC.player.getInventory().getMainHandStack()).getItem().equals(Items.BUCKET)) { | ||
pickupRetry++; | ||
if (pickupRetry <= 10) { | ||
return; | ||
} | ||
} | ||
} | ||
if (doSneak.isChecked()) { | ||
IKeyBinding sneakKey = (IKeyBinding) MC.options.sneakKey; | ||
((KeyBinding) sneakKey).setPressed(sneakKey.isActallyPressed()); | ||
} | ||
restoreRotation(); | ||
lastPlayerPos = null; | ||
placedWater = false; | ||
} | ||
} | ||
} | ||
private boolean causeFallDamage(BlockState bs) { | ||
if (bs.isAir()) return true; | ||
Block block = bs.getBlock(); | ||
if (block instanceof FluidBlock || block instanceof SeaPickleBlock || block instanceof SeagrassBlock) return false; | ||
// todo slabs and more? | ||
return true; | ||
} | ||
|
||
private int takeStackOut(ItemStack stack) { | ||
PlayerInventory inv = MC.player.getInventory(); | ||
int slot = inv.getSlotWithStack(stack); | ||
if (slot >= 0 && slot <= 8) { | ||
// bucket in hotbar | ||
inv.selectedSlot = slot; | ||
return 1; | ||
} | ||
else if (slot >= 9 && slot <= 35) { | ||
// bucket in inventory | ||
if (allowInv.isChecked()) { | ||
IMC.getInteractionManager().windowClick_SWAP(slot, inv.selectedSlot); | ||
return 1; | ||
} | ||
} | ||
else { | ||
// no bucket in inventory | ||
if (ItemStack.areItemsEqual(MC.player.getOffHandStack(), stack)) { | ||
// use bucket in offhand | ||
return -1; | ||
} | ||
} | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AutoMLGHack
class is well-structured and follows Java conventions. However, there are a few areas that could be improved for better performance and maintainability:
- The
onUpdate
method (lines 126-195) is quite long and handles multiple responsibilities. Consider breaking it down into smaller methods for better readability and maintainability. - The
causeFallDamage
method (lines 196-201) could be expanded to include more block types that prevent fall damage, as indicated by thetodo
comment. - The
takeStackOut
method (lines 204-227) could be optimized by returning early to reduce nesting and improve readability. - The use of magic numbers (e.g.,
18.0625
on line 105) should be replaced with named constants for better clarity. - The
rightClickBlock
method (lines 92-116) sends a packet to the server to update the player's rotation. This could potentially be exploited or cause desync issues if not handled correctly. Ensure that the server's anti-cheat mechanisms are considered. - The
restoreRotation
method (lines 118-123) directly sets the player's pitch and yaw. This could lead to abrupt changes in the player's view. Consider smoothing out the rotation change to avoid a jarring experience.
Here's a proposed change for the takeStackOut
method to reduce nesting:
private int takeStackOut(ItemStack stack) {
PlayerInventory inv = MC.player.getInventory();
int slot = inv.getSlotWithStack(stack);
if (slot < 0 || slot > 35) {
// no bucket in inventory
if (ItemStack.areItemsEqual(MC.player.getOffHandStack(), stack)) {
// use bucket in offhand
return -1;
}
return 0;
}
if (slot >= 0 && slot <= 8) {
// bucket in hotbar
inv.selectedSlot = slot;
return 1;
}
if (slot >= 9 && allowInv.isChecked()) {
// bucket in inventory
IMC.getInteractionManager().windowClick_SWAP(slot, inv.selectedSlot);
return 1;
}
return 0;
}
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:
|
Description
It does auto mlg water bucket and powder snow.