From 3f9d7f7770c2c700ef1cc2e9568cfb253996eff8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 30 Jul 2018 13:25:02 +1000 Subject: [PATCH] Move persist flag check --- nms-patches/Entity.patch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 152ca8613c..9ca5dbeb2e 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -289,15 +289,16 @@ this.world = world; } -@@ -1311,13 +1499,25 @@ - } +@@ -1301,7 +1489,7 @@ + public boolean c(NBTTagCompound nbttagcompound) { + String s = this.getSaveID(); - public boolean d(NBTTagCompound nbttagcompound) { -- return this.isPassenger() ? false : this.c(nbttagcompound); -+ return !this.persist || this.isPassenger() ? false : this.c(nbttagcompound); // CraftBukkit - persist flag - } - - public NBTTagCompound save(NBTTagCompound nbttagcompound) { +- if (!this.dead && s != null) { ++ if (this.persist && !this.dead && s != null) { // CraftBukkit - persist flag + nbttagcompound.setString("id", s); + this.save(nbttagcompound); + return true; +@@ -1318,6 +1506,18 @@ try { nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ})); nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));