Squash these tab complete patches

This commit is contained in:
Zach Brown
2016-01-31 17:00:30 -06:00
parent 4a57c8b43d
commit 9d79cc6b99
4 changed files with 42 additions and 134 deletions

View File

@@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- completions = getCommandMap().tabComplete(player, message.substring(1));
+ // send location info if present
+ // completions = getCommandMap().tabComplete(player, message.substring(1));
+ if (blockPosition == null) {
+ if (blockPosition == null || !((CraftWorld) player.getWorld()).getHandle().paperSpigotConfig.allowBlockLocationTabCompletion) {
+ completions = getCommandMap().tabComplete(player, message.substring(1));
+ } else {
+ completions = getCommandMap().tabComplete(player, message.substring(1), new Location(player.getWorld(), blockPosition.getX(), blockPosition.getY(), blockPosition.getZ()));
@@ -133,4 +133,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static CommandSender lastSender = null; // Nasty :(
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
{
allChunksAreSlimeChunks = getBoolean( "all-chunks-are-slime-chunks", false );
}
+
+ public boolean allowBlockLocationTabCompletion;
+ private void allowBlockLocationTabCompletion()
+ {
+ allowBlockLocationTabCompletion = getBoolean( "allow-block-location-tab-completion", true );
+ }
}
--

View File

@@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DemonWav <demonwav@gmail.com>
Date: Sun, 31 Jan 2016 01:21:03 -0600
Subject: [PATCH] Make block location tab completion be a per-world
configurable value
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 {
try {
// send location info if present
// completions = getCommandMap().tabComplete(player, message.substring(1));
- if (blockPosition == null) {
+ if (blockPosition == null || !((CraftWorld) player.getWorld()).getHandle().paperSpigotConfig.allowBlockLocationTabCompletion) {
completions = getCommandMap().tabComplete(player, message.substring(1));
} else {
completions = getCommandMap().tabComplete(player, message.substring(1), new Location(player.getWorld(), blockPosition.getX(), blockPosition.getY(), blockPosition.getZ()));
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
{
allChunksAreSlimeChunks = getBoolean( "all-chunks-are-slime-chunks", false );
}
+
+ public boolean allowBlockLocationTabCompletion;
+ private void allowBlockLocationTabCompletion()
+ {
+ allowBlockLocationTabCompletion = getBoolean( "allow-block-location-tab-completion", true );
+ }
}
--