mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-27 02:21:38 +01:00
Renamed PlayerInteractEvent to PlayerEntityInteractEvent
This commit is contained in:
parent
92cf598f13
commit
889b1fe095
@ -7,13 +7,13 @@ import net.minestom.server.event.Event;
|
||||
/**
|
||||
* Called when a player interacts (right-click) with an entity
|
||||
*/
|
||||
public class PlayerInteractEvent extends Event {
|
||||
public class PlayerEntityInteractEvent extends Event {
|
||||
|
||||
private Player player;
|
||||
private Entity entityTarget;
|
||||
private Player.Hand hand;
|
||||
|
||||
public PlayerInteractEvent(Player player, Entity entityTarget, Player.Hand hand) {
|
||||
public PlayerEntityInteractEvent(Player player, Entity entityTarget, Player.Hand hand) {
|
||||
this.player = player;
|
||||
this.entityTarget = entityTarget;
|
||||
this.hand = hand;
|
@ -8,7 +8,7 @@ import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called before the player initialization, it can be used to kick the player before any connection
|
||||
* or to change its final username/uuid
|
||||
* or to change his final username/uuid
|
||||
*/
|
||||
public class PlayerPreLoginEvent extends Event {
|
||||
|
||||
|
@ -4,7 +4,7 @@ import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.LivingEntity;
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.entity.EntityAttackEvent;
|
||||
import net.minestom.server.event.player.PlayerInteractEvent;
|
||||
import net.minestom.server.event.player.PlayerEntityInteractEvent;
|
||||
import net.minestom.server.network.packet.client.play.ClientInteractEntityPacket;
|
||||
|
||||
public class UseEntityListener {
|
||||
@ -26,12 +26,12 @@ public class UseEntityListener {
|
||||
EntityAttackEvent entityAttackEvent = new EntityAttackEvent(player, entity);
|
||||
player.callEvent(EntityAttackEvent.class, entityAttackEvent);
|
||||
} else if (type == ClientInteractEntityPacket.Type.INTERACT) {
|
||||
PlayerInteractEvent playerInteractEvent = new PlayerInteractEvent(player, entity, packet.hand);
|
||||
player.callEvent(PlayerInteractEvent.class, playerInteractEvent);
|
||||
PlayerEntityInteractEvent playerEntityInteractEvent = new PlayerEntityInteractEvent(player, entity, packet.hand);
|
||||
player.callEvent(PlayerEntityInteractEvent.class, playerEntityInteractEvent);
|
||||
} else {
|
||||
// TODO find difference with INTERACT
|
||||
PlayerInteractEvent playerInteractEvent = new PlayerInteractEvent(player, entity, packet.hand);
|
||||
player.callEvent(PlayerInteractEvent.class, playerInteractEvent);
|
||||
PlayerEntityInteractEvent playerEntityInteractEvent = new PlayerEntityInteractEvent(player, entity, packet.hand);
|
||||
player.callEvent(PlayerEntityInteractEvent.class, playerEntityInteractEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user