This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
forked from Wurst-Imperium/Wurst7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
887 additions
and
396 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
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,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); | ||
} | ||
} |
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
49 changes: 49 additions & 0 deletions
49
src/main/java/net/wurstclient/events/HandleInputListener.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,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; | ||
} | ||
} | ||
} |
Oops, something went wrong.