diff options
Diffstat (limited to 'nms-patches/CommandTp.patch')
-rw-r--r-- | nms-patches/CommandTp.patch | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/nms-patches/CommandTp.patch b/nms-patches/CommandTp.patch index 13912dd7..de9d839e 100644 --- a/nms-patches/CommandTp.patch +++ b/nms-patches/CommandTp.patch @@ -1,29 +1,34 @@ --- a/net/minecraft/server/CommandTp.java +++ b/net/minecraft/server/CommandTp.java -@@ -105,17 +105,11 @@ +@@ -97,27 +97,28 @@ } else { - Entity entity = b(icommandlistener, astring[astring.length - 1]); + Entity entity = b(minecraftserver, icommandlistener, astring[astring.length - 1]); - if (entity.world != ((Entity) object).world) { - throw new CommandException("commands.tp.notSameDimension", new Object[0]); - } else { -- ((Entity) object).mount((Entity) null); +- ((Entity) object).stopRiding(); - 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); - } - -- a(icommandlistener, this, "commands.tp.success", new Object[] { ((Entity) object).getName(), entity.getName()}); + // 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)) { -+ a(icommandlistener, this, "commands.tp.success", new Object[]{((Entity) object).getName(), entity.getName()}); + a(icommandlistener, (ICommand) this, "commands.tp.success", new Object[] { ((Entity) object).getName(), entity.getName()}); + // CraftBukkit End } } } -@@ -128,4 +122,11 @@ + } + + 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 + } + public boolean isListStart(String[] astring, int i) { return i == 0; } |