2017-03-17 14:17:52 +01:00
|
|
|
From 791a5b0f6feb0c241429bd044f2255ee251c3bc4 Mon Sep 17 00:00:00 2001
|
2017-03-17 04:31:53 +01:00
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
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
|
2017-03-17 14:17:52 +01:00
|
|
|
index 0e1d9817b..385329774 100644
|
2017-03-17 04:31:53 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2017-03-17 06:04:34 +01:00
|
|
|
@@ -2325,7 +2325,7 @@ public abstract class Entity implements ICommandListener {
|
2017-03-17 04:31:53 +01:00
|
|
|
// CraftBukkit end */
|
|
|
|
|
2017-03-17 06:04:34 +01:00
|
|
|
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;
|
2017-03-17 14:17:52 +01:00
|
|
|
@@ -2376,7 +2376,20 @@ public abstract class Entity implements ICommandListener {
|
|
|
|
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
|
2017-03-17 06:04:34 +01:00
|
|
|
}
|
2017-03-17 14:17:52 +01:00
|
|
|
// 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;
|
2017-03-17 06:04:34 +01:00
|
|
|
|
2017-03-17 14:17:52 +01:00
|
|
|
entity.attachedToPlayer = true;
|
2017-03-17 04:31:53 +01:00
|
|
|
--
|
2017-03-17 14:17:52 +01:00
|
|
|
2.12.0
|
2017-03-17 04:31:53 +01:00
|
|
|
|