From 2004ff214a629f608a54da2bba445791d25df2c8 Mon Sep 17 00:00:00 2001 From: Jake Date: Tue, 23 Nov 2021 18:05:49 -0800 Subject: [PATCH] more work --- .../api/0175-Add-GS4-Query-event.patch | 0 .../api/0176-Add-PlayerPostRespawnEvent.patch | 0 .../0177-Entity-getEntitySpawnReason.patch} | 2 +- .../0314-Entity-getEntitySpawnReason.patch} | 22 +++++++++---------- ...ty-Metadata-for-all-tracked-players.patch} | 8 +++---- .../0316-Fire-event-on-GS4-query.patch} | 0 ...17-Implement-PlayerPostRespawnEvent.patch} | 8 +++---- 7 files changed, 20 insertions(+), 20 deletions(-) rename patches/{unapplied => }/api/0175-Add-GS4-Query-event.patch (100%) rename patches/{unapplied => }/api/0176-Add-PlayerPostRespawnEvent.patch (100%) rename patches/{unapplied/api/0174-Entity-getEntitySpawnReason.patch => api/0177-Entity-getEntitySpawnReason.patch} (91%) rename patches/{unapplied/server/0316-Entity-getEntitySpawnReason.patch => server/0314-Entity-getEntitySpawnReason.patch} (85%) rename patches/{unapplied/server/0317-Update-entity-Metadata-for-all-tracked-players.patch => server/0315-Update-entity-Metadata-for-all-tracked-players.patch} (89%) rename patches/{unapplied/server/0318-Fire-event-on-GS4-query.patch => server/0316-Fire-event-on-GS4-query.patch} (100%) rename patches/{unapplied/server/0319-Implement-PlayerPostRespawnEvent.patch => server/0317-Implement-PlayerPostRespawnEvent.patch} (86%) diff --git a/patches/unapplied/api/0175-Add-GS4-Query-event.patch b/patches/api/0175-Add-GS4-Query-event.patch similarity index 100% rename from patches/unapplied/api/0175-Add-GS4-Query-event.patch rename to patches/api/0175-Add-GS4-Query-event.patch diff --git a/patches/unapplied/api/0176-Add-PlayerPostRespawnEvent.patch b/patches/api/0176-Add-PlayerPostRespawnEvent.patch similarity index 100% rename from patches/unapplied/api/0176-Add-PlayerPostRespawnEvent.patch rename to patches/api/0176-Add-PlayerPostRespawnEvent.patch diff --git a/patches/unapplied/api/0174-Entity-getEntitySpawnReason.patch b/patches/api/0177-Entity-getEntitySpawnReason.patch similarity index 91% rename from patches/unapplied/api/0174-Entity-getEntitySpawnReason.patch rename to patches/api/0177-Entity-getEntitySpawnReason.patch index dbe7998a9..b0a28ba83 100644 --- a/patches/unapplied/api/0174-Entity-getEntitySpawnReason.patch +++ b/patches/api/0177-Entity-getEntitySpawnReason.patch @@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 0207348eda9a5fcd3814e368a1bc61ae451a1aff..3bb7154a5be37e1943e4f94b5496019c07ca6937 100644 +index 23a3bf005a21cd417f9b2d8ecd64c2887d1e979e..4ed3486e8ef097837cf6762b618e08fa9ff166a5 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -719,5 +719,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/patches/unapplied/server/0316-Entity-getEntitySpawnReason.patch b/patches/server/0314-Entity-getEntitySpawnReason.patch similarity index 85% rename from patches/unapplied/server/0316-Entity-getEntitySpawnReason.patch rename to patches/server/0314-Entity-getEntitySpawnReason.patch index 091e61f26..3bde58a4a 100644 --- a/patches/unapplied/server/0316-Entity-getEntitySpawnReason.patch +++ b/patches/server/0314-Entity-getEntitySpawnReason.patch @@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5be5f95fe01e0132f9d4477149ba022351d8b2be..891633981124a5b864af0f9bd50f11e48da2835d 100644 +index 93751b6df3c8eab6445262e98296eaaa2a65e1b3..d5d72c70d4e414f618d7a6478843deec82f2386a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1162,6 +1162,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1183,6 +1183,7 @@ public class ServerLevel extends Level implements WorldGenLevel { return true; } // Paper end @@ -22,20 +22,20 @@ index 5be5f95fe01e0132f9d4477149ba022351d8b2be..891633981124a5b864af0f9bd50f11e4 // Paper start if (DEBUG_ENTITIES) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index bc73d5052611dba90c2d9c86854447be6a31fdac..d63977984ebec1b4c32bcd2626bdddc15f9e078a 100644 +index 601eb789e19efe4a2fa697c0b5e7c28b245f0990..de713d1c41642ff6d9e992981252c91f23fb19b6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -343,7 +343,7 @@ public abstract class PlayerList { +@@ -342,7 +342,7 @@ public abstract class PlayerList { // CraftBukkit start ServerLevel finalWorldServer = worldserver1; Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> { - return !finalWorldServer.addWithUUID(entity1) ? null : entity1; -+ return !finalWorldServer.addEntitySerialized(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // Paper ++ return !finalWorldServer.addWithUUID(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // Paper // CraftBukkit end }); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3c7e75b8fc1bfbe08e232fcba412c83f4aba274c..8e30a0d42d422fea6bda77d16d5eae8bab01224d 100644 +index a1744b820a49cd4195b0e9ced960dc6bd2d58d45..d9feae255354f5577b5fa2b202f33bbc7e645867 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -67,6 +67,8 @@ import net.minecraft.world.InteractionHand; @@ -47,7 +47,7 @@ index 3c7e75b8fc1bfbe08e232fcba412c83f4aba274c..8e30a0d42d422fea6bda77d16d5eae8b import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.vehicle.Boat; -@@ -166,6 +168,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -166,6 +168,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } } }; @@ -55,7 +55,7 @@ index 3c7e75b8fc1bfbe08e232fcba412c83f4aba274c..8e30a0d42d422fea6bda77d16d5eae8b // Paper end public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper -@@ -1871,6 +1874,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -1900,6 +1903,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -65,7 +65,7 @@ index 3c7e75b8fc1bfbe08e232fcba412c83f4aba274c..8e30a0d42d422fea6bda77d16d5eae8b // Save entity's from mob spawner status if (spawnedViaMobSpawner) { nbt.putBoolean("Paper.FromMobSpawner", true); -@@ -2016,6 +2022,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -2045,6 +2051,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status @@ -93,10 +93,10 @@ index 3c7e75b8fc1bfbe08e232fcba412c83f4aba274c..8e30a0d42d422fea6bda77d16d5eae8b } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 8c266bd81b9350b056067d83415bf2b581e19c94..f2c69ce7a33ef69c71e218cdb2f6a429c5e7b531 100644 +index 36d1bdef298cecd84fdaa400f414f2798a9a49bb..66ce7d852cf7a6070c29402c80700b2b31d08832 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -189,6 +189,7 @@ public abstract class BaseSpawner { +@@ -179,6 +179,7 @@ public abstract class BaseSpawner { // Spigot End } entity.spawnedViaMobSpawner = true; // Paper diff --git a/patches/unapplied/server/0317-Update-entity-Metadata-for-all-tracked-players.patch b/patches/server/0315-Update-entity-Metadata-for-all-tracked-players.patch similarity index 89% rename from patches/unapplied/server/0317-Update-entity-Metadata-for-all-tracked-players.patch rename to patches/server/0315-Update-entity-Metadata-for-all-tracked-players.patch index 6b2699267..4b2584d8d 100644 --- a/patches/unapplied/server/0317-Update-entity-Metadata-for-all-tracked-players.patch +++ b/patches/server/0315-Update-entity-Metadata-for-all-tracked-players.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Update entity Metadata for all tracked players diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index f835ef1c7109f56f32da394c9afc9fd35b05b51a..58cae4202e61cded7d5dfa9652bbfb9735927f7e 100644 +index 3d27cbf5e9105def2f38525a85da5acf8ebf8fe9..ceba19ea3bb9664899b83f82f28af06476b7ff56 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -392,6 +392,12 @@ public class ServerEntity { +@@ -391,6 +391,12 @@ public class ServerEntity { return ClientboundMoveEntityPacket.packetToEntity(this.xp, this.yp, this.zp); } @@ -22,10 +22,10 @@ index f835ef1c7109f56f32da394c9afc9fd35b05b51a..58cae4202e61cded7d5dfa9652bbfb97 this.broadcast.accept(packet); if (this.entity instanceof ServerPlayer) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d24d42ef0a00b9420700e58f555f8448f8d01747..fafb0052efb2942955d3964967f203413cb09574 100644 +index 5d0836c8bc38e3d29f47359b273c58330805b396..d27bc3d8433c0692019c0eb968c857d95a9558f0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2268,7 +2268,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2286,7 +2286,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) { // Refresh the current entity metadata diff --git a/patches/unapplied/server/0318-Fire-event-on-GS4-query.patch b/patches/server/0316-Fire-event-on-GS4-query.patch similarity index 100% rename from patches/unapplied/server/0318-Fire-event-on-GS4-query.patch rename to patches/server/0316-Fire-event-on-GS4-query.patch diff --git a/patches/unapplied/server/0319-Implement-PlayerPostRespawnEvent.patch b/patches/server/0317-Implement-PlayerPostRespawnEvent.patch similarity index 86% rename from patches/unapplied/server/0319-Implement-PlayerPostRespawnEvent.patch rename to patches/server/0317-Implement-PlayerPostRespawnEvent.patch index 1706ae51a..4cbc4df7e 100644 --- a/patches/unapplied/server/0319-Implement-PlayerPostRespawnEvent.patch +++ b/patches/server/0317-Implement-PlayerPostRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d63977984ebec1b4c32bcd2626bdddc15f9e078a..48db62566539734c9c6a6ef5da3fe1bde9841272 100644 +index de713d1c41642ff6d9e992981252c91f23fb19b6..2278153bd4113933a106f60f76a1d342684c272e 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -723,9 +723,14 @@ public abstract class PlayerList { +@@ -722,9 +722,14 @@ public abstract class PlayerList { boolean flag2 = false; @@ -24,7 +24,7 @@ index d63977984ebec1b4c32bcd2626bdddc15f9e078a..48db62566539734c9c6a6ef5da3fe1bd ServerLevel worldserver1 = this.server.getLevel(entityplayer.getRespawnDimension()); if (worldserver1 != null) { Optional optional; -@@ -777,6 +782,7 @@ public abstract class PlayerList { +@@ -776,6 +781,7 @@ public abstract class PlayerList { location = respawnEvent.getRespawnLocation(); if (!flag) entityplayer.reset(); // SPIGOT-4785 @@ -32,7 +32,7 @@ index d63977984ebec1b4c32bcd2626bdddc15f9e078a..48db62566539734c9c6a6ef5da3fe1bd } else { location.setWorld(worldserver.getWorld()); } -@@ -834,6 +840,13 @@ public abstract class PlayerList { +@@ -833,6 +839,13 @@ public abstract class PlayerList { if (entityplayer.connection.isDisconnected()) { this.save(entityplayer); }