From 712213daccc731620ae5651bec7fd48ffe201a25 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 22 Mar 2016 12:39:41 -0500 Subject: Fix player dimension change invulnerability never getting unset when certain dimensions are disabled --- nms-patches/PlayerList.patch | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'nms-patches/PlayerList.patch') diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch index 80e7bd83..b872d95c 100644 --- a/nms-patches/PlayerList.patch +++ b/nms-patches/PlayerList.patch @@ -391,7 +391,7 @@ entityplayer1.playerConnection = entityplayer.playerConnection; entityplayer1.copyTo(entityplayer, flag); -@@ -414,43 +577,155 @@ +@@ -414,43 +577,156 @@ entityplayer1.a(s); } @@ -520,6 +520,7 @@ + Location exit = null; + boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END + if (exitWorld != null) { ++ entityplayer.cj = true; // CraftBukkit - Set teleport invulnerability only if player 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(); @@ -565,7 +566,7 @@ public void f(EntityPlayer entityplayer) { GameProfile gameprofile = entityplayer.getProfile(); int i = this.isOp(gameprofile) ? this.operators.a(gameprofile) : 0; -@@ -489,12 +764,111 @@ +@@ -489,12 +765,111 @@ } public void changeWorld(Entity entity, int i, WorldServer worldserver, WorldServer worldserver1) { @@ -677,7 +678,7 @@ if (entity.dimension == -1) { d0 = MathHelper.a(d0 / d2, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D); d1 = MathHelper.a(d1 / d2, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D); -@@ -513,6 +887,8 @@ +@@ -513,6 +888,8 @@ BlockPosition blockposition; if (i == 1) { @@ -686,7 +687,7 @@ blockposition = worldserver1.getSpawn(); } else { blockposition = worldserver1.getDimensionSpawn(); -@@ -526,15 +902,26 @@ +@@ -526,15 +903,26 @@ worldserver.entityJoinedWorld(entity, false); } } @@ -715,7 +716,7 @@ worldserver1.addEntity(entity); worldserver1.entityJoinedWorld(entity, false); } -@@ -543,6 +930,7 @@ +@@ -543,6 +931,7 @@ } entity.spawnIn(worldserver1); @@ -723,7 +724,7 @@ } public void tick() { -@@ -560,6 +948,25 @@ +@@ -560,6 +949,25 @@ } @@ -749,7 +750,7 @@ public void a(Packet packet, int i) { for (int j = 0; j < this.players.size(); ++j) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); -@@ -658,11 +1065,23 @@ +@@ -658,11 +1066,23 @@ this.operators.add(new OpListEntry(gameprofile, this.server.q(), this.operators.b(gameprofile))); this.b(this.a(gameprofile.getId()), i); @@ -773,7 +774,7 @@ } private void b(EntityPlayer entityplayer, int i) { -@@ -687,7 +1106,7 @@ +@@ -687,7 +1107,7 @@ } public boolean isOp(GameProfile gameprofile) { @@ -782,7 +783,7 @@ } public EntityPlayer getPlayer(String s) { -@@ -710,6 +1129,12 @@ +@@ -710,6 +1130,12 @@ for (int j = 0; j < this.players.size(); ++j) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); @@ -795,7 +796,7 @@ if (entityplayer != entityhuman && entityplayer.dimension == i) { double d4 = d0 - entityplayer.locX; double d5 = d1 - entityplayer.locY; -@@ -757,21 +1182,26 @@ +@@ -757,21 +1183,26 @@ public void reloadWhitelist() {} public void b(EntityPlayer entityplayer, WorldServer worldserver) { @@ -827,7 +828,7 @@ entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); } -@@ -784,7 +1214,7 @@ +@@ -784,7 +1215,7 @@ } public String[] getSeenPlayers() { @@ -836,7 +837,7 @@ } public boolean getHasWhitelist() { -@@ -834,16 +1264,26 @@ +@@ -834,16 +1265,26 @@ public void u() { for (int i = 0; i < this.players.size(); ++i) { @@ -865,7 +866,7 @@ } public void sendMessage(IChatBaseComponent ichatbasecomponent) { -@@ -880,8 +1320,10 @@ +@@ -880,8 +1321,10 @@ WorldServer[] aworldserver = this.server.worldServer; int j = aworldserver.length; -- cgit v1.2.3