Yatopia/patches/server/0004-Add-GameProfileLookupEvent.patch
Simon Gardling 76a75f866b
upstream (#455)
* Updated Upstream and Sidestream(s) (Paper)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
d15161114 [Auto] Updated Upstream (Spigot)
e8889e96a [Auto] Updated Upstream (CraftBukkit)
3bc888ba6 [Auto] Updated Upstream (CraftBukkit)

* Updated Upstream and Sidestream(s) (Paper)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
3fea87edb [Auto] Updated Upstream (CraftBukkit)
a111b1365 Send post ChatEvent messages as MessageType.CHAT

* Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
3db3aaf39 [Auto] Updated Upstream (CraftBukkit)
c953e51dd [Auto] Updated Upstream (CraftBukkit/Spigot)
dc529c7a9 Fix PlayerEditBookEvent (#5463)

Tuinity Changes:
a0aa5ab Do not load 1 radius neighbours for lighting
5ccfa52 Fix terrible patch times
af53d70 Stop large move vectors in player packet handling from killing the server
6e56ee7 Fix OBFHELPER for flushHeader in RegionFile
995d05c Do not update TE's in generating chunks

Purpur Changes:
2e66f83 [ci-skip] Fix typo
6cbe4fc Change Logo Tuinity to Purpur
5e89d23 Updated Upstream (Paper & Airplane)

* Updated Upstream and Sidestream(s) (Paper)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
304a216ba [CI-SKIP] Ignore gitignore when adding files in automation
d8e384a16 [CI-SKIP] Drop `Allow PlayerEditBookEvent to fire for off hand` (#5471)

* fix kotlin-stdlib dependency

* update dependencies

* how did that happen...

* Updated Upstream and Sidestream(s) (Paper)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
de138fac4 [Auto] Updated Upstream (Bukkit)

* Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
4492bc4cc remove l4j class no longer in existence from preload list
be1370517 Updated Upstream (CraftBukkit) (#5484)
d560151ec Bump mysql-connector-java to 8.0.23 (Fixes #5473) (#5474)
61f400f11 Update log4j to 2.11.2 for JDK 9+ compat (#5400)
a98196585 Updated Upstream (Bukkit/CraftBukkit)

Tuinity Changes:
d5261ad Do not load chunks for getCubes by default
da9cf98 Don't read neighbour chunk data off disk when converting chunks

Airplane Changes:
8de8e82 Updated Upstream (Tuinity)
2021-04-12 13:27:14 -04:00

65 lines
3.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Wed, 5 Aug 2020 14:25:50 -0500
Subject: [PATCH] Add GameProfileLookupEvent
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
index 040fd0c3fc4bc3a04fe5dff919a41fe9b474708e..21d92c3e8e2e953bfc85c1ba3ed54ca0dae751fb 100644
--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -187,13 +187,24 @@ public class CraftPlayerProfile implements PlayerProfile {
boolean isCompleteFromCache = this.completeFromCache(true, onlineMode);
if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) {
- GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true);
- if (result != null) {
- copyProfileProperties(result, this.profile, true);
- }
- if (this.profile.isComplete()) {
- server.getUserCache().saveProfile(this.profile);
+ // Yatopia start
+ dev.tr7zw.yatopia.events.GameProfileLookupEvent event = new
+ dev.tr7zw.yatopia.events.GameProfileLookupEvent(
+ !org.bukkit.Bukkit.isPrimaryThread(), profile.getId(), profile.getName());
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
+ GameProfile eventProfile = event.getGameProfile();
+ if (eventProfile != null) {
+ this.profile = eventProfile;
+ } else {
+ GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true);
+ if (result != null) {
+ copyProfileProperties(result, this.profile, true);
+ }
+ if (this.profile.isComplete()) {
+ server.getUserCache().saveProfile(this.profile);
+ }
}
+ // Yatopia end
}
return profile.isComplete() && (!onlineMode || !textures || hasTextures());
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
index 4f7c014fa609a39cac651ccc6d3397d7edb77d8d..fe9238ecc0f3a4948f5867fcae4fe64c9142a98e 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
@@ -87,7 +87,18 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa
if ( property == null )
{
+ // Yatopia start
+ dev.tr7zw.yatopia.events.GameProfileLookupEvent event =
+ new dev.tr7zw.yatopia.events.GameProfileLookupEvent(
+ !org.bukkit.Bukkit.isPrimaryThread(), profile.getId(), profile.getName());
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
+ GameProfile eventProfile = event.getGameProfile();
+ if (eventProfile != null) {
+ profile = eventProfile;
+ } else {
profile = TileEntitySkull.sessionService.fillProfileProperties( profile, true );
+ }
+ // Yatopia end
}
}