Skip to content

Commit 6b00f11

Browse files
committed
add Player#showCreditScreen
1 parent 2934d19 commit 6b00f11

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: granny <granny@pl3x.net>
3+
Date: Fri, 26 Aug 2022 21:45:01 -0700
4+
Subject: [PATCH] add Player#showCreditScreen
5+
6+
7+
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
8+
index 5e06858d68f725508e0055de3f5d8c0f6a56601b..8ab346562c23ff2c14727408e61e75e324885e67 100644
9+
--- a/src/main/java/org/bukkit/entity/Player.java
10+
+++ b/src/main/java/org/bukkit/entity/Player.java
11+
@@ -2375,6 +2375,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
12+
*/
13+
public void showDemoScreen();
14+
15+
+ /**
16+
+ * Shows the credits to the player, this screen is normally only seen after
17+
+ * going into the end portal for the first time.
18+
+ * <br>
19+
+ * Servers can modify the text on this screen using a resource pack.
20+
+ */
21+
+ public void showCreditScreen();
22+
+
23+
/**
24+
* Gets whether the player has the "Allow Server Listings" setting enabled.
25+
*
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: granny <granny@pl3x.net>
3+
Date: Fri, 26 Aug 2022 21:45:00 -0700
4+
Subject: [PATCH] add Player#showCreditScreen
5+
6+
7+
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
8+
index 284624683d0e593bc7996fa90a6eee2b6a22ad9e..9fbac26b30f89b94f1ac686fce14c7d1c78d7043 100644
9+
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
10+
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
11+
@@ -2610,6 +2610,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
12+
this.getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.DEMO_EVENT, ClientboundGameEventPacket.DEMO_PARAM_INTRO));
13+
}
14+
15+
+ @Override
16+
+ public void showCreditScreen() {
17+
+ if (this.getHandle().connection == null) return;
18+
+
19+
+ this.getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, 1F));
20+
+ }
21+
+
22+
@Override
23+
public boolean isAllowingServerListings() {
24+
return this.getHandle().allowsListing();

0 commit comments

Comments
 (0)