mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 11:05:13 +01:00
#1000: Add PlayerHideEntityEvent and PlayerShowEntityEvent
By: Gero <gecam59@gmail.com>
This commit is contained in:
parent
e2b1313f00
commit
df76a31fc1
1 changed files with 6 additions and 0 deletions
|
@ -126,7 +126,9 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.player.PlayerHideEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerRegisterChannelEvent;
|
import org.bukkit.event.player.PlayerRegisterChannelEvent;
|
||||||
|
import org.bukkit.event.player.PlayerShowEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.event.player.PlayerUnregisterChannelEvent;
|
import org.bukkit.event.player.PlayerUnregisterChannelEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
|
@ -1126,6 +1128,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
getHandle().connection.send(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, otherPlayer));
|
getHandle().connection.send(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, otherPlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1174,6 +1178,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
if (entry != null && !entry.seenBy.contains(getHandle().connection)) {
|
if (entry != null && !entry.seenBy.contains(getHandle().connection)) {
|
||||||
entry.updatePlayer(getHandle());
|
entry.updatePlayer(getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEntityRemove(Entity entity) {
|
public void onEntityRemove(Entity entity) {
|
||||||
|
|
Loading…
Reference in a new issue