mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-23 09:27:45 +01:00
Improve Profile API to directly extend Yggdrasil, Resolves #1117
This improves plugins like Citizens that rely on direct instance of Yggdrasil implementations. Instead of wrapping, directly extend and override the methods. Went ahead and wrapped all of the services in prep in the base patch, then features modify what they need
This commit is contained in:
parent
8595189ab6
commit
390f9bb913
@ -1,8 +1,9 @@
|
||||
From 0609cc1f82cd0a16e7d0acf66c5e6cbf9b7f24ac Mon Sep 17 00:00:00 2001
|
||||
From 2fdd15767ecdb067c881c2a93cd8f0a679fefdaa Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 15 Jan 2018 22:11:48 -0500
|
||||
Subject: [PATCH] Basic PlayerProfile API
|
||||
|
||||
Establishes base extension of profile systems for future edits too
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
||||
new file mode 100644
|
||||
@ -291,6 +292,117 @@ index 000000000..9ad5853de
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
|
||||
new file mode 100644
|
||||
index 000000000..25836b975
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
|
||||
@@ -0,0 +1,30 @@
|
||||
+package com.destroystokyo.paper.profile;
|
||||
+
|
||||
+import com.mojang.authlib.Agent;
|
||||
+import com.mojang.authlib.GameProfileRepository;
|
||||
+import com.mojang.authlib.UserAuthentication;
|
||||
+import com.mojang.authlib.minecraft.MinecraftSessionService;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
+
|
||||
+import java.net.Proxy;
|
||||
+
|
||||
+public class PaperAuthenticationService extends YggdrasilAuthenticationService {
|
||||
+ public PaperAuthenticationService(Proxy proxy, String clientToken) {
|
||||
+ super(proxy, clientToken);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public UserAuthentication createUserAuthentication(Agent agent) {
|
||||
+ return new PaperUserAuthentication(this, agent);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MinecraftSessionService createMinecraftSessionService() {
|
||||
+ return new PaperMinecraftSessionService(this);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GameProfileRepository createProfileRepository() {
|
||||
+ return new PaperGameProfileRepository(this);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
|
||||
new file mode 100644
|
||||
index 000000000..3bcdb8f93
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
|
||||
@@ -0,0 +1,17 @@
|
||||
+package com.destroystokyo.paper.profile;
|
||||
+
|
||||
+import com.mojang.authlib.Agent;
|
||||
+import com.mojang.authlib.ProfileLookupCallback;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository;
|
||||
+
|
||||
+public class PaperGameProfileRepository extends YggdrasilGameProfileRepository {
|
||||
+ public PaperGameProfileRepository(YggdrasilAuthenticationService authenticationService) {
|
||||
+ super(authenticationService);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void findProfilesByNames(String[] names, Agent agent, ProfileLookupCallback callback) {
|
||||
+ super.findProfilesByNames(names, agent, callback);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
|
||||
new file mode 100644
|
||||
index 000000000..4b2a67423
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
|
||||
@@ -0,0 +1,29 @@
|
||||
+package com.destroystokyo.paper.profile;
|
||||
+
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
+import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
|
||||
+
|
||||
+import java.util.Map;
|
||||
+
|
||||
+public class PaperMinecraftSessionService extends YggdrasilMinecraftSessionService {
|
||||
+ protected PaperMinecraftSessionService(YggdrasilAuthenticationService authenticationService) {
|
||||
+ super(authenticationService);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getTextures(GameProfile profile, boolean requireSecure) {
|
||||
+ return super.getTextures(profile, requireSecure);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) {
|
||||
+ return super.fillProfileProperties(profile, requireSecure);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected GameProfile fillGameProfile(GameProfile profile, boolean requireSecure) {
|
||||
+ return super.fillGameProfile(profile, requireSecure);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java
|
||||
new file mode 100644
|
||||
index 000000000..3aceb0ea8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java
|
||||
@@ -0,0 +1,11 @@
|
||||
+package com.destroystokyo.paper.profile;
|
||||
+
|
||||
+import com.mojang.authlib.Agent;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
+import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
|
||||
+
|
||||
+public class PaperUserAuthentication extends YggdrasilUserAuthentication {
|
||||
+ public PaperUserAuthentication(YggdrasilAuthenticationService authenticationService, Agent agent) {
|
||||
+ super(authenticationService, agent);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index 02940d697..4539b5601 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@ -317,9 +429,18 @@ index 02940d697..4539b5601 100644
|
||||
* Calculates distance between 2 entities
|
||||
* @param e1
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e8bddc171..3b01ebd96 100644
|
||||
index e8bddc171..fcf6bac08 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1018,7 +1018,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
*/ // CraftBukkit end
|
||||
|
||||
String s1 = "."; // PAIL?
|
||||
- YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString());
|
||||
+ YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); // Paper
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
UserCache usercache = new UserCache(gameprofilerepository, new File(s1, MinecraftServer.a.getName()));
|
||||
@@ -1538,6 +1538,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
this.H = i;
|
||||
}
|
||||
@ -402,5 +523,5 @@ index 77c16fe2c..2dd7ed96a 100644
|
||||
// Paper end
|
||||
}
|
||||
--
|
||||
2.16.2
|
||||
2.17.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From bc59867ea93608a0e6e541d286b76d8579ab3df7 Mon Sep 17 00:00:00 2001
|
||||
From fc959e2e4dd778595b3aa4e546534a83c9e8cf18 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 17 Jun 2017 17:00:32 -0400
|
||||
Subject: [PATCH] Profile Lookup Events
|
||||
@ -6,35 +6,33 @@ Subject: [PATCH] Profile Lookup Events
|
||||
Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in profile data, and cache the responses from
|
||||
profiles that had to be looked up.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/WrappedGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/WrappedGameProfileRepository.java
|
||||
new file mode 100644
|
||||
index 00000000..bffba6a6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/WrappedGameProfileRepository.java
|
||||
@@ -0,0 +1,70 @@
|
||||
+package com.destroystokyo.paper.profile;
|
||||
+
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
|
||||
index 3bcdb8f93..bb9894318 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
|
||||
@@ -1,17 +1,68 @@
|
||||
package com.destroystokyo.paper.profile;
|
||||
|
||||
+import com.destroystokyo.paper.event.profile.LookupProfileEvent;
|
||||
+import com.destroystokyo.paper.event.profile.PreLookupProfileEvent;
|
||||
+import com.google.common.collect.Sets;
|
||||
+import com.mojang.authlib.Agent;
|
||||
import com.mojang.authlib.Agent;
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
+import com.mojang.authlib.GameProfileRepository;
|
||||
+import com.mojang.authlib.ProfileLookupCallback;
|
||||
+import com.mojang.authlib.properties.Property;
|
||||
+
|
||||
+import javax.annotation.Nonnull;
|
||||
import com.mojang.authlib.ProfileLookupCallback;
|
||||
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
import com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository;
|
||||
|
||||
+import java.util.Set;
|
||||
+
|
||||
+public class WrappedGameProfileRepository implements GameProfileRepository {
|
||||
public class PaperGameProfileRepository extends YggdrasilGameProfileRepository {
|
||||
+
|
||||
+ private final GameProfileRepository orig;
|
||||
+ public WrappedGameProfileRepository(@Nonnull GameProfileRepository orig) {
|
||||
+ this.orig = orig;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void findProfilesByNames(String[] names, Agent agent, ProfileLookupCallback callback) {
|
||||
public PaperGameProfileRepository(YggdrasilAuthenticationService authenticationService) {
|
||||
super(authenticationService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findProfilesByNames(String[] names, Agent agent, ProfileLookupCallback callback) {
|
||||
- super.findProfilesByNames(names, agent, callback);
|
||||
+ Set<String> unfoundNames = Sets.newHashSet();
|
||||
+ for (String name : names) {
|
||||
+ PreLookupProfileEvent event = new PreLookupProfileEvent(name);
|
||||
@ -58,7 +56,7 @@ index 00000000..bffba6a6
|
||||
+ // Some things were not found.... Proceed to look up.
|
||||
+ if (!unfoundNames.isEmpty()) {
|
||||
+ String[] namesArr = unfoundNames.toArray(new String[unfoundNames.size()]);
|
||||
+ orig.findProfilesByNames(namesArr, agent, new PreProfileLookupCallback(callback));
|
||||
+ super.findProfilesByNames(namesArr, agent, new PreProfileLookupCallback(callback));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@ -80,20 +78,8 @@ index 00000000..bffba6a6
|
||||
+ public void onProfileLookupFailed(GameProfile gameProfile, Exception e) {
|
||||
+ callback.onProfileLookupFailed(gameProfile, e);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3b01ebd9..85b9ac98 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1021,6 +1021,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString());
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
+ gameprofilerepository = new com.destroystokyo.paper.profile.WrappedGameProfileRepository(gameprofilerepository); // Paper
|
||||
UserCache usercache = new UserCache(gameprofilerepository, new File(s1, MinecraftServer.a.getName()));
|
||||
final DedicatedServer dedicatedserver = new DedicatedServer(options, DataConverterRegistry.a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache);
|
||||
|
||||
}
|
||||
}
|
||||
--
|
||||
2.14.3
|
||||
2.17.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 00ec1784d8da4298b04ae652324c5ff1df3285aa Mon Sep 17 00:00:00 2001
|
||||
From 778f0a583f0d95f233434b8eef9e7136915455a9 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 2 Jan 2018 00:31:26 -0500
|
||||
Subject: [PATCH] Fill Profile Property Events
|
||||
@ -10,96 +10,33 @@ If Mojang API does need to be hit, event fire so you can get the results.
|
||||
|
||||
This is useful for implementing a ProfileCache for Player Skulls
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/WrappedMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/WrappedMinecraftSessionService.java
|
||||
new file mode 100644
|
||||
index 00000000..9914f98c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/WrappedMinecraftSessionService.java
|
||||
@@ -0,0 +1,71 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining
|
||||
+ * a copy of this software and associated documentation files (the
|
||||
+ * "Software"), to deal in the Software without restriction, including
|
||||
+ * without limitation the rights to use, copy, modify, merge, publish,
|
||||
+ * distribute, sublicense, and/or sell copies of the Software, and to
|
||||
+ * permit persons to whom the Software is furnished to do so, subject to
|
||||
+ * the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+package com.destroystokyo.paper.profile;
|
||||
+
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
|
||||
index 4b2a67423..f83aa5ef0 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.destroystokyo.paper.profile;
|
||||
|
||||
+import com.destroystokyo.paper.event.profile.FillProfileEvent;
|
||||
+import com.destroystokyo.paper.event.profile.PreFillProfileEvent;
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
+import com.mojang.authlib.exceptions.AuthenticationException;
|
||||
+import com.mojang.authlib.exceptions.AuthenticationUnavailableException;
|
||||
+import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||
+import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
+import com.mojang.authlib.minecraft.MinecraftSessionService;
|
||||
+
|
||||
+import java.net.InetAddress;
|
||||
+import java.util.Map;
|
||||
+
|
||||
+public class WrappedMinecraftSessionService implements MinecraftSessionService {
|
||||
+
|
||||
+ private final MinecraftSessionService orig;
|
||||
+
|
||||
+ public WrappedMinecraftSessionService(MinecraftSessionService orig) {
|
||||
+ this.orig = orig;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void joinServer(GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||
+ orig.joinServer(profile, authenticationToken, serverId);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GameProfile hasJoinedServer(GameProfile user, String serverId, InetAddress address) throws AuthenticationUnavailableException {
|
||||
+ return orig.hasJoinedServer(user, serverId, address);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Map<Type, MinecraftProfileTexture> getTextures(GameProfile profile, boolean requireSecure) {
|
||||
+ return orig.getTextures(profile, requireSecure);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) {
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
@@ -19,7 +21,13 @@ public class PaperMinecraftSessionService extends YggdrasilMinecraftSessionServi
|
||||
|
||||
@Override
|
||||
public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) {
|
||||
- return super.fillProfileProperties(profile, requireSecure);
|
||||
+ new PreFillProfileEvent(CraftPlayerProfile.asBukkitMirror(profile)).callEvent();
|
||||
+ if (profile.isComplete() && profile.getProperties().containsKey("textures")) {
|
||||
+ return profile;
|
||||
+ }
|
||||
+ GameProfile gameProfile = orig.fillProfileProperties(profile, requireSecure);
|
||||
+ GameProfile gameProfile = super.fillProfileProperties(profile, requireSecure);
|
||||
+ new FillProfileEvent(CraftPlayerProfile.asBukkitMirror(gameProfile)).callEvent();
|
||||
+ return gameProfile;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 85b9ac98..ed0e2acc 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1019,7 +1019,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
}
|
||||
|
||||
String s1 = "."; // PAIL?
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString());
|
||||
- MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
+ MinecraftSessionService minecraftsessionservice = new com.destroystokyo.paper.profile.WrappedMinecraftSessionService(yggdrasilauthenticationservice.createMinecraftSessionService()); // Paper
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
gameprofilerepository = new com.destroystokyo.paper.profile.WrappedGameProfileRepository(gameprofilerepository); // Paper
|
||||
UserCache usercache = new UserCache(gameprofilerepository, new File(s1, MinecraftServer.a.getName()));
|
||||
@Override
|
||||
--
|
||||
2.14.3
|
||||
2.17.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 79ba50cb7dd573b4448adc4f3f0d7be96995933b Mon Sep 17 00:00:00 2001
|
||||
From 6499c96e7d9c95cf8aa2181bb0558d45aa7f69b0 Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Wed, 11 Oct 2017 15:56:26 +0200
|
||||
Subject: [PATCH] Implement extended PaperServerListPingEvent
|
||||
@ -6,7 +6,7 @@ Subject: [PATCH] Implement extended PaperServerListPingEvent
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/network/PaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/PaperServerListPingEventImpl.java
|
||||
new file mode 100644
|
||||
index 00000000..c1a8e295
|
||||
index 000000000..c1a8e295b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/network/PaperServerListPingEventImpl.java
|
||||
@@ -0,0 +1,31 @@
|
||||
@ -43,7 +43,7 @@ index 00000000..c1a8e295
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/network/PaperStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperStatusClient.java
|
||||
new file mode 100644
|
||||
index 00000000..a2a409e6
|
||||
index 000000000..a2a409e63
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/network/PaperStatusClient.java
|
||||
@@ -0,0 +1,11 @@
|
||||
@ -60,7 +60,7 @@ index 00000000..a2a409e6
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
|
||||
new file mode 100644
|
||||
index 00000000..35041052
|
||||
index 000000000..350410527
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
|
||||
@@ -0,0 +1,112 @@
|
||||
@ -177,7 +177,7 @@ index 00000000..35041052
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 579f0ba0..99cfe1ae 100644
|
||||
index 3092913f5..f82e22b23 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -768,7 +768,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
@ -189,7 +189,7 @@ index 579f0ba0..99cfe1ae 100644
|
||||
int j = MathHelper.nextInt(this.r, 0, this.H() - agameprofile.length);
|
||||
|
||||
for (int k = 0; k < agameprofile.length; ++k) {
|
||||
@@ -1116,10 +1116,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
@@ -1115,10 +1115,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
return "1.12.2";
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ index 579f0ba0..99cfe1ae 100644
|
||||
return this.v.getMaxPlayers();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
index 313bb000..f3c25367 100644
|
||||
index 313bb0007..f3c25367d 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
@@ -30,6 +30,8 @@ public class PacketStatusListener implements PacketStatusInListener {
|
||||
@ -226,7 +226,7 @@ index 313bb000..f3c25367 100644
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java
|
||||
index 98158221..ac161f50 100644
|
||||
index 981582212..ac161f505 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerPing.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerPing.java
|
||||
@@ -29,6 +29,7 @@ public class ServerPing {
|
||||
@ -251,7 +251,7 @@ index 98158221..ac161f50 100644
|
||||
this.c = agameprofile;
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index cc1f3ac9..4f9fd4bc 100644
|
||||
index cc1f3ac96..4f9fd4bc6 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@@ -281,7 +281,7 @@ public class SpigotConfig
|
||||
@ -264,5 +264,5 @@ index cc1f3ac9..4f9fd4bc 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.14.3
|
||||
2.17.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user