From 84b54438c1724ab3376263aea1e07285bb4b911e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 20 Mar 2016 22:38:31 -0500 Subject: [PATCH] Only mark player as invulnerable if they're actually changing worlds Fixes GH-96 --- ...-as-invulnerable-if-they-re-changing.patch | 43 +++++++++++++++++++ ...-as-invulnerable-if-they-re-going-to.patch | 23 ---------- 2 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-changing.patch delete mode 100644 Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-going-to.patch diff --git a/Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-changing.patch b/Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-changing.patch new file mode 100644 index 0000000000..86a3672275 --- /dev/null +++ b/Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-changing.patch @@ -0,0 +1,43 @@ +From aa0e7b4e75714e38c4ed7576eef5fb1b2ca1f101 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sun, 20 Mar 2016 19:40:51 -0500 +Subject: [PATCH] Only mark player as invulnerable if they're changing worlds + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index 3902d4f..2c497c6 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -48,7 +48,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private boolean cg = true; + private long ch = System.currentTimeMillis(); + private Entity ci = null; +- private boolean cj; ++ protected boolean cj; // Paper - private -> protected + private int containerCounter; + public boolean f; + public int ping; +@@ -541,7 +541,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + public Entity c(int i) { +- this.cj = true; ++ //this.cj = true; // Paper - Moved to PlayerList#changeDimension + if (this.dimension == 1 && i == 1) { + this.world.kill(this); + if (!this.viewingCredits) { +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index 344abbb..c6bad9e 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -724,6 +724,7 @@ public abstract class PlayerList { + Location exit = null; + boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END + if (exitWorld != null) { ++ entityplayer.cj = true; // Paper - Set teleport invulnerability only if they're actually changing worlds + if ((cause == TeleportCause.END_PORTAL) && (i == 0)) { + // THE_END -> NORMAL; use bed if available, otherwise default spawn + exit = ((org.bukkit.craftbukkit.entity.CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation(); +-- +2.7.4.windows.1 + diff --git a/Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-going-to.patch b/Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-going-to.patch deleted file mode 100644 index 5cc2e70ded..0000000000 --- a/Spigot-Server-Patches/0098-Only-mark-player-as-invulnerable-if-they-re-going-to.patch +++ /dev/null @@ -1,23 +0,0 @@ -From cef1edae317b21e3ec2951347ce9f755c87273fa Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sun, 20 Mar 2016 19:40:51 -0500 -Subject: [PATCH] Only mark player as invulnerable if they're going to the end - - -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3902d4f..9c72cec 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -541,8 +541,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - } - - public Entity c(int i) { -- this.cj = true; - if (this.dimension == 1 && i == 1) { -+ this.cj = true; // Paper - Moved down, only mark entity as invulnerable if they're going into the end - this.world.kill(this); - if (!this.viewingCredits) { - this.viewingCredits = true; --- -2.7.2.windows.1 -