more work

This commit is contained in:
Jake 2021-11-23 18:05:49 -08:00 committed by MiniDigger | Martin
parent 753267a57e
commit 2004ff214a
7 changed files with 20 additions and 20 deletions

View file

@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored. 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 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 --- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/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 @@ -719,5 +719,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent

View file

@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored. 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 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 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/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; return true;
} }
// Paper end // Paper end
@ -22,20 +22,20 @@ index 5be5f95fe01e0132f9d4477149ba022351d8b2be..891633981124a5b864af0f9bd50f11e4
// Paper start // Paper start
if (DEBUG_ENTITIES) { 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 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 --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/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 // CraftBukkit start
ServerLevel finalWorldServer = worldserver1; ServerLevel finalWorldServer = worldserver1;
Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> { Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> {
- return !finalWorldServer.addWithUUID(entity1) ? null : 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 // CraftBukkit end
}); });
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java 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 --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/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; @@ -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.item.ItemEntity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.Boat; 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 // Paper end
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper 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())); 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 // Save entity's from mob spawner status
if (spawnedViaMobSpawner) { if (spawnedViaMobSpawner) {
nbt.putBoolean("Paper.FromMobSpawner", true); 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 spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
@ -93,10 +93,10 @@ index 3c7e75b8fc1bfbe08e232fcba412c83f4aba274c..8e30a0d42d422fea6bda77d16d5eae8b
} catch (Throwable throwable) { } 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 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 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/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 // Spigot End
} }
entity.spawnedViaMobSpawner = true; // Paper entity.spawnedViaMobSpawner = true; // Paper

View file

@ -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 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 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/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); return ClientboundMoveEntityPacket.packetToEntity(this.xp, this.yp, this.zp);
} }
@ -22,10 +22,10 @@ index f835ef1c7109f56f32da394c9afc9fd35b05b51a..58cae4202e61cded7d5dfa9652bbfb97
this.broadcast.accept(packet); this.broadcast.accept(packet);
if (this.entity instanceof ServerPlayer) { 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 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 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/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) { if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) {
// Refresh the current entity metadata // Refresh the current entity metadata

View file

@ -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 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 --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/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; boolean flag2 = false;
@ -24,7 +24,7 @@ index d63977984ebec1b4c32bcd2626bdddc15f9e078a..48db62566539734c9c6a6ef5da3fe1bd
ServerLevel worldserver1 = this.server.getLevel(entityplayer.getRespawnDimension()); ServerLevel worldserver1 = this.server.getLevel(entityplayer.getRespawnDimension());
if (worldserver1 != null) { if (worldserver1 != null) {
Optional optional; Optional optional;
@@ -777,6 +782,7 @@ public abstract class PlayerList { @@ -776,6 +781,7 @@ public abstract class PlayerList {
location = respawnEvent.getRespawnLocation(); location = respawnEvent.getRespawnLocation();
if (!flag) entityplayer.reset(); // SPIGOT-4785 if (!flag) entityplayer.reset(); // SPIGOT-4785
@ -32,7 +32,7 @@ index d63977984ebec1b4c32bcd2626bdddc15f9e078a..48db62566539734c9c6a6ef5da3fe1bd
} else { } else {
location.setWorld(worldserver.getWorld()); location.setWorld(worldserver.getWorld());
} }
@@ -834,6 +840,13 @@ public abstract class PlayerList { @@ -833,6 +839,13 @@ public abstract class PlayerList {
if (entityplayer.connection.isDisconnected()) { if (entityplayer.connection.isDisconnected()) {
this.save(entityplayer); this.save(entityplayer);
} }