From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 17 Mar 2017 01:45:15 +0000 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 index 0e1d9817b..385329774 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { // CraftBukkit end */ this.world.kill(this); - this.dead = false; + //this.dead = false; // Paper - Mark entity as dead before we actually move it to the new world this.world.methodProfiler.a("reposition"); /* CraftBukkit start - Handled in calculateTarget BlockPosition blockposition; @@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { entity.setPositionRotation(blockposition, entity.yaw, entity.pitch); } // CraftBukkit end */ - + // Paper Start - relocate code to modify the entities exit in a portal + if (portal) { + org.bukkit.util.Vector velocity = entity.getBukkitEntity().getVelocity(); + worldserver1.getTravelAgent().adjustExit(entity, exit, velocity); + entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch()); + if (entity.motX != velocity.getX() || entity.motY != velocity.getY() || entity.motZ != velocity.getZ()) { + //entity.getBukkitEntity().setVelocity(velocity); // We don't have a CraftEntity yet, set these manually... + entity.motX = velocity.getX(); + entity.motY = velocity.getY(); + entity.motZ = velocity.getZ(); + entity.velocityChanged = true; + } + } + // Paper end boolean flag = entity.attachedToPlayer; entity.attachedToPlayer = true; --