3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00
Paper/nms-patches/CommandTp.patch

38 Zeilen
1.8 KiB
Diff

2015-02-26 23:41:06 +01:00
--- /home/matt/mc-dev-private//net/minecraft/server/CommandTp.java 2015-02-26 22:40:22.371608142 +0000
+++ src/main/java/net/minecraft/server/CommandTp.java 2015-02-26 22:40:22.371608142 +0000
@@ -105,17 +105,11 @@
} else {
Entity entity = b(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);
- 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()});
+ // CraftBukkit End
}
}
}
@@ -128,4 +122,11 @@
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) {
+ return a((ICommand) o);
+ }
+ // CraftBukkit end
}