Rebuild patches

Cos, you know, pushing the correct changes the first time woulda been
overrated
This commit is contained in:
Shane Freeder 2022-02-01 13:06:41 +00:00
parent f79c0daece
commit 2121aed33d
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -26,7 +26,7 @@ index 00ef714294b6cce5fec7613eed4ba228a48e3e11..67b300574655854249c1f7440f56a6e8
uniqueId = gameProfile.getId();
// Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53f10dcae0 100644
index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..096bd762a7e52230118f14bc839a87ecf437837c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -72,6 +72,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
@ -37,7 +37,7 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.saveddata.maps.MapDecoration;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
@@ -1382,8 +1383,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1382,8 +1383,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.hiddenEntities.put(entity.getUniqueId(), hidingPlugins);
// Remove this entity from the hidden player's EntityTrackerEntry
@ -45,6 +45,8 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
+ // Paper start
Entity other = ((CraftEntity) entity).getHandle();
+ unregisterEntity(other);
+
+ server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity));
+ }
+ private void unregisterEntity(Entity other) {
+ // Paper end
@ -52,7 +54,16 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) {
entry.removePlayer(this.getHandle());
@@ -1434,8 +1440,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1396,8 +1404,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, otherPlayer));
}
}
-
- server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity));
}
@Override
@@ -1434,8 +1440,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
this.hiddenEntities.remove(entity.getUniqueId());
@ -60,6 +71,8 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
+ // Paper start
Entity other = ((CraftEntity) entity).getHandle();
+ registerEntity(other);
+
+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ }
+ private void registerEntity(Entity other) {
+ ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
@ -67,10 +80,11 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
if (other instanceof ServerPlayer) {
ServerPlayer otherPlayer = (ServerPlayer) other;
@@ -1449,6 +1460,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
}
@@ -1446,9 +1459,51 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
entry.updatePlayer(this.getHandle());
}
+ }
+ // Paper start
+ private void reregisterPlayer(ServerPlayer player) {
+ if (!hiddenEntities.containsKey(player.getUUID())) {
@ -93,7 +107,8 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone();
+ }
+
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ private void refreshPlayer() {
+ ServerPlayer handle = getHandle();
+
@ -113,7 +128,7 @@ index 45914c7cf1ae300c47a43b23bcf868bbb96d911b..5f86cddc176b6205768653a901825e53
+ this.setOp(false);
+ this.setOp(true);
+ }
+ }
}
+ // Paper end
public void onEntityRemove(Entity entity) {