13
0
geforkt von Mirrors/Paper

Fix ClassCastException in tabCompletor (fixes #942)

Dieser Commit ist enthalten in:
Shane Freeder 2017-11-27 16:52:32 +00:00
Ursprung f7f8c59f60
Commit 149f6e1511

Datei anzeigen

@ -80,15 +80,17 @@ index 5a620f3fd..35774f8bf 100644
public void a(PacketPlayInSettings packetplayinsettings) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index aa098172f..883aca80a 100644
index aa098172f..09eb79439 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
} else {
offers = tabCompleteChat(player, message);
}
-
- TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers);
+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((EntityPlayer) player).world, pos) : null); // Paper
+
+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), pos) : null); // Paper
getPluginManager().callEvent(tabEvent);
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();