mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
Added PlayerInteractEntityEvent which fires when a player right clicks an entity. Thanks fullwall!
This commit is contained in:
parent
fdb077e814
commit
bf1f5b00d7
1 changed files with 7 additions and 0 deletions
|
@ -798,6 +798,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||
|
||||
if (entity != null && this.player.e(entity) && this.player.f(entity) < 4.0F) {
|
||||
if (packet7useentity.c == 0) {
|
||||
// CraftBukkit start
|
||||
PlayerInteractEntityEvent piee = new PlayerInteractEntityEvent((Player) getPlayer(), entity.getBukkitEntity());
|
||||
server.getPluginManager().callEvent(piee);
|
||||
if (piee.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.player.c(entity);
|
||||
} else if (packet7useentity.c == 1) {
|
||||
this.player.d(entity);
|
||||
|
|
Loading…
Reference in a new issue