#960: Add Player#showDemoScreen

By: coll1234567 <joshl5324@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2021-11-26 10:13:36 +11:00
parent ffdf8aeecf
commit 96d5854b53

View file

@ -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();