From 86213ac1d267fb0c66c14e64a149efd6521b6340 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 12 Jun 2021 09:30:37 +0200 Subject: [PATCH] fix profile cache mappings let me be OP god dammit! --- build-data/mappings-patch.tiny | 5 +++++ .../server/Add-setting-for-proxy-online-mode-status.patch | 2 +- patches/server/Optimize-UserCache-Thread-Safe.patch | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build-data/mappings-patch.tiny b/build-data/mappings-patch.tiny index 572cb1137b..b15b9e635c 100644 --- a/build-data/mappings-patch.tiny +++ b/build-data/mappings-patch.tiny @@ -78,3 +78,8 @@ c net/minecraft/world/entity/projectile/EntityTippedArrow net/minecraft/world/en # missed mapping? c net/minecraft/world/level/block/MultifaceBlock net/minecraft/world/level/block/MultifaceBlock m (Lnet/minecraft/world/level/block/state/IBlockData;Lnet/minecraft/world/level/IBlockAccess;Lnet/minecraft/core/BlockPosition;Lnet/minecraft/core/EnumDirection;)Lnet/minecraft/world/level/block/state/IBlockData; c getStateForPlacement + +# another missed one +c net/minecraft/server/players/UserCache net/minecraft/server/players/GameProfileCache + m (Ljava/lang/String;)Lcom/mojang/authlib/GameProfile; getProfile get + p 0 name diff --git a/patches/server/Add-setting-for-proxy-online-mode-status.patch b/patches/server/Add-setting-for-proxy-online-mode-status.patch index dadae2b50c..bd3134d0b0 100644 --- a/patches/server/Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/Add-setting-for-proxy-online-mode-status.patch @@ -77,5 +77,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) + if ( this.getOnlineMode() || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting { - profile = this.console.getProfileCache().getProfile( name ); + profile = this.console.getProfileCache().get( name ); } diff --git a/patches/server/Optimize-UserCache-Thread-Safe.patch b/patches/server/Optimize-UserCache-Thread-Safe.patch index 2dfceb8ae8..a5d1e16a9e 100644 --- a/patches/server/Optimize-UserCache-Thread-Safe.patch +++ b/patches/server/Optimize-UserCache-Thread-Safe.patch @@ -63,9 +63,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Nullable -- public GameProfile getProfile(String s) { -+ public synchronized GameProfile getProfile(String s) { // Paper - synchronize - String s1 = s.toLowerCase(Locale.ROOT); +- public GameProfile get(String name) { ++ public synchronized GameProfile get(String name) { // Paper - synchronize + String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); boolean flag = false; @@ -0,0 +0,0 @@ public class GameProfileCache {