mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-23 08:31:26 +01:00
Merge pull request #184 from kezz/viewable-defaults
Simplify Viewable packet sending
This commit is contained in:
commit
1b162c1139
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -618,6 +618,12 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
return true;
|
||||
}
|
||||
|
||||
@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