-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
54 changed files
with
1,567 additions
and
260 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
57 changes: 57 additions & 0 deletions
57
src/main/java/net/wurstclient/events/PlayerAttacksEntityListener.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,57 @@ | ||
/* | ||
* 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.network.ClientPlayerInteractionManager; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.wurstclient.event.Event; | ||
import net.wurstclient.event.Listener; | ||
|
||
/** | ||
* Fired at the beginning of | ||
* {@link ClientPlayerInteractionManager#attackEntity(PlayerEntity, Entity)}. | ||
*/ | ||
public interface PlayerAttacksEntityListener extends Listener | ||
{ | ||
/** | ||
* Fired at the beginning of | ||
* {@link ClientPlayerInteractionManager#attackEntity(PlayerEntity, Entity)}. | ||
*/ | ||
public void onPlayerAttacksEntity(Entity target); | ||
|
||
/** | ||
* Fired at the beginning of | ||
* {@link ClientPlayerInteractionManager#attackEntity(PlayerEntity, Entity)}. | ||
*/ | ||
public static class PlayerAttacksEntityEvent | ||
extends Event<PlayerAttacksEntityListener> | ||
{ | ||
private final Entity target; | ||
|
||
public PlayerAttacksEntityEvent(Entity target) | ||
{ | ||
this.target = target; | ||
} | ||
|
||
@Override | ||
public void fire(ArrayList<PlayerAttacksEntityListener> listeners) | ||
{ | ||
for(PlayerAttacksEntityListener listener : listeners) | ||
listener.onPlayerAttacksEntity(target); | ||
} | ||
|
||
@Override | ||
public Class<PlayerAttacksEntityListener> getListenerType() | ||
{ | ||
return PlayerAttacksEntityListener.class; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.