mirror of
https://github.com/Minestom/Minestom.git
synced 2024-07-01 00:44:55 +02:00
Remove cast and instanceof check from Viewable#sendPacketToViewersAndSelf
This commit is contained in:
parent
7bd9283e17
commit
845f41b88a
|
@ -80,9 +80,6 @@ public interface Viewable {
|
|||
* @param packet the packet to send
|
||||
*/
|
||||
default void sendPacketToViewersAndSelf(@NotNull ServerPacket packet) {
|
||||
if (this instanceof Player) {
|
||||
((Player) this).getPlayerConnection().sendPacket(packet);
|
||||
}
|
||||
sendPacketToViewers(packet);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -654,6 +654,12 @@ public class Player extends LivingEntity implements CommandSender {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketToViewersAndSelf(@NotNull ServerPacket packet) {
|
||||
this.playerConnection.sendPacket(packet);
|
||||
super.sendPacketToViewersAndSelf(packet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the player instance and load surrounding chunks if needed.
|
||||
* <p>
|
||||
|
|
Loading…
Reference in New Issue
Block a user