summaryrefslogtreecommitdiffhomepage
path: root/patches/api/0091-Add-legacy-ping-support-to-PaperServerListPingEvent.patch
blob: 96ed5420a29f77de89a22bc965ad89256e404f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 19:30:20 +0200
Subject: [PATCH] Add legacy ping support to PaperServerListPingEvent

Add a new method to StatusClient check if the client is a legacy
client that does not support all of the features provided in the
event.

diff --git a/src/main/java/com/destroystokyo/paper/network/StatusClient.java b/src/main/java/com/destroystokyo/paper/network/StatusClient.java
index 517d15238ed117f38bbd39f570874014cecf7bb5..a8437bbd80b3a20772352a3b1797990ea13806ad 100644
--- a/src/main/java/com/destroystokyo/paper/network/StatusClient.java
+++ b/src/main/java/com/destroystokyo/paper/network/StatusClient.java
@@ -10,4 +10,16 @@ import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
  */
 public interface StatusClient extends NetworkClient {
 
+    /**
+     * Returns whether the client is using an older version that doesn't
+     * support all the features in {@link PaperServerListPingEvent}.
+     *
+     * <p>For Vanilla, this returns {@code true} for all clients older than 1.7.</p>
+     *
+     * @return {@code true} if the client is using legacy ping
+     */
+    default boolean isLegacy() {
+        return false;
+    }
+
 }