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 f3497a0c5c
commit 729db1bed4

View file

@ -45,6 +45,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
Entity other = ((CraftEntity) entity).getHandle(); Entity other = ((CraftEntity) entity).getHandle();
+ unregisterEntity(other); + unregisterEntity(other);
+
+ server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity));
+ } + }
+ private void unregisterEntity(Entity other) { + private void unregisterEntity(Entity other) {
+ // Paper end + // Paper end
@ -52,6 +54,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) { if (entry != null) {
entry.removePlayer(this.getHandle()); entry.removePlayer(this.getHandle());
@@ -0,0 +0,0 @@ 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
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
this.hiddenEntities.remove(entity.getUniqueId()); this.hiddenEntities.remove(entity.getUniqueId());
@ -60,6 +71,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
Entity other = ((CraftEntity) entity).getHandle(); Entity other = ((CraftEntity) entity).getHandle();
+ registerEntity(other); + registerEntity(other);
+
+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ } + }
+ private void registerEntity(Entity other) { + private void registerEntity(Entity other) {
+ ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap; + ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
@ -68,9 +81,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (other instanceof ServerPlayer) { if (other instanceof ServerPlayer) {
ServerPlayer otherPlayer = (ServerPlayer) other; ServerPlayer otherPlayer = (ServerPlayer) other;
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); entry.updatePlayer(this.getHandle());
} }
+ }
+ // Paper start + // Paper start
+ private void reregisterPlayer(ServerPlayer player) { + private void reregisterPlayer(ServerPlayer player) {
+ if (!hiddenEntities.containsKey(player.getUUID())) { + if (!hiddenEntities.containsKey(player.getUUID())) {
@ -93,7 +107,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { + public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone(); + return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone();
+ } + }
+
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ private void refreshPlayer() { + private void refreshPlayer() {
+ ServerPlayer handle = getHandle(); + ServerPlayer handle = getHandle();
+ +
@ -113,7 +128,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.setOp(false); + this.setOp(false);
+ this.setOp(true); + this.setOp(true);
+ } + }
+ } }
+ // Paper end + // Paper end
public void onEntityRemove(Entity entity) { public void onEntityRemove(Entity entity) {