Just make sure an entity's exit is set properly

Don't re-add, it's redundant and you end up with inconsistent
inconsistencies inconsistently
This commit is contained in:
Zach Brown 2017-03-17 00:50:43 -05:00
parent 08aa6e5f49
commit 60182fd473
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76

View file

@ -1,11 +1,11 @@
From ceabaae622b6af7225c9f35e188275dbe759acd6 Mon Sep 17 00:00:00 2001 From cfd888d784201ae7ec2a67352ca5747e9bae5a91 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com> From: Shane Freeder <theboyetronic@gmail.com>
Date: Fri, 17 Mar 2017 01:45:15 +0000 Date: Fri, 17 Mar 2017 01:45:15 +0000
Subject: [PATCH] Fix a duplicate alive entity on second world Subject: [PATCH] Fix a duplicate alive entity on second world
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 0e1d9817..92ba4fcb 100644 index 0e1d9817b..92ba4fcb5 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2325,7 +2325,7 @@ public abstract class Entity implements ICommandListener { @@ -2325,7 +2325,7 @@ public abstract class Entity implements ICommandListener {
@ -18,44 +18,25 @@ index 0e1d9817..92ba4fcb 100644
/* CraftBukkit start - Handled in calculateTarget /* CraftBukkit start - Handled in calculateTarget
BlockPosition blockposition; BlockPosition blockposition;
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index a9d59bbf..a83a3054 100644 index a9d59bbf5..4ba4d527e 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -803,7 +803,7 @@ public abstract class PlayerList {
entityplayer.playerConnection.sendPacket(new PacketPlayOutRespawn(entityplayer.dimension, entityplayer.world.getDifficulty(), entityplayer.world.getWorldData().getType(), entityplayer.playerInteractManager.getGameMode()));
this.f(entityplayer);
worldserver.removeEntity(entityplayer);
- entityplayer.dead = false;
+ //entityplayer.dead = false; // Paper - He's dead jim - Handle players the same way we do all entities
this.changeWorld(entityplayer, j, worldserver, worldserver1);
this.a(entityplayer, worldserver);
entityplayer.playerConnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
@@ -923,9 +923,9 @@ public abstract class PlayerList {
worldserver.methodProfiler.a("moving");
entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch());
- if (entity.isAlive()) {
+ //if (entity.isAlive()) { // Paper - The entity will be dead, that's okay
worldserver.entityJoinedWorld(entity, false);
- }
+ //} // Paper
/*
if (entity.dimension == -1) {
d0 = MathHelper.a(d0 / 8.0D, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
@@ -969,7 +969,7 @@ public abstract class PlayerList { @@ -969,7 +969,7 @@ public abstract class PlayerList {
d0 = (double) MathHelper.clamp((int) d0, -29999872, 29999872); d0 = (double) MathHelper.clamp((int) d0, -29999872, 29999872);
d1 = (double) MathHelper.clamp((int) d1, -29999872, 29999872); d1 = (double) MathHelper.clamp((int) d1, -29999872, 29999872);
*/ */
- if (entity.isAlive()) { - if (entity.isAlive()) {
+ //if (entity.isAlive()) { // Paper - The entity will be dead, that's okay + //if (entity.isAlive()) { // Paper - Moved down
// entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); // entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch);
// worldserver1.getTravelAgent().a(entity, f); // worldserver1.getTravelAgent().a(entity, f);
if (portal) { if (portal) {
@@ -982,7 +982,7 @@ public abstract class PlayerList { @@ -981,8 +981,8 @@ public abstract class PlayerList {
}
} }
// worldserver1.addEntity(entity); // worldserver1.addEntity(entity);
worldserver1.entityJoinedWorld(entity, false); - worldserver1.entityJoinedWorld(entity, false);
- } - }
+ if (entity.isAlive()) worldserver1.entityJoinedWorld(entity, false); // Paper - Moved down from above
+ //} // Paper + //} // Paper
worldserver.methodProfiler.b(); worldserver.methodProfiler.b();