--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GcCommand.java 2011/12/23 10:27:05 1673 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/GcCommand.java 2017/05/31 08:56:00 3201 @@ -1,18 +1,9 @@ package dk.thoerup.bukkit.hoeruputils; -import java.io.File; -import java.io.IOException; - -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.configuration.Configuration; -import org.bukkit.configuration.file.YamlConfiguration; public class GcCommand implements CommandExecutor { @@ -20,8 +11,10 @@ public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { if ( sender instanceof Player) { - sender.sendMessage("gc can only be called from console!"); - return false; + if ( ! sender.isOp() ) { + sender.sendMessage("gc can only be called from console - or by a server operator"); + return false; + } } System.gc();