SPIGOT-7435: Add TeleportCause#EXIT_BED

This commit is contained in:
md_5 2023-07-29 09:58:01 +10:00
parent b435e8e8d3
commit f7fa6d9935
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

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));
}