SPIGOT-7435: Add TeleportCause#EXIT_BED

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2023-07-29 09:58:01 +10:00
parent 223ea107d2
commit 86a10c9c2c

View File

@ -667,7 +667,7 @@
}
@Override
@@ -989,6 +1303,24 @@
@@ -989,13 +1303,31 @@
@Override
public void stopSleepInBed(boolean flag, boolean flag1) {
@ -692,6 +692,14 @@
if (this.isSleeping()) {
this.serverLevel().getChunkSource().broadcastAndSend(this, new PacketPlayOutAnimation(this, 2));
}
super.stopSleepInBed(flag, flag1);
if (this.connection != null) {
- this.connection.teleport(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
+ this.connection.teleport(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot(), TeleportCause.EXIT_BED); // CraftBukkit
}
}
@@ -1037,8 +1369,9 @@
this.connection.send(new PacketPlayOutOpenSignEditor(tileentitysign.getBlockPos(), flag));
}