Try even harder to get an origin world and avoid NPEs (Fixes #5931)
This commit is contained in:
parent
aed4433aca
commit
a9394b8c1a
21 changed files with 69 additions and 62 deletions
|
@ -10,7 +10,7 @@ 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 b60f035394c9c0949e4cc68d895918510e3c67cf..03fde7df39384436e31bf57476feb680a0849030 100644
|
||||
index ab4dba5af019b60cbb82360eae7f6008aafcd38c..cdb19ab7e0d90dcd6885226aa2fd3a58ed53d29b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1111,6 +1111,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
||||
|
@ -35,7 +35,7 @@ index f1e3ea6b023119adc69eb0b414994bc7f9f3ed4a..42b7568d1c3ce145b2816202e6f5c8ca
|
|||
});
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d99c283aa25f2d0f4e8478b257299efd30437d09..b11e5b8082073a28adf7a4fb80372cf2e020c7a8 100644
|
||||
index 3518044845ec400ff6c2ddf7fc7dc32f1f7769b6..16c1b0135cbd466c7e404e2f3ee638c511dc8e37 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;
|
||||
|
@ -55,8 +55,8 @@ index d99c283aa25f2d0f4e8478b257299efd30437d09..b11e5b8082073a28adf7a4fb80372cf2
|
|||
// Paper end
|
||||
|
||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||
@@ -1862,6 +1865,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
nbt.putUUID("Paper.OriginWorld", originWorld);
|
||||
@@ -1865,6 +1868,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
}
|
||||
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||
}
|
||||
+ if (spawnReason != null) {
|
||||
|
@ -65,7 +65,7 @@ index d99c283aa25f2d0f4e8478b257299efd30437d09..b11e5b8082073a28adf7a4fb80372cf2
|
|||
// Save entity's from mob spawner status
|
||||
if (spawnedViaMobSpawner) {
|
||||
nbt.putBoolean("Paper.FromMobSpawner", true);
|
||||
@@ -2007,6 +2013,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
@@ -2010,6 +2016,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
}
|
||||
|
||||
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue