-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Wurst-Imperium/master
Update branch
- Loading branch information
Showing
10 changed files
with
218 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2014-2022 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.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.hit.HitResult; | ||
import net.wurstclient.Category; | ||
import net.wurstclient.SearchTags; | ||
import net.wurstclient.events.RightClickListener; | ||
import net.wurstclient.hack.Hack; | ||
import net.wurstclient.settings.SliderSetting; | ||
import net.wurstclient.settings.SliderSetting.ValueDisplay; | ||
|
||
@SearchTags({"air place"}) | ||
public final class AirPlaceHack extends Hack implements RightClickListener | ||
{ | ||
private final SliderSetting range = | ||
new SliderSetting("Range", 5, 1, 6, 0.05, ValueDisplay.DECIMAL); | ||
|
||
public AirPlaceHack() | ||
{ | ||
super("AirPlace"); | ||
setCategory(Category.BLOCKS); | ||
addSetting(range); | ||
} | ||
|
||
@Override | ||
public void onEnable() | ||
{ | ||
EVENTS.add(RightClickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onDisable() | ||
{ | ||
EVENTS.remove(RightClickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onRightClick(RightClickEvent event) | ||
{ | ||
HitResult hitResult = MC.player.raycast(range.getValue(), 0, false); | ||
if(!(hitResult instanceof BlockHitResult blockHitResult)) | ||
return; | ||
|
||
IMC.getInteractionManager().rightClickBlock( | ||
blockHitResult.getBlockPos(), blockHitResult.getSide(), | ||
blockHitResult.getPos()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (c) 2014-2022 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.minecraft.network.Packet; | ||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; | ||
import net.wurstclient.Category; | ||
import net.wurstclient.SearchTags; | ||
import net.wurstclient.events.PacketOutputListener; | ||
import net.wurstclient.hack.Hack; | ||
|
||
@SearchTags({"anti hunger"}) | ||
public final class AntiHungerHack extends Hack implements PacketOutputListener | ||
{ | ||
public AntiHungerHack() | ||
{ | ||
super("AntiHunger"); | ||
setCategory(Category.MOVEMENT); | ||
} | ||
|
||
@Override | ||
public void onEnable() | ||
{ | ||
EVENTS.add(PacketOutputListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onDisable() | ||
{ | ||
EVENTS.remove(PacketOutputListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onSentPacket(PacketOutputEvent event) | ||
{ | ||
if(!(event.getPacket() instanceof PlayerMoveC2SPacket oldPacket)) | ||
return; | ||
|
||
if(!MC.player.isOnGround() || MC.player.fallDistance > 0.5) | ||
return; | ||
|
||
if(MC.interactionManager.isBreakingBlock()) | ||
return; | ||
|
||
double x = oldPacket.getX(-1); | ||
double y = oldPacket.getY(-1); | ||
double z = oldPacket.getZ(-1); | ||
float yaw = oldPacket.getYaw(-1); | ||
float pitch = oldPacket.getPitch(-1); | ||
|
||
Packet<?> newPacket; | ||
if(oldPacket.changesPosition()) | ||
if(oldPacket.changesLook()) | ||
newPacket = | ||
new PlayerMoveC2SPacket.Full(x, y, z, yaw, pitch, false); | ||
else | ||
newPacket = | ||
new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false); | ||
else if(oldPacket.changesLook()) | ||
newPacket = | ||
new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, false); | ||
else | ||
newPacket = new PlayerMoveC2SPacket.OnGroundOnly(false); | ||
|
||
event.setPacket(newPacket); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/net/wurstclient/hacks/CameraDistanceHack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2014-2022 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; | ||
import net.wurstclient.settings.SliderSetting; | ||
import net.wurstclient.settings.SliderSetting.ValueDisplay; | ||
|
||
@SearchTags({"camera distance", "CamDistance", "cam distance"}) | ||
public final class CameraDistanceHack extends Hack | ||
{ | ||
private final SliderSetting distance = | ||
new SliderSetting("Distance", 12, -0.5, 150, 0.5, ValueDisplay.DECIMAL); | ||
|
||
public CameraDistanceHack() | ||
{ | ||
super("CameraDistance"); | ||
setCategory(Category.RENDER); | ||
addSetting(distance); | ||
} | ||
|
||
public double getDistance() | ||
{ | ||
return distance.getValueF(); | ||
} | ||
|
||
// See CameraMixin.changeClipToSpaceDistance() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters