Skip to content

Commit 3d0fc67

Browse files
committed
Add ServerPlayer#connectionState
Shortcut instead of having to go thru the polymorphic EngineConnection#state.
1 parent 0e0e6ee commit 3d0fc67

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/spongepowered/api/entity/living/player/server/ServerPlayer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.spongepowered.api.event.Cause;
4848
import org.spongepowered.api.item.inventory.Container;
4949
import org.spongepowered.api.item.inventory.Inventory;
50+
import org.spongepowered.api.network.ServerConnectionState;
5051
import org.spongepowered.api.network.ServerSideConnection;
5152
import org.spongepowered.api.scoreboard.Scoreboard;
5253
import org.spongepowered.api.service.permission.Subject;
@@ -185,6 +186,14 @@ default SetValue.Mutable<SkinPart> displayedSkinParts() {
185186
*/
186187
ServerSideConnection connection();
187188

189+
/**
190+
* Gets the appropriate {@link ServerConnectionState.Game} linking this player to a
191+
* connection state.
192+
*
193+
* @return The connection state
194+
*/
195+
ServerConnectionState.Game connectionState();
196+
188197
/**
189198
* Gets this player's {@link TabList}.
190199
*

0 commit comments

Comments
 (0)