diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 1014274e5..b173ac7a0 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -666,7 +666,7 @@ public final class Bukkit { } /** - * @see Server#loadServerIcon(File)() + * @see Server#loadServerIcon(File) */ public static CachedServerIcon loadServerIcon(File file) throws Exception { return server.loadServerIcon(file); @@ -678,4 +678,18 @@ public final class Bukkit { public static CachedServerIcon loadServerIcon(BufferedImage image) throws Exception { return server.loadServerIcon(image); } + + /** + * @see Server#setIdleTimeout(int) + */ + public static void setIdleTimeout(int threshold) { + server.setIdleTimeout(threshold); + } + + /** + * @see Server#getIdleTimeout() + */ + public static int getIdleTimeout() { + return server.getIdleTimeout(); + } } diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 1eb32b786..5c9d2c7af 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -782,4 +782,21 @@ public interface Server extends PluginMessageRecipient { * ServerListPingEvent#setServerIcon(CachedServerIcon)} */ CachedServerIcon loadServerIcon(BufferedImage image) throws IllegalArgumentException, Exception; + + /** + * Set the idle kick timeout. Any players idle for the specified amount of + * time will be automatically kicked. + *
+ * A value of 0 will disable the idle kick timeout.
+ *
+ * @param threshold the idle timeout in minutes
+ */
+ public void setIdleTimeout(int threshold);
+
+ /**
+ * Gets the idle kick timeout.
+ *
+ * @return the idle timeout in minutes
+ */
+ public int getIdleTimeout();
}
diff --git a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java
index c2f488a71..d178ad0ff 100644
--- a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -61,6 +61,8 @@ public class SimpleCommandMap implements CommandMap {
fallbackCommands.add(new ScoreboardCommand());
fallbackCommands.add(new PlaySoundCommand());
fallbackCommands.add(new SpreadPlayersCommand());
+ fallbackCommands.add(new SetWorldSpawnCommand());
+ fallbackCommands.add(new SetIdleTimeoutCommand());
}
public SimpleCommandMap(final Server server) {
diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java
new file mode 100644
index 000000000..6b8bb2d26
--- /dev/null
+++ b/paper-api/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java
@@ -0,0 +1,53 @@
+package org.bukkit.command.defaults;
+
+import com.google.common.collect.ImmutableList;
+
+import org.apache.commons.lang.Validate;
+import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+
+import java.util.List;
+
+public class SetIdleTimeoutCommand extends VanillaCommand {
+
+ public SetIdleTimeoutCommand() {
+ super("setidletimeout");
+ this.description = "Sets the server's idle timeout";
+ this.usageMessage = "/setidletimeout