From 96d5854b5348b7796788b5a81154ebaf17a61291 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 26 Nov 2021 10:13:36 +1100 Subject: [PATCH] #960: Add Player#showDemoScreen By: coll1234567 --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 4c1b999a53..bfd83a0483 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -45,6 +45,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutCustomPayload; import net.minecraft.network.protocol.game.PacketPlayOutCustomSoundEffect; import net.minecraft.network.protocol.game.PacketPlayOutEntityEquipment; import net.minecraft.network.protocol.game.PacketPlayOutExperience; +import net.minecraft.network.protocol.game.PacketPlayOutGameStateChange; import net.minecraft.network.protocol.game.PacketPlayOutMap; import net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect; import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo; @@ -1721,6 +1722,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getInventory().setItemInMainHand(hand); } + @Override + public void showDemoScreen() { + if (getHandle().connection == null) return; + + getHandle().connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.DEMO_EVENT, PacketPlayOutGameStateChange.DEMO_PARAM_INTRO)); + } + @Override public boolean isAllowingServerListings() { return getHandle().allowsListing();