2015-05-25 18:37:24 +08:00
|
|
|
--- a/net/minecraft/server/CommandTp.java
|
|
|
|
+++ b/net/minecraft/server/CommandTp.java
|
2016-03-01 05:32:46 +08:00
|
|
|
@@ -97,27 +97,28 @@
|
2014-12-13 06:54:59 +08:00
|
|
|
} else {
|
2016-03-01 05:32:46 +08:00
|
|
|
Entity entity = b(minecraftserver, icommandlistener, astring[astring.length - 1]);
|
2014-12-13 06:54:59 +08:00
|
|
|
|
|
|
|
- if (entity.world != ((Entity) object).world) {
|
|
|
|
- throw new CommandException("commands.tp.notSameDimension", new Object[0]);
|
|
|
|
- } else {
|
2016-03-01 05:32:46 +08:00
|
|
|
- ((Entity) object).stopRiding();
|
2014-12-13 06:54:59 +08: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-03-01 05:32:46 +08:00
|
|
|
a(icommandlistener, (ICommand) this, "commands.tp.success", new Object[] { ((Entity) object).getName(), entity.getName()});
|
2014-12-13 06:54:59 +08:00
|
|
|
+ // CraftBukkit End
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-01 05:32:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, BlockPosition blockposition) {
|
|
|
|
- return astring.length != 1 && astring.length != 2 ? Collections.emptyList() : a(astring, minecraftserver.getPlayers());
|
|
|
|
+ return astring.length != 1 && astring.length != 2 ? Collections.<String>emptyList() : a(astring, minecraftserver.getPlayers()); // CraftBukkit - decompile error
|
|
|
|
}
|
|
|
|
|
2014-12-13 06:54:59 +08:00
|
|
|
public boolean isListStart(String[] astring, int i) {
|
|
|
|
return i == 0;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // CraftBukkit start - fix decompile error
|
|
|
|
+ @Override
|
2015-02-27 06:41:06 +08:00
|
|
|
+ public int compareTo(ICommand o) {
|
2014-12-13 06:54:59 +08:00
|
|
|
+ return a((ICommand) o);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|