2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/CommandTp.java
|
|
|
|
+++ b/net/minecraft/server/CommandTp.java
|
2016-06-09 03:43:49 +02:00
|
|
|
@@ -53,17 +53,11 @@
|
2014-12-12 23:54:59 +01:00
|
|
|
} else {
|
2017-05-14 04:00:00 +02:00
|
|
|
Entity entity = c(minecraftserver, icommandlistener, astring[astring.length - 1]);
|
2014-12-12 23:54:59 +01:00
|
|
|
|
|
|
|
- if (entity.world != ((Entity) object).world) {
|
|
|
|
- throw new CommandException("commands.tp.notSameDimension", new Object[0]);
|
|
|
|
- } else {
|
2016-02-29 22:32:46 +01:00
|
|
|
- ((Entity) object).stopRiding();
|
2014-12-12 23:54:59 +01:00
|
|
|
- if (object instanceof EntityPlayer) {
|
|
|
|
- ((EntityPlayer) object).playerConnection.a(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
|
|
|
|
- } else {
|
|
|
|
- ((Entity) object).setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
+ // CraftBukkit Start
|
|
|
|
+ // Use Bukkit teleport method in all cases. It has cross dimensional handling, events
|
|
|
|
+ if (((Entity) object).getBukkitEntity().teleport(entity.getBukkitEntity(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND)) {
|
2016-02-29 22:32:46 +01:00
|
|
|
a(icommandlistener, (ICommand) this, "commands.tp.success", new Object[] { ((Entity) object).getName(), entity.getName()});
|
2014-12-12 23:54:59 +01:00
|
|
|
+ // CraftBukkit End
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-03-24 05:14:31 +01:00
|
|
|
@@ -107,7 +101,7 @@
|
|
|
|
}
|
|
|
|
|
|
|
|
entity.stopRiding();
|
|
|
|
- ((EntityPlayer) entity).playerConnection.a(commandabstract_commandnumber.b(), commandabstract_commandnumber1.b(), commandabstract_commandnumber2.b(), f, f1, enumset);
|
|
|
|
+ ((EntityPlayer) entity).playerConnection.a(commandabstract_commandnumber.b(), commandabstract_commandnumber1.b(), commandabstract_commandnumber2.b(), f, f1, enumset, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit
|
2017-05-14 04:00:00 +02:00
|
|
|
entity.setHeadRotation(f);
|
2017-03-24 05:14:31 +01:00
|
|
|
} else {
|
|
|
|
float f2 = (float) MathHelper.g(commandabstract_commandnumber3.a());
|
2017-06-04 00:39:36 +02:00
|
|
|
@@ -132,4 +126,11 @@
|
2014-12-12 23:54:59 +01:00
|
|
|
public boolean isListStart(String[] astring, int i) {
|
|
|
|
return i == 0;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // CraftBukkit start - fix decompile error
|
|
|
|
+ @Override
|
2015-02-26 23:41:06 +01:00
|
|
|
+ public int compareTo(ICommand o) {
|
2014-12-12 23:54:59 +01:00
|
|
|
+ return a((ICommand) o);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|